Class: Rockit::Dsl
- Inherits:
-
Object
- Object
- Rockit::Dsl
- Defined in:
- lib/rockit/dsl.rb
Instance Method Summary collapse
- #command(command, options = {}) ⇒ Object
- #if_command_missing(command, &block) ⇒ Object
- #if_directory_changed(directory, &block) ⇒ Object
- #if_file_changed(filename, &block) ⇒ Object
- #if_first_time(&block) ⇒ Object
- #if_service_not_running(service_name, &block) ⇒ Object
- #if_string_changed(changeable, name, &block) ⇒ Object
- #if_string_digest_changed(name, changeable, &block) ⇒ Object
-
#initialize(app) ⇒ Dsl
constructor
A new instance of Dsl.
- #run(command, options = {}) ⇒ Object
- #service(service_name, options = {}) ⇒ Object
- #verbose_off ⇒ Object
- #verbose_on ⇒ Object
Constructor Details
#initialize(app) ⇒ Dsl
Returns a new instance of Dsl.
5 6 7 |
# File 'lib/rockit/dsl.rb', line 5 def initialize(app) @app = app end |
Instance Method Details
#command(command, options = {}) ⇒ Object
17 18 19 |
# File 'lib/rockit/dsl.rb', line 17 def command(command, ={}) @app.command(command, ) end |
#if_command_missing(command, &block) ⇒ Object
21 22 23 |
# File 'lib/rockit/dsl.rb', line 21 def if_command_missing(command, &block) @app.command(command, {:on_failure => block}) end |
#if_directory_changed(directory, &block) ⇒ Object
33 34 35 36 |
# File 'lib/rockit/dsl.rb', line 33 def if_directory_changed(directory, &block) exit unless Dir.exists?(directory) @app.if_directory_changed(directory, &block) end |
#if_file_changed(filename, &block) ⇒ Object
38 39 40 41 |
# File 'lib/rockit/dsl.rb', line 38 def if_file_changed(filename, &block) exit unless File.exists?(filename) @app.if_file_changed(filename, &block) end |
#if_first_time(&block) ⇒ Object
43 44 45 |
# File 'lib/rockit/dsl.rb', line 43 def if_first_time(&block) @app.if_first_time(&block) end |
#if_service_not_running(service_name, &block) ⇒ Object
29 30 31 |
# File 'lib/rockit/dsl.rb', line 29 def if_service_not_running(service_name, &block) @app.service(service_name, {:on_failure => block}) end |
#if_string_changed(changeable, name, &block) ⇒ Object
47 48 49 |
# File 'lib/rockit/dsl.rb', line 47 def if_string_changed(changeable, name, &block) @app.if_string_changed(name, changeable, &block) end |
#if_string_digest_changed(name, changeable, &block) ⇒ Object
51 52 53 |
# File 'lib/rockit/dsl.rb', line 51 def if_string_digest_changed(name, changeable, &block) @app.if_string_digest_changed(name, changeable, &block) end |
#run(command, options = {}) ⇒ Object
55 56 57 |
# File 'lib/rockit/dsl.rb', line 55 def run(command, ={}) @app.system_exit_on_error(command, ) end |
#service(service_name, options = {}) ⇒ Object
25 26 27 |
# File 'lib/rockit/dsl.rb', line 25 def service(service_name, ={}) @app.service(service_name, ) end |
#verbose_off ⇒ Object
13 14 15 |
# File 'lib/rockit/dsl.rb', line 13 def verbose_off @app.debug(false) end |
#verbose_on ⇒ Object
9 10 11 |
# File 'lib/rockit/dsl.rb', line 9 def verbose_on @app.debug(true) end |