Class: ActiveScripts::Preparations::Base

Inherits:
Base
  • Object
show all
Defined in:
lib/active_scripts/preparations/base.rb

Direct Known Subclasses

Freebsd, Macosx, Unix, Windows

Constant Summary collapse

COMMANDS =

INFO: ActiveScripts::Preparations::Base contains code that is

shared between all preparation files.
[:setup, :update]
OPTIONS =
[:dry_run, :verbose]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command, options = {}) ⇒ Base

Returns a new instance of Base.



13
14
15
16
# File 'lib/active_scripts/preparations/base.rb', line 13

def initialize(command, options={})
  @command = command
  @options = options
end

Instance Attribute Details

#commandObject

Returns the value of attribute command.



11
12
13
# File 'lib/active_scripts/preparations/base.rb', line 11

def command
  @command
end

#optionsObject

Returns the value of attribute options.



11
12
13
# File 'lib/active_scripts/preparations/base.rb', line 11

def options
  @options
end

Class Method Details

.execute(command, options = {}) ⇒ Object



18
19
20
# File 'lib/active_scripts/preparations/base.rb', line 18

def self.execute(command, options={})
  new(command, options).execute
end

Instance Method Details

#executeObject



22
23
24
25
26
# File 'lib/active_scripts/preparations/base.rb', line 22

def execute
  assert_valid_command!
  assert_valid_options!
  send(@command)
end