[rubygem-locale_rails/f13/master] updated to include upstream patch/fix
Mohammed Morsi
mmorsi at fedoraproject.org
Wed Aug 25 10:12:08 UTC 2010
commit ed18d4a0c519baa3586eaa518ace6cd7f534cd5d
Author: Mohammed Morsi <mmorsi at redhat.com>
Date: Tue Aug 24 16:03:18 2010 -0400
updated to include upstream patch/fix
locale_rails-2.0.4-global-locale-fix.patch | 57 +++++++++++++
rubygem-locale_rails.spec | 127 +++++++++++++++-------------
sources | 2 +-
3 files changed, 128 insertions(+), 58 deletions(-)
---
diff --git a/locale_rails-2.0.4-global-locale-fix.patch b/locale_rails-2.0.4-global-locale-fix.patch
new file mode 100644
index 0000000..7befc52
--- /dev/null
+++ b/locale_rails-2.0.4-global-locale-fix.patch
@@ -0,0 +1,57 @@
+--- locale_rails/lib/locale_rails/i18n.rb.orig 2010-08-16 22:07:12.127441887 -0400
++++ locale_rails/lib/locale_rails/i18n.rb 2010-08-16 22:07:18.903418202 -0400
+@@ -13,35 +13,35 @@ module I18n
+
+ # Gets the supported locales.
+ def supported_locales
+- Locale.app_language_tags
++ ::Locale.app_language_tags
+ end
+
+ # Sets the supported locales.
+ # I18n.set_supported_locales("ja-JP", "ko-KR", ...)
+ def set_supported_locales(*tags)
+- Locale.set_app_language_tags(*tags)
++ ::Locale.set_app_language_tags(*tags)
+ end
+
+ # Sets the supported locales as an Array.
+ # I18n.supported_locales = ["ja-JP", "ko-KR", ...]
+ def supported_locales=(tags)
+- Locale.set_app_language_tags(*tags)
++ ::Locale.set_app_language_tags(*tags)
+ end
+
+ # Sets the locale.
+ # I18n.locale = "ja-JP"
+ def locale=(tag)
+- Locale.clear
+- tag = Locale::Tag::Rfc.parse(tag.to_s) if tag.kind_of? Symbol
+- Locale.current = tag
+- Thread.current[:locale] = Locale.candidates(:type => :rfc)[0]
++ ::Locale.clear
++ tag = ::Locale::Tag::Rfc.parse(tag.to_s) if tag.kind_of? Symbol
++ ::Locale.current = tag
++ Thread.current[:locale] = ::Locale.candidates(:type => :rfc)[0]
+ end
+
+ # Sets the default locale.
+ # I18n.default_locale = "ja"
+ def default_locale=(tag)
+- tag = Locale::Tag::Rfc.parse(tag.to_s) if tag.kind_of? Symbol
+- Locale.default = tag
++ tag = ::Locale::Tag::Rfc.parse(tag.to_s) if tag.kind_of? Symbol
++ ::Locale.default = tag
+ @@default_locale = tag
+ end
+
+@@ -50,7 +50,7 @@ module I18n
+ # MissingTranslationData is overrided to fallback messages in candidate locales.
+ def locale_rails_exception_handler(exception, locale, key, options) #:nodoc:
+ ret = nil
+- Locale.candidates(:type => :rfc).each do |loc|
++ ::Locale.candidates(:type => :rfc).each do |loc|
+ begin
+ ret = backend.translate(loc, key, options)
+ break
+
diff --git a/rubygem-locale_rails.spec b/rubygem-locale_rails.spec
index fb43456..9784253 100644
--- a/rubygem-locale_rails.spec
+++ b/rubygem-locale_rails.spec
@@ -1,45 +1,42 @@
-%global ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")
-
-%global gemname locale_rails
-%global gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
-%global geminstdir %{gemdir}/gems/%{gemname}-%{version}
-
-%global rubyabi 1.8
-%global locale_req 2.0.4
-%global rails_req 2.3.2
-
-%global do_check 0
-%if 0%{?fedora} >= 11
-%global do_check 1
-%endif
-%global repoid 67110
-
-Summary: Ruby-Locale for Ruby on Rails
-Name: rubygem-%{gemname}
-Version: 2.0.5
-Release: 1%{?dist}.1
-Group: Development/Languages
-License: GPLv2 or Ruby
-URL: http://www.yotabanana.com/hiki/ruby-locale-rails.html
-#Source0: http://gems.rubyforge.org/gems/%{gemname}-%{version}.gem
-Source0: http://rubyforge.org/frs/download.php/%{repoid}/%{gemname}-%{version}.gem
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-
-BuildRequires: ruby(abi) = %{rubyabi}
-BuildRequires: ruby(rubygems)
-%if %{do_check}
-BuildRequires(check): ruby(sqlite3)
-BuildRequires(check): rubygem(rake)
-BuildRequires(check): rubygem(locale) >= %{locale_req}
-BuildRequires(check): rubygem(rails) >= %{rails_req}
-%endif
-Requires: ruby(abi) = %{rubyabi}
-Requires: ruby(rubygems)
-Requires: rubygem(locale) >= %{locale_req}
+%global ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")
+
+%global gemname locale_rails
+%global gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
+%global geminstdir %{gemdir}/gems/%{gemname}-%{version}
+
+%global rubyabi 1.8
+%global locale_req 2.0.4
+%global rails_req 2.3.2
+
+%global repoid 67110
+
+Summary: Ruby-Locale for Ruby on Rails
+Name: rubygem-%{gemname}
+Version: 2.0.5
+Release: 5%{?dist}
+Group: Development/Languages
+License: GPLv2 or Ruby
+URL: http://rubyforge.org/projects/locale/
+#Source0: http://gems.rubyforge.org/gems/%{gemname}-%{version}.gem
+Source0: http://rubygems.org/downloads/%{gemname}-%{version}.gem
+
+# http://github.com/mutoh/locale_rails/commit/2bad60660127683c259fed711092e6b419f97e42
+Patch0: locale_rails-2.0.4-global-locale-fix.patch
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+BuildRequires: ruby(abi) = %{rubyabi}
+BuildRequires: ruby(rubygems)
+BuildRequires(check): ruby(sqlite3)
+BuildRequires(check): rubygem(rake)
+BuildRequires(check): rubygem(locale) >= %{locale_req}
+BuildRequires(check): rubygem(rails) >= %{rails_req}
+Requires: ruby(abi) = %{rubyabi}
+Requires: ruby(rubygems)
+Requires: rubygem(locale) >= %{locale_req}
# Not Requires but Conflicts"
-Conflicts: rubygem(rails) < %{rails_req}
-BuildArch: noarch
-Provides: rubygem(%{gemname}) = %{version}-%{release}
+Conflicts: rubygem(rails) < %{rails_req}
+BuildArch: noarch
+Provides: rubygem(%{gemname}) = %{version}-%{release}
%description
This library provides some Rails localized functions.
@@ -47,28 +44,33 @@ This library provides some Rails localized functions.
This is useful with Rails i18n backends which doesn't have
auto-detection and some other features includes this library.
-%package doc
-Summary: Documentation for %{name}
-Group: Documentation
+%package doc
+Summary: Documentation for %{name}
+Group: Documentation
# .js files are under MIT
-License: (GPLv2 or Ruby) and MIT
-Requires: %{name} = %{version}-%{release}
+License: (GPLv2 or Ruby) and MIT
+Requires: %{name} = %{version}-%{release}
-%description doc
+%description doc
This package contains documentation for %{name}.
%prep
%setup -q -c -T
+mkdir -p ./%{gemdir}
+gem install --local --install-dir ./%{gemdir} \
+ --force -V --rdoc %{SOURCE0}
+
+pushd ./%{geminstdir}
+%patch0 -p1
+for f in `find sample/ test/ -type f -print` ; do
+ chmod 644 -R $f
+ sed -i 's/#!\/usr\/bin\/env\s*ruby//' $f
+ sed -i 's/#!\/usr\/bin\/ruby//' $f
+done
+popd
+
%build
-mkdir -p .%{gemdir}
-gem install \
- --local \
- --install-dir $(pwd)%{gemdir} \
- --force \
- --rdoc \
- -V \
- %{SOURCE0}
%install
rm -rf %{buildroot}
@@ -81,7 +83,6 @@ cp -a .%{gemdir}/* %{buildroot}%{gemdir}/
rm -rf %{buildroot}
%check
-[ %{do_check} = 0 ] && exit 0
cd .%{geminstdir}
export RUBYLIB=$(pwd)/lib/
rake test
@@ -103,7 +104,19 @@ rake test
%{geminstdir}/test/
%changelog
-* Tue Jan 12 2010 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp>
+* Wed Aug 17 2010 Mohammed Morsi <mmorsi at redhat.com> - 2.0.5-5
+- additional small regression fixes
+- removed now unneccesary do_check bits
+
+* Wed Aug 17 2010 Mohammed Morsi <mmorsi at redhat.com> - 2.0.5-4
+- small specfile regression fixes
+- replaced tabs with spaces
+- removed extraneous permissions / shebang in doc files
+
+* Wed Aug 16 2010 Mohammed Morsi <mmorsi at redhat.com> - 2.0.5-3
+- included global ::Locale fix from upstream
+
+* Tue Jan 12 2010 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 2.0.5-2
- gems.rubyforge.org gem file seems old, changing Source0 URL for now
* Wed Nov 18 2009 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 2.0.5-1
diff --git a/sources b/sources
index e82fefd..46ed28d 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-62f99880fee08b5b0c8daeba3bbba2cb locale_rails-2.0.5.gem
+e6b16d6eba78d2291ef8a4179a1f39df locale_rails-2.0.5.gem
More information about the scm-commits
mailing list