Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Read Rails version from a file instead of modifying the load path and…

… doing requires

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information...
commit deb00bcb8cf88eb6420282c9af0af64fb69aeed4 1 parent 46bf2f0
@brynary brynary authored jeremy committed
View
1  RAILS_VERSION
@@ -0,0 +1 @@
+3.0.0.beta1
View
15 Rakefile
@@ -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)
@@ -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",
View
7 actionmailer/actionmailer.gemspec
@@ -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'
@@ -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
View
9 actionpack/actionpack.gemspec
@@ -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'
@@ -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')
View
7 activemodel/activemodel.gemspec
@@ -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'
@@ -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/**/*"]
View
9 activerecord/activerecord.gemspec
@@ -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'
@@ -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
View
9 activeresource/activeresource.gemspec
@@ -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'
@@ -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
View
5 activesupport/activesupport.gemspec
@@ -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'
View
17 rails.gemspec
@@ -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'
@@ -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
View
9 railties/railties.gemspec
@@ -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'
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.