Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
remove references to *::VERSION, replace with *.version
  • Loading branch information
haileys committed Mar 21, 2013
1 parent c07e151 commit f0e6ab5
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -141,7 +141,7 @@ task :update_versions do
require File.dirname(__FILE__) + "/version"

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

constants = {
Expand Down
4 changes: 0 additions & 4 deletions railties/lib/rails.rb
Expand Up @@ -82,10 +82,6 @@ def groups(*groups)
groups
end

def version
VERSION::STRING
end

def public_path
application && Pathname.new(application.paths["public"].first)
end
Expand Down
2 changes: 1 addition & 1 deletion railties/lib/rails/commands/application.rb
@@ -1,7 +1,7 @@
require 'rails/version'

if ['--version', '-v'].include?(ARGV.first)
puts "Rails #{Rails::VERSION::STRING}"
puts "Rails #{Rails.version}"
exit(0)
end

Expand Down
4 changes: 2 additions & 2 deletions railties/lib/rails/generators/app_base.rb
@@ -1,7 +1,7 @@
require 'digest/md5'
require 'securerandom'
require 'active_support/core_ext/string/strip'
require 'rails/version' unless defined?(Rails::VERSION)
require 'rails/version' unless defined?(Rails.version)
require 'rbconfig'
require 'open-uri'
require 'uri'
Expand Down Expand Up @@ -142,7 +142,7 @@ def rails_gemfile_entry
else
<<-GEMFILE.strip_heredoc
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '#{Rails::VERSION::STRING}'
gem 'rails', '#{Rails.version}'
GEMFILE
end
end
Expand Down
Expand Up @@ -18,7 +18,7 @@ Gem::Specification.new do |s|
s.test_files = Dir["test/**/*"]
<% end -%>

<%= '# ' if options.dev? || options.edge? -%>s.add_dependency "rails", "~> <%= Rails::VERSION::STRING %>"
<%= '# ' if options.dev? || options.edge? -%>s.add_dependency "rails", "~> <%= Rails.version %>"
<% unless options[:skip_active_record] -%>
s.add_development_dependency "<%= gem_for_database %>"
Expand Down
@@ -1,7 +1,7 @@
source "https://rubygems.org"

<% if options[:skip_gemspec] -%>
<%= '# ' if options.dev? || options.edge? -%>gem "rails", "~> <%= Rails::VERSION::STRING %>"
<%= '# ' if options.dev? || options.edge? -%>gem "rails", "~> <%= Rails.version %>"
<% else -%>
# Declare your gem's dependencies in <%= name %>.gemspec.
# Bundler will treat runtime dependencies like base dependencies, and
Expand Down
4 changes: 2 additions & 2 deletions railties/lib/rails/info.rb
Expand Up @@ -29,7 +29,7 @@ def frameworks
def framework_version(framework)
if Object.const_defined?(framework.classify)
require "#{framework}/version"
"#{framework.classify}::VERSION::STRING".constantize
framework.classify.constantize.version.to_s
end
end

Expand Down Expand Up @@ -75,7 +75,7 @@ def to_html

# The Rails version.
property 'Rails version' do
Rails::VERSION::STRING
Rails.version.to_s
end

property 'JavaScript Runtime' do
Expand Down
4 changes: 2 additions & 2 deletions railties/test/generators/plugin_new_generator_test.rb
Expand Up @@ -292,7 +292,7 @@ def test_skipping_gemspec
assert_no_file "bukkits.gemspec"
assert_file "Gemfile" do |contents|
assert_no_match('gemspec', contents)
assert_match(/gem "rails", "~> #{Rails::VERSION::STRING}"/, contents)
assert_match(/gem "rails", "~> #{Rails.version}"/, contents)
assert_match(/group :development do\n gem "sqlite3"\nend/, contents)
assert_no_match(/# gem "jquery-rails"/, contents)
end
Expand All @@ -303,7 +303,7 @@ def test_skipping_gemspec_in_full_mode
assert_no_file "bukkits.gemspec"
assert_file "Gemfile" do |contents|
assert_no_match('gemspec', contents)
assert_match(/gem "rails", "~> #{Rails::VERSION::STRING}"/, contents)
assert_match(/gem "rails", "~> #{Rails.version}"/, contents)
assert_match(/group :development do\n gem "sqlite3"\nend/, contents)
end
end
Expand Down
2 changes: 1 addition & 1 deletion railties/test/rails_info_test.rb
Expand Up @@ -38,7 +38,7 @@ def test_property_with_block
end

def test_framework_version
assert_property 'Active Support version', ActiveSupport::VERSION::STRING
assert_property 'Active Support version', ActiveSupport.version
end

def test_frameworks_exist
Expand Down

0 comments on commit f0e6ab5

Please sign in to comment.