Module: RailsBootReporting

Extended by:
RailsBootReporting
Included in:
RailsBootReporting
Defined in:
lib/rails-boot-reporting.rb

Instance Method Summary collapse

Instance Method Details

#gem_path(gem, version, file) ⇒ Object



24
25
26
# File 'lib/rails-boot-reporting.rb', line 24

def gem_path(gem, version, file)
  install_path = File.join(ENV['BUNDLE_DIR'] || ENV['GEM_HOME'], 'gems', "#{gem}-#{version}", 'lib', file)
end

#installObject



6
7
8
9
10
# File 'lib/rails-boot-reporting.rb', line 6

def install
  install_rails
  install_bundler
  puts "Done."
end

#install_bundlerObject



17
18
19
20
21
22
# File 'lib/rails-boot-reporting.rb', line 17

def install_bundler
  puts "-- Installing Bundler patches"
  bundler_version = Bundler::VERSION
  short_version = bundler_version.split('.', 3)[0..1].join('.')
  install_file("bundler-#{short_version}/runtime.rb", gem_path('bundler', bundler_version, 'bundler/runtime.rb'))
end

#install_file(local_path, install_path) ⇒ Object



28
29
30
31
32
# File 'lib/rails-boot-reporting.rb', line 28

def install_file(local_path, install_path)
  local_path = File.join(File.dirname(File.expand_path(__FILE__)), local_path)
  puts "Copying #{local_path} to #{install_path}"
  FileUtils.cp(local_path, install_path)
end

#install_railsObject



12
13
14
15
# File 'lib/rails-boot-reporting.rb', line 12

def install_rails
  puts "-- Installing Rails patches"
  install_file('rails-2.3.14/initializer.rb', gem_path('rails', '2.3.14', 'initializer.rb'))
end