Module: ActiveWrapper::Gems
- Defined in:
- lib/active_wrapper/gems.rb
Defined Under Namespace
Classes: SimpleStruct
Class Attribute Summary collapse
-
.config ⇒ Object
Returns the value of attribute config.
-
.gemset ⇒ Object
Returns the value of attribute gemset.
-
.gemsets ⇒ Object
Returns the value of attribute gemsets.
-
.versions ⇒ Object
Returns the value of attribute versions.
Class Method Summary collapse
Class Attribute Details
.config ⇒ Object
Returns the value of attribute config.
9 10 11 |
# File 'lib/active_wrapper/gems.rb', line 9 def config @config end |
.gemset ⇒ Object
Returns the value of attribute gemset.
9 10 11 |
# File 'lib/active_wrapper/gems.rb', line 9 def gemset @gemset end |
.gemsets ⇒ Object
Returns the value of attribute gemsets.
9 10 11 |
# File 'lib/active_wrapper/gems.rb', line 9 def gemsets @gemsets end |
.versions ⇒ Object
Returns the value of attribute versions.
9 10 11 |
# File 'lib/active_wrapper/gems.rb', line 9 def versions @versions end |
Class Method Details
.activate(*gems) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/active_wrapper/gems.rb', line 29 def activate(*gems) begin require 'rubygems' unless defined?(::Gem) rescue LoadError puts "rubygems library could not be required" if @config.warn end self.gemset = :default unless defined?(@gemset) && @gemset gems.flatten.collect(&:to_sym).each do |name| version = @versions[name] if defined?(gem) gem name.to_s, version else puts "#{name} #{"(#{version})" if version} failed to activate" if @config.warn end end end |
.gemspec(reload = false) ⇒ Object
77 78 79 80 81 82 83 84 |
# File 'lib/active_wrapper/gems.rb', line 77 def gemspec(reload=false) if @gemspec && !reload @gemspec else data = YAML::load(File.read(@config.gemspec)) rescue {} @gemspec = SimpleStruct.new(data) end end |