Class: Rockit::Dsl

Inherits:
Object
  • Object
show all
Defined in:
lib/rockit/dsl.rb

Instance Method Summary collapse

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, options={})
  @app.command(command, options)
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, options={})
  @app.system_exit_on_error(command, options)
end

#service(service_name, options = {}) ⇒ Object



25
26
27
# File 'lib/rockit/dsl.rb', line 25

def service(service_name, options={})
  @app.service(service_name, options)
end

#verbose_offObject



13
14
15
# File 'lib/rockit/dsl.rb', line 13

def verbose_off
  @app.debug(false)
end

#verbose_onObject



9
10
11
# File 'lib/rockit/dsl.rb', line 9

def verbose_on
  @app.debug(true)
end