Module: Subtrigger::Dsl

Defined in:
lib/subtrigger/dsl.rb

Overview

The Dsl module provides some nice-looking methods that can be used to perform the most important Subtrigger operations.

This is intended to be included in the top-level namespace, so a script can call these functions directly.

Since:

  • 0.3.0

Instance Method Summary collapse

Instance Method Details

#mail(*args) ⇒ nil

Create and deliver a new Mail object using Pony. See its documentation for more information.

Since:

  • 0.3.0

Returns:



22
23
24
# File 'lib/subtrigger/dsl.rb', line 22

def mail(*args)
  ::Pony.mail(*args)
end

#on(*args, &block) ⇒ nil

Define a new trigger on incoming Revision.

See Also:

Since:

  • 0.3.0

Returns:



15
16
17
# File 'lib/subtrigger/dsl.rb', line 15

def on(*args, &block)
  Rule.new(*args, &block)
end

#svn(*args) ⇒ String

Call Subversion commands using the configured svn executable.

See Also:

Since:

  • 0.3.0

Returns:

  • the command's output



30
31
32
# File 'lib/subtrigger/dsl.rb', line 30

def svn(*args)
  Subtrigger.svn(*args)
end

#template(name, *format_arguments) ⇒ String

Get a template defined inline and format it using the given arguments.

See Also:

Since:

  • 0.3.0

Returns:

  • the formatted template



38
39
40
# File 'lib/subtrigger/dsl.rb', line 38

def template(name, *format_arguments)
  Template.find(name).format [*format_arguments]
end