Class: Ramaze::Gems::GemStone
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(name, options = {}) ⇒ GemStone
constructor
A new instance of GemStone.
- #install ⇒ Object
- #setup(ran = false) ⇒ Object
Constructor Details
#initialize(name, options = {}) ⇒ GemStone
Returns a new instance of GemStone.
36 37 38 39 40 |
# File 'lib/ramaze/contrib/gems.rb', line 36 def initialize(name, = {}) @name, @options = name, require 'rubygems/dependency_installer' @installer = Gem::DependencyInstaller.new(@options) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
34 35 36 |
# File 'lib/ramaze/contrib/gems.rb', line 34 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
34 35 36 |
# File 'lib/ramaze/contrib/gems.rb', line 34 def @options end |
Instance Method Details
#install ⇒ Object
52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/ramaze/contrib/gems.rb', line 52 def install if extconf = ([:extconf] || Gems.[:extconf]) old_argv = ARGV.clone ARGV.replace extconf.split(' ') end print "Installing #{name}..." @installer.install name, [:version] puts "done.\n\n" ensure ARGV.replace old_argv if extconf end |
#setup(ran = false) ⇒ Object
42 43 44 45 46 47 48 49 50 |
# File 'lib/ramaze/contrib/gems.rb', line 42 def setup(ran = false) Gem.activate(name, *[[:version]].compact) require [:lib] || name rescue LoadError => error puts error return if ran install setup(ran = true) end |