diff options
author | 2010-06-19 17:33:02 +0000 | |
---|---|---|
committer | 2010-06-19 17:33:02 +0000 | |
commit | 689e3125d3d19ea5be042399561da3b929958706 (patch) | |
tree | de6366e11a40df92701a14f5ff8b6bbbdbfef322 /dev-ruby/multi_json/files | |
parent | alpha/arm/ia64/s390/sh/sparc stable wrt #320931 (diff) | |
download | gentoo-2-689e3125d3d19ea5be042399561da3b929958706.tar.gz gentoo-2-689e3125d3d19ea5be042399561da3b929958706.tar.bz2 gentoo-2-689e3125d3d19ea5be042399561da3b929958706.zip |
Version bump, reduce patching to our tests' hacks.
(Portage version: 2.2_rc67/cvs/Linux x86_64)
Diffstat (limited to 'dev-ruby/multi_json/files')
-rw-r--r-- | dev-ruby/multi_json/files/multi_json-0.0.3-gentoo.patch | 116 | ||||
-rw-r--r-- | dev-ruby/multi_json/files/multi_json-0.0.4-gentoo.patch | 24 |
2 files changed, 24 insertions, 116 deletions
diff --git a/dev-ruby/multi_json/files/multi_json-0.0.3-gentoo.patch b/dev-ruby/multi_json/files/multi_json-0.0.3-gentoo.patch deleted file mode 100644 index 14b7a5cf66b3..000000000000 --- a/dev-ruby/multi_json/files/multi_json-0.0.3-gentoo.patch +++ /dev/null @@ -1,116 +0,0 @@ -diff --git a/Rakefile b/Rakefile -index fbf6a4a..3669b7b 100644 ---- a/Rakefile -+++ b/Rakefile -@@ -14,10 +14,13 @@ begin - # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings - end - Jeweler::GemcutterTasks.new -+ -+ task :spec => :check_dependencies - rescue LoadError - puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler" - end - -+begin - require 'spec/rake/spectask' - Spec::Rake::SpecTask.new(:spec) do |spec| - spec.libs << 'lib' << 'spec' -@@ -30,9 +33,10 @@ Spec::Rake::SpecTask.new(:rcov) do |spec| - spec.rcov = true - end - --task :spec => :check_dependencies -- - task :default => :spec -+rescue LoadError -+ puts "RSpec (or a dependency) not available. Install it with: gem install rspec" -+end - - require 'rake/rdoctask' - Rake::RDocTask.new do |rdoc| -diff --git a/lib/multi_json.rb b/lib/multi_json.rb -index a1e7bb7..20c074a 100644 ---- a/lib/multi_json.rb -+++ b/lib/multi_json.rb -@@ -8,6 +8,13 @@ module MultiJson - @engine - end - -+ DefaultByRequire = { -+ "yajl" => :yajl, -+ "json" => :json_gem, -+ "active_support" => :active_support, -+ "json/pure" => :json_pure -+ } -+ - # The default engine based on what you currently - # have loaded and installed. First checks to see - # if any engines are already loaded, then checks -@@ -17,10 +24,10 @@ module MultiJson - return :json_gem if defined?(::JSON) - return :active_support if defined?(::ActiveSupport::JSON) - -- %w(yajl json active_support json/pure).each do |req| -+ DefaultByRequire.each_pair do |library, engine| - begin -- require req -- return req.sub('/','_').to_sym -+ require library -+ return engine - rescue LoadError - next - end -diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb -index a198d34..c0338a1 100644 ---- a/spec/spec_helper.rb -+++ b/spec/spec_helper.rb -@@ -4,8 +4,12 @@ require 'multi_json' - require 'spec' - require 'spec/autorun' - require 'rubygems' -+begin - require 'bundler' - Bundler.setup -+rescue LoadError -+ $stderr.puts "Bundler (or a dependency) not available." -+end - - Spec::Runner.configure do |config| - -diff --git a/spec/x_to_json_spec.rb b/spec/x_to_json_spec.rb -index 69bffc8..9d2a376 100644 ---- a/spec/x_to_json_spec.rb -+++ b/spec/x_to_json_spec.rb -@@ -13,13 +13,17 @@ end - describe "MultiJson" do - context 'engines' do - it 'should default to the best available gem' do -+ begin - require 'yajl' - MultiJson.engine.name.should == 'MultiJson::Engines::Yajl' -+ rescue LoadError -+ pending "YAJL (or a dependency) not available." -+ end - end - - it 'should be settable via a symbol' do -- MultiJson.engine = :yajl -- MultiJson.engine.name.should == 'MultiJson::Engines::Yajl' -+ MultiJson.engine = :json_pure -+ MultiJson.engine.name.should == 'MultiJson::Engines::JsonPure' - end - - it 'should be settable via a class' do -@@ -31,7 +35,11 @@ describe "MultiJson" do - %w(active_support json_gem json_pure yajl).each do |engine| - context engine do - before do -+ begin - MultiJson.engine = engine -+ rescue LoadError -+ pending "Engine #{engine} couldn't be loaded (not installed?)" -+ end - end - - describe '.encode' do diff --git a/dev-ruby/multi_json/files/multi_json-0.0.4-gentoo.patch b/dev-ruby/multi_json/files/multi_json-0.0.4-gentoo.patch new file mode 100644 index 000000000000..8736809a97f9 --- /dev/null +++ b/dev-ruby/multi_json/files/multi_json-0.0.4-gentoo.patch @@ -0,0 +1,24 @@ +diff --git a/spec/multi_json_spec.rb b/spec/multi_json_spec.rb +index 2df3350..9d2a376 100644 +--- a/spec/multi_json_spec.rb ++++ b/spec/multi_json_spec.rb +@@ -13,13 +13,17 @@ end + describe "MultiJson" do + context 'engines' do + it 'should default to the best available gem' do ++ begin + require 'yajl' + MultiJson.engine.name.should == 'MultiJson::Engines::Yajl' ++ rescue LoadError ++ pending "YAJL (or a dependency) not available." ++ end + end + + it 'should be settable via a symbol' do +- MultiJson.engine = :yajl +- MultiJson.engine.name.should == 'MultiJson::Engines::Yajl' ++ MultiJson.engine = :json_pure ++ MultiJson.engine.name.should == 'MultiJson::Engines::JsonPure' + end + + it 'should be settable via a class' do |