[rubygem-railties] Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0

Vít Ondruch vondruch at fedoraproject.org
Sat Mar 9 20:12:34 UTC 2013


commit e8d0791489272d3acd07819214705862972c3593
Author: Vít Ondruch <vondruch at redhat.com>
Date:   Fri Mar 8 19:59:10 2013 +0100

    Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0

 ...ies-3.2.13-Define-inspect-instead-of-to_s.patch |   35 +++++++++++++
 ...gem-railties-3.2.13-name-should-be-public.patch |   54 ++++++++++++++++++++
 rubygem-railties.spec                              |   30 ++++++++---
 3 files changed, 111 insertions(+), 8 deletions(-)
---
diff --git a/rubygem-railties-3.2.13-Define-inspect-instead-of-to_s.patch b/rubygem-railties-3.2.13-Define-inspect-instead-of-to_s.patch
new file mode 100644
index 0000000..b41c794
--- /dev/null
+++ b/rubygem-railties-3.2.13-Define-inspect-instead-of-to_s.patch
@@ -0,0 +1,35 @@
+From 45e9cac12ca99a51ef10e5ee423a6712818ae145 Mon Sep 17 00:00:00 2001
+From: Prem Sichanugrist <s at sikac.hu>
+Date: Thu, 21 Feb 2013 21:24:02 -0500
+Subject: [PATCH] Define #inspect instead of #to_s
+
+Ruby 2.0 Object#inspect does not call #to_s by default anymore.
+---
+ railties/test/application/route_inspect_test.rb |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/railties/test/application/route_inspect_test.rb b/railties/test/application/route_inspect_test.rb
+index 5c920cb..dea0ee7 100644
+--- a/railties/test/application/route_inspect_test.rb
++++ b/railties/test/application/route_inspect_test.rb
+@@ -18,7 +18,7 @@ def setup
+ 
+     def test_displaying_routes_for_engines
+       engine = Class.new(Rails::Engine) do
+-        def self.to_s
++        def self.inspect
+           "Blog::Engine"
+         end
+       end
+@@ -136,7 +136,7 @@ def test_rake_routes_shows_route_with_rack_app
+ 
+     def test_rake_routes_shows_route_with_rack_app_nested_with_dynamic_constraints
+       constraint = Class.new do
+-        def to_s
++        def inspect
+           "( my custom constraint )"
+         end
+       end
+-- 
+1.7.10
+
diff --git a/rubygem-railties-3.2.13-name-should-be-public.patch b/rubygem-railties-3.2.13-name-should-be-public.patch
new file mode 100644
index 0000000..a84d9a1
--- /dev/null
+++ b/rubygem-railties-3.2.13-name-should-be-public.patch
@@ -0,0 +1,54 @@
+From 9a0cdc68b5b0fc08e60069cb5512bf2ad6b2a76b Mon Sep 17 00:00:00 2001
+From: Aaron Patterson <aaron.patterson at gmail.com>
+Date: Thu, 24 May 2012 14:55:38 -0700
+Subject: [PATCH] `name` should be public.
+
+---
+ .../rails/plugin_new/plugin_new_generator.rb       |   24 ++++++++++----------
+ 1 file changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb b/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb
+index 6c53d8b..1b7f5de 100644
+--- a/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb
++++ b/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb
+@@ -214,6 +214,18 @@ def finish_template
+ 
+       public_task :apply_rails_template, :run_bundle
+ 
++      def name
++        @name ||= begin
++          # same as ActiveSupport::Inflector#underscore except not replacing '-'
++          underscored = original_name.dup
++          underscored.gsub!(/([A-Z]+)([A-Z][a-z])/,'\1_\2')
++          underscored.gsub!(/([a-z\d])([A-Z])/,'\1_\2')
++          underscored.downcase!
++
++          underscored
++        end
++      end
++
+     protected
+ 
+       def app_templates_dir
+@@ -254,18 +266,6 @@ def original_name
+         @original_name ||= File.basename(destination_root)
+       end
+ 
+-      def name
+-        @name ||= begin
+-          # same as ActiveSupport::Inflector#underscore except not replacing '-'
+-          underscored = original_name.dup
+-          underscored.gsub!(/([A-Z]+)([A-Z][a-z])/,'\1_\2')
+-          underscored.gsub!(/([a-z\d])([A-Z])/,'\1_\2')
+-          underscored.downcase!
+-
+-          underscored
+-        end
+-      end
+-
+       def camelized
+         @camelized ||= name.gsub(/\W/, '_').squeeze('_').camelize
+       end
+-- 
+1.7.10
+
diff --git a/rubygem-railties.spec b/rubygem-railties.spec
index ee33e31..b7d3f67 100644
--- a/rubygem-railties.spec
+++ b/rubygem-railties.spec
@@ -3,14 +3,13 @@
 
 %global download_path http://rubygems.org/downloads/
 
-%global rubyabi 1.9.1
 
 %global runtests 1
 
 Summary: Tools for creating, working with, and running Rails applications
 Name: rubygem-%{gem_name}
 Version: 3.2.12
-Release: 1%{?dist}
+Release: 2%{?dist}
 Group: Development/Languages
 License: MIT
 URL: http://www.rubyonrails.org
@@ -23,7 +22,15 @@ Source1: http://github.com/rails/rails/raw/master/railties/MIT-LICENSE
 # git checkout v3.2.12 && tar czvf railties-3.2.12-tests.tgz test/
 Source2: railties-%{version}-tests.tgz
 # Let's keep Requires and BuildRequires sorted alphabeticaly
-Requires: ruby(abi) = %{rubyabi}
+
+# Fixes "name should be public, not private" error.
+# https://github.com/rails/rails/commit/9a0cdc68b5b0fc08e60069cb5512bf2ad6b2a76b
+Patch100: rubygem-railties-3.2.13-name-should-be-public.patch
+# Fixes test_displaying_routes_for_engines(ApplicationTests::RouteInspectTest).
+# https://github.com/rails/rails/commit/45e9cac12ca99a51ef10e5ee423a6712818ae145
+Patch101: rubygem-railties-3.2.13-Define-inspect-instead-of-to_s.patch
+
+Requires: ruby(release)
 Requires: ruby(rubygems)
 Requires: rubygem(actionpack) = %{version}
 Requires: rubygem(activesupport) = %{version}
@@ -35,7 +42,7 @@ Requires: rubygem(rdoc) < 4
 Requires: rubygem(thor) >= 0.14.6
 Requires: rubygem(thor) < 2.0
 BuildRequires: rubygems-devel
-BuildRequires: ruby(abi) = %{rubyabi}
+BuildRequires: ruby(release)
 %if 0%{?runtests}
 BuildRequires: rubygem(actionpack) = %{version}
 BuildRequires: rubygem(activerecord) = %{version}
@@ -71,11 +78,12 @@ This package contains documentation for %{name}.
 
 %prep
 %setup -q -c -T
-mkdir -p .%{gem_dir}
 mkdir -p .%{_bindir}
-gem install --local --install-dir .%{gem_dir} \
-            --force -V --rdoc %{SOURCE0} \
-            --bindir .%{_bindir}
+%gem_install -n %{SOURCE0}
+
+pushd .%{gem_instdir}
+%patch100 -p2
+popd
 
 # May by only for v.3.0.3-6
 #  
@@ -105,6 +113,9 @@ export PATH="${PWD}%{gem_dir}/gems/railties/bin:$PATH"
 pushd .%{gem_dir}/gems/railties
 # extract tests
 tar xzf %{SOURCE2}
+
+cat %{PATCH101} | patch -p2
+
 # TODO: Test are not yet in the best state.
 ruby -e 'Dir.glob("test/**/*_test.rb").each {|t| require t}' \
   | grep "818 tests, 2034 assertions, 72 failures, 298 errors, 0 skips"
@@ -128,6 +139,9 @@ popd
 %doc %{gem_instdir}/README.rdoc
 
 %changelog
+* Fri Mar 08 2013 Vít Ondruch <vondruch at redhat.com> - 3.2.12-2
+- Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0
+
 * Tue Feb 12 2013 Vít Ondruch <vondruch at redhat.com> - 3.2.12-1
 - Update to Railties 3.2.12.
 


More information about the scm-commits mailing list