Method: Sunshine::Gem#initialize
- Defined in:
- lib/sunshine/package_managers/gem.rb
#initialize(name, options = {}, &block) ⇒ Gem
Returns a new instance of Gem.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/sunshine/package_managers/gem.rb', line 19 def initialize(name, ={}, &block) super(name, ) do version = [:version] ? " --version '#{[:version]}'" : "" source = if [:source] " --source #{[:source]} --source http://gemcutter.org" end install_opts = " --no-ri --no-rdoc" if [:opts] install_opts = "#{install_opts} -- #{[:opts]}" end install "gem install #{@pkg}#{version}#{source}#{install_opts}" uninstall "gem uninstall #{@pkg}#{version}" check "gem list #{@pkg} -i#{version}" requires(*[:require].to_a) if [:require] instance_eval(&block) if block_given? end end |