Module: Capricorn::Actors::BaseActor::Helper
- Defined in:
- lib/capricorn/actors/base_actor.rb
Instance Method Summary collapse
-
#ensure_presence_of_gem(name, options = {}) ⇒ Object
ensure the presence of a gem.
-
#gem_install(name, options = {}) ⇒ Object
install a gem.
-
#gem_installed(name, options) ⇒ Object
check if a gem is installed.
-
#gem_update(name, options = {}) ⇒ Object
update a gem.
Instance Method Details
#ensure_presence_of_gem(name, options = {}) ⇒ Object
ensure the presence of a gem
189 190 191 192 193 |
# File 'lib/capricorn/actors/base_actor.rb', line 189 def ensure_presence_of_gem(name, ={}) if !gem_installed(name, ) gem_install(name, ) end end |
#gem_install(name, options = {}) ⇒ Object
install a gem.
172 173 174 |
# File 'lib/capricorn/actors/base_actor.rb', line 172 def gem_install(name, ={}) gem_cmd('install', name, ) end |
#gem_installed(name, options) ⇒ Object
check if a gem is installed
177 178 179 180 181 |
# File 'lib/capricorn/actors/base_actor.rb', line 177 def gem_installed(name, ) version = [:version] || '0.0.0' = { :version => version, :installed => true } (gem_cmd('list', name, ).strip == 'true') end |
#gem_update(name, options = {}) ⇒ Object
update a gem
184 185 186 |
# File 'lib/capricorn/actors/base_actor.rb', line 184 def gem_update(name, ={}) !(gem_cmd('update', name, ) =~ /Nothing to update/) end |