Module: Subtrigger
- Extended by:
- Subtrigger
- Included in:
- Subtrigger
- Defined in:
- lib/subtrigger.rb,
lib/subtrigger/dsl.rb,
lib/subtrigger/path.rb,
lib/subtrigger/rule.rb,
lib/subtrigger/revision.rb,
lib/subtrigger/template.rb
Defined Under Namespace
Modules: Dsl Classes: Path, Revision, Rule, Template
Constant Summary collapse
- Exception =
Standard exception for all Subtrigger exceptions
Class.new(Exception)
Instance Method Summary collapse
-
#path ⇒ Path
The ‘global’ Path object.
-
#run(repository_path, revision_number) ⇒ Object
Run the current file of rules.
-
#svn(*args) ⇒ String
Make a system call to
svn
with the given arguments. -
#svnlook(*args) ⇒ String
Make a system call to
svnlook
with the given arguments. -
#version ⇒ String
Return the current version number as defined in ./VERSION.
Instance Method Details
#path ⇒ Path
Returns The ‘global’ Path object.
71 72 73 |
# File 'lib/subtrigger.rb', line 71 def path @path ||= Path.new end |
#run(repository_path, revision_number) ⇒ Object
Run the current file of rules.
This method is called after all the rules have been defined. It takes the command line arguments that come from subversion.
36 37 38 39 40 41 42 43 44 |
# File 'lib/subtrigger.rb', line 36 def run(repository_path, revision_number) Template.parse(DATA.read) rev = Revision.new( revision_number, svnlook('info', repository_path), svnlook('dirs-changed', repository_path) ) Rule.matching(rev).each { |r| r.run(rev) } end |
#svn(*args) ⇒ String
Make a system call to svn
with the given arguments. The executable that used is the first found by Subtrigger::Path#to.
53 54 55 |
# File 'lib/subtrigger.rb', line 53 def svn(*args) `svn #{[*args].join(' ')}` end |
#svnlook(*args) ⇒ String
Make a system call to svnlook
with the given arguments. The executable # that used is the first found in POSSIBLE_PATHS
.
65 66 67 |
# File 'lib/subtrigger.rb', line 65 def svnlook(*args) `svnlook #{[*args].join(' ')}` end |
#version ⇒ String
Return the current version number as defined in ./VERSION
23 24 25 |
# File 'lib/subtrigger.rb', line 23 def version File.read(File.join(File.dirname(__FILE__), '..', 'VERSION')) end |