Class: ActiveScripts::Packages::Base
- Defined in:
- lib/active_scripts/packages/base.rb
Direct Known Subclasses
All, Homebrew, Imagemagick, Jpegoptim, Mysql, Nginx, Optipng, Postgresql, Rails, Rbenv, Redis, Ruby, RubyBuild, Wkhtmltopdf
Constant Summary collapse
- COMMANDS =
INFO: ActiveScripts::Packages::Base contains code that is
shared between all package files. [:install, :upgrade, :uninstall]
- OPTIONS =
[:dry_run, :verbose]
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
-
#options ⇒ Object
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(command, options = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(command, options = {}) ⇒ Base
Returns a new instance of Base.
13 14 15 16 |
# File 'lib/active_scripts/packages/base.rb', line 13 def initialize(command, ={}) @command = command = end |
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
11 12 13 |
# File 'lib/active_scripts/packages/base.rb', line 11 def command @command end |
#options ⇒ Object
Returns the value of attribute options.
11 12 13 |
# File 'lib/active_scripts/packages/base.rb', line 11 def end |
Class Method Details
.execute(command, options = {}) ⇒ Object
18 19 20 |
# File 'lib/active_scripts/packages/base.rb', line 18 def self.execute(command, ={}) new(command, ).execute end |
Instance Method Details
#execute ⇒ Object
22 23 24 25 26 27 |
# File 'lib/active_scripts/packages/base.rb', line 22 def execute assert_valid_command! assert_valid_user! send(@command) end |