Blankman
Blankman

Reputation: 267000

breakdown of a install.rb file, please help me understand this

I'm looking at the install.rb file of RoR open source project:

version = ARGV.pop

%w( core api auth dash promotions sample ).each do |framework|
  puts "Installing #{framework}..."
  `cd #{framework} && gem build spree_#{framework}.gemspec && gem install spree_#{framework}-#{version}.gem --no-ri --no-rdoc && rm spree_#{framework}-#{version}.gem`
end

puts "Installing Spree..."
`gem build spree.gemspec`
`gem install spree-#{version}.gem --no-ri --no-rdoc `
`rm spree-#{version}.gem

the lines i'm interested in at the moment are:

gem build spree_core.gemspec && gem install spree_core-xxxx.gem

the core.gemspec looks like:

version = File.read(File.expand_path("../../SPREE_VERSION", __FILE__)).strip

Gem::Specification.new do |s|
  s.platform    = Gem::Platform::RUBY
  s.name        = 'spree_core'
  s.version     = version
  s.summary     = 'Core e-commerce functionality for the Spree project.'
  s.description = 'Required dependancy for Spree'

  s.required_ruby_version = '>= 1.8.7'
  s.author      = 'Sean Schofield'
  s.email       = '[email protected]'
  s.homepage    = 'http://spreecommerce.com'
  s.rubyforge_project = 'spree_core'

  s.files        = Dir['LICENSE', 'README.md', 'app/**/*', 'config/**/*', 'lib/**/*']
  s.require_path = 'lib'
  s.requirements << 'none'

  s.add_dependency('acts_as_list', '>= 0.1.2')
  s.add_dependency('rd_awesome_nested_set', '>= 1.4.4')
  s.add_dependency('rd_unobtrusive_date_picker', '>= 0.1.0')

  s.add_dependency('highline', '>= 1.5.1')
  #s.add_dependency('less', '>= 1.2.20')
  s.add_dependency('stringex', '>= 1.0.3')
  s.add_dependency('state_machine', '>= 0.9.4')
  s.add_dependency('faker', '>= 0.3.1')
  s.add_dependency('paperclip', '>= 2.3.1.1')
  s.add_dependency('rd_resource_controller')
  s.add_dependency('rd_searchlogic', '>= 3.0.0.rc3')
  s.add_dependency('activemerchant', '>= 1.7.1')
  s.add_dependency('will_paginate', '>= 3.0.pre')
end

What is this doing? It seems to generate a file b/c there is a call to rm.

Upvotes: 0

Views: 177

Answers (2)

Paul Rubel
Paul Rubel

Reputation: 27222

Once the gem is installed with the

gem install 

command you no longer need the .gem file. It's just a left-over at this point as all the contents of the package have been placed in the file system. There's no need to keep it around so the .gem file is deleted; it's done its job to get all the files to you in a one-file bundle

Upvotes: 1

BvuRVKyUVlViVIc7
BvuRVKyUVlViVIc7

Reputation: 11811

It generates a gem-file, installs it and removes it afterwards?

Upvotes: 0

Related Questions