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.

Author:

  • Arjan van der Gaag

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.

Returns:

  • (nil)

Since:

  • 0.3.0



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.

Returns:

  • (nil)

See Also:

Since:

  • 0.3.0



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.

Returns:

  • (String)

    the command’s output

See Also:

Since:

  • 0.3.0



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.

Returns:

  • (String)

    the formatted template

See Also:

Since:

  • 0.3.0



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

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