Skip to content

Commit

Permalink
Read Rails version from a file instead of modifying the load path and…
Browse files Browse the repository at this point in the history
… doing requires

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information
brynary authored and jeremy committed Mar 5, 2010
1 parent 46bf2f0 commit deb00bc
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 49 deletions.
1 change: 1 addition & 0 deletions RAILS_VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0.0.beta1
15 changes: 6 additions & 9 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,6 @@ require 'rake/rdoctask'
require 'rake/gempackagetask'

PROJECTS = %w(activesupport activemodel actionpack actionmailer activeresource activerecord railties)
PROJECTS.each { |project| $:.unshift "#{project}/lib" }

require "active_support/version"
require "active_model/version"
require "action_pack/version"
require "action_mailer/version"
require "active_resource/version"
require "active_record/version"
require "rails/version"

desc 'Run all tests by default'
task :default => %w(test test:isolated)
Expand Down Expand Up @@ -130,6 +121,12 @@ task :pdoc => :rdoc do
end

task :update_versions do
require File.dirname(__FILE__) + "/version"

File.open("RAILS_VERSION", "w") do |f|
f.write Rails::VERSION::STRING + "\n"
end

constants = {
"activesupport" => "ActiveSupport",
"activemodel" => "ActiveModel",
Expand Down
7 changes: 3 additions & 4 deletions actionmailer/actionmailer.gemspec
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
$:.unshift "lib"
require "action_mailer/version"
version = File.read("../RAILS_VERSION").strip

Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = 'actionmailer'
s.version = ActionMailer::VERSION::STRING
s.version = version
s.summary = 'Email composition, delivery, and receiving framework (part of Rails).'
s.description = 'Email on Rails. Compose, deliver, receive, and test emails using the familiar controller/view pattern. First-class support for multipart email and attachments.'
s.required_ruby_version = '>= 1.8.7'
Expand All @@ -20,7 +19,7 @@ Gem::Specification.new do |s|

s.has_rdoc = true

s.add_dependency('actionpack', "= #{ActionMailer::VERSION::STRING}")
s.add_dependency('actionpack', version)
s.add_dependency('mail', '~> 2.1.3')
s.add_dependency('text-format', '~> 1.0.0')
end
9 changes: 4 additions & 5 deletions actionpack/actionpack.gemspec
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
$:.unshift "lib"
require "action_pack/version"
version = File.read("../RAILS_VERSION").strip

Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = 'actionpack'
s.version = ActionPack::VERSION::STRING
s.version = version
s.summary = 'Web-flow and rendering framework putting the VC in MVC (part of Rails).'
s.description = 'Web apps on Rails. Simple, battle-tested conventions for building and testing MVC web applications. Works with any Rack-compatible server.'
s.required_ruby_version = '>= 1.8.7'
Expand All @@ -20,8 +19,8 @@ Gem::Specification.new do |s|

s.has_rdoc = true

s.add_dependency('activesupport', "= #{ActionPack::VERSION::STRING}")
s.add_dependency('activemodel', "= #{ActionPack::VERSION::STRING}")
s.add_dependency('activesupport', version)
s.add_dependency('activemodel', version)
s.add_dependency('rack', '~> 1.1.0')
s.add_dependency('rack-test', '~> 0.5.0')
s.add_dependency('rack-mount', '~> 0.5.1')
Expand Down
7 changes: 3 additions & 4 deletions activemodel/activemodel.gemspec
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
$:.unshift "lib"
require "active_model/version"
version = File.read("../RAILS_VERSION").strip

Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = 'activemodel'
s.version = ActiveModel::VERSION::STRING
s.version = version
s.summary = 'A toolkit for building modeling frameworks (part of Rails).'
s.description = 'A toolkit for building modeling frameworks like Active Record and Active Resource. Rich support for attributes, callbacks, validations, observers, serialization, internationalization, and testing.'
s.required_ruby_version = '>= 1.8.7'
Expand All @@ -16,7 +15,7 @@ Gem::Specification.new do |s|

s.has_rdoc = true

s.add_dependency('activesupport', "= #{ActiveModel::VERSION::STRING}")
s.add_dependency('activesupport', version)

s.require_path = 'lib'
s.files = Dir["CHANGELOG", "MIT-LICENSE", "README", "lib/**/*"]
Expand Down
9 changes: 4 additions & 5 deletions activerecord/activerecord.gemspec
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
$:.unshift "lib"
require "active_record/version"
version = File.read("../RAILS_VERSION").strip

Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = 'activerecord'
s.version = ActiveRecord::VERSION::STRING
s.version = version
s.summary = 'Object-relational mapper framework (part of Rails).'
s.description = 'Databases on Rails. Build a persistent domain model by mapping database tables to Ruby classes. Strong conventions for associations, validations, aggregations, migrations, and testing come baked-in.'
s.required_ruby_version = '>= 1.8.7'
Expand All @@ -21,7 +20,7 @@ Gem::Specification.new do |s|
s.extra_rdoc_files = %w( README )
s.rdoc_options.concat ['--main', 'README']

s.add_dependency('activesupport', "= #{ActiveRecord::VERSION::STRING}")
s.add_dependency('activemodel', "= #{ActiveRecord::VERSION::STRING}")
s.add_dependency('activesupport', version)
s.add_dependency('activemodel', version)
s.add_dependency('arel', '~> 0.2.1')
end
9 changes: 4 additions & 5 deletions activeresource/activeresource.gemspec
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
$:.unshift "lib"
require "active_resource/version"
version = File.read("../RAILS_VERSION").strip

Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = 'activeresource'
s.version = ActiveResource::VERSION::STRING
s.version = version
s.summary = 'REST modeling framework (part of Rails).'
s.description = 'REST on Rails. Wrap your RESTful web app with Ruby classes and work with them like Active Record models.'
s.required_ruby_version = '>= 1.8.7'
Expand All @@ -21,6 +20,6 @@ Gem::Specification.new do |s|
s.extra_rdoc_files = %w( README )
s.rdoc_options.concat ['--main', 'README']

s.add_dependency('activesupport', "= #{ActiveResource::VERSION::STRING}")
s.add_dependency('activemodel', "= #{ActiveResource::VERSION::STRING}")
s.add_dependency('activesupport', version)
s.add_dependency('activemodel', version)
end
5 changes: 2 additions & 3 deletions activesupport/activesupport.gemspec
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
$:.unshift "lib"
require "active_support/version"
version = File.read("../RAILS_VERSION").strip

Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = 'activesupport'
s.version = ActiveSupport::VERSION::STRING
s.version = version
s.summary = 'A toolkit of support libraries and Ruby core extensions extracted from the Rails framework.'
s.description = 'A toolkit of support libraries and Ruby core extensions extracted from the Rails framework. Rich support for multibyte strings, internationalization, time zones, and testing.'
s.required_ruby_version = '>= 1.8.7'
Expand Down
17 changes: 8 additions & 9 deletions rails.gemspec
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
$:.unshift "railties/lib"
require "rails/version"
version = File.read("RAILS_VERSION").strip

Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = 'rails'
s.version = Rails::VERSION::STRING
s.version = version
s.summary = 'Full-stack web application framework.'
s.description = 'Ruby on Rails is a full-stack web framework optimized for programmer happiness and sustainable productivity. It encourages beautiful code by favoring convention over configuration.'
s.required_ruby_version = '>= 1.8.7'
Expand All @@ -17,11 +16,11 @@ Gem::Specification.new do |s|
s.files = []
s.require_path = []

s.add_dependency('activesupport', "= #{Rails::VERSION::STRING}")
s.add_dependency('actionpack', "= #{Rails::VERSION::STRING}")
s.add_dependency('activerecord', "= #{Rails::VERSION::STRING}")
s.add_dependency('activeresource', "= #{Rails::VERSION::STRING}")
s.add_dependency('actionmailer', "= #{Rails::VERSION::STRING}")
s.add_dependency('railties', "= #{Rails::VERSION::STRING}")
s.add_dependency('activesupport', version)
s.add_dependency('actionpack', version)
s.add_dependency('activerecord', version)
s.add_dependency('activeresource', version)
s.add_dependency('actionmailer', version)
s.add_dependency('railties', version)
s.add_dependency('bundler', '>= 0.9.8')
end
9 changes: 4 additions & 5 deletions railties/railties.gemspec
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
$:.unshift "lib"
require "rails/version"
version = File.read("../RAILS_VERSION").strip

Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = 'railties'
s.version = Rails::VERSION::STRING
s.version = version
s.summary = 'Tools for creating, working with, and running Rails applications.'
s.description = 'Rails internals: application bootup, plugins, generators, and rake tasks.'
s.required_ruby_version = '>= 1.8.7'
Expand All @@ -25,6 +24,6 @@ Gem::Specification.new do |s|

s.add_dependency('rake', '>= 0.8.3')
s.add_dependency('thor', '~> 0.13.4')
s.add_dependency('activesupport', "= #{Rails::VERSION::STRING}")
s.add_dependency('actionpack', "= #{Rails::VERSION::STRING}")
s.add_dependency('activesupport', version)
s.add_dependency('actionpack', version)
end

0 comments on commit deb00bc

Please sign in to comment.