summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Graaff <graaff@gentoo.org>2011-07-19 04:43:26 +0000
committerHans de Graaff <graaff@gentoo.org>2011-07-19 04:43:26 +0000
commit1a20bef94ea6102b35c89e58ed1eaa40e9bcf358 (patch)
treefb679ba70e3b960fa244dd0f35d6024be91b7cb9 /dev-ruby/multi_json
parentVersion bump. (diff)
downloadgentoo-2-1a20bef94ea6102b35c89e58ed1eaa40e9bcf358.tar.gz
gentoo-2-1a20bef94ea6102b35c89e58ed1eaa40e9bcf358.tar.bz2
gentoo-2-1a20bef94ea6102b35c89e58ed1eaa40e9bcf358.zip
Version bump.
(Portage version: 2.1.10.3/cvs/Linux x86_64)
Diffstat (limited to 'dev-ruby/multi_json')
-rw-r--r--dev-ruby/multi_json/ChangeLog8
-rw-r--r--dev-ruby/multi_json/files/multi_json-1.0.3-gentoo.patch75
-rw-r--r--dev-ruby/multi_json/multi_json-1.0.3.ebuild48
3 files changed, 130 insertions, 1 deletions
diff --git a/dev-ruby/multi_json/ChangeLog b/dev-ruby/multi_json/ChangeLog
index 3d808bde923b..cdb99512c68b 100644
--- a/dev-ruby/multi_json/ChangeLog
+++ b/dev-ruby/multi_json/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for dev-ruby/multi_json
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-ruby/multi_json/ChangeLog,v 1.5 2011/05/24 09:09:20 graaff Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-ruby/multi_json/ChangeLog,v 1.6 2011/07/19 04:43:26 graaff Exp $
+
+*multi_json-1.0.3 (19 Jul 2011)
+
+ 19 Jul 2011; Hans de Graaff <graaff@gentoo.org> +multi_json-1.0.3.ebuild,
+ +files/multi_json-1.0.3-gentoo.patch:
+ Version bump.
*multi_json-1.0.2 (24 May 2011)
diff --git a/dev-ruby/multi_json/files/multi_json-1.0.3-gentoo.patch b/dev-ruby/multi_json/files/multi_json-1.0.3-gentoo.patch
new file mode 100644
index 000000000000..2e031e0c01a4
--- /dev/null
+++ b/dev-ruby/multi_json/files/multi_json-1.0.3-gentoo.patch
@@ -0,0 +1,75 @@
+A small part of
+
+commit d83002691a34a32b6d6d181817af7f8e68524638
+Author: Erik Michaels-Ober <sferik@gmail.com>
+Date: Sat May 14 09:26:31 2011 -0700
+
+ Cleanup
+
+diff --git a/spec/multi_json_spec.rb b/spec/multi_json_spec.rb
+index 9be78f4..55238c9 100644
+--- b/spec/multi_json_spec.rb
++++ a/spec/multi_json_spec.rb
+@@ -1,9 +1,9 @@
+-require 'helper'
++require 'spec_helper'
+ require 'stringio'
+-
++
+ class MockDecoder
+ def self.decode(string, options = {})
+- {'abc' => 'def'}
++ { 'abc' => 'def' }
+ end
+
+ def self.encode(string)
+@@ -26,10 +26,16 @@
+ end
+ end
+ end
+-
++
+ it 'defaults to the best available gem' do
+- require 'yajl'
+- MultiJson.engine.name.should == 'MultiJson::Engines::Yajl'
++ # the yajl-ruby gem does not work on jruby, so the best engine is the JsonGem engine
++ if jruby?
++ require 'json'
++ MultiJson.engine.name.should == 'MultiJson::Engines::JsonGem'
++ else
++ require 'yajl'
++ MultiJson.engine.name.should == 'MultiJson::Engines::Yajl'
++ end
+ end
+
+ it 'is settable via a symbol' do
+@@ -89,7 +95,7 @@
+ encoded_json = MultiJson.encode(:a => 1, :b => {:c => 2})
+ MultiJson.decode(encoded_json).should == { "a" => 1, "b" => { "c" => 2 } }
+ end
+-
++
+ it "properly decodes valid JSON in StringIOs" do
+ json = StringIO.new('{"abc":"def"}')
+ MultiJson.decode(json).should == { 'abc' => 'def' }
+diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
+deleted file mode 100644
+index a9b66e6..0000000
+--- /dev/null
++++ a/spec/spec_helper.rb
+@@ -0,0 +1,15 @@
++begin
++ require 'bundler'
++rescue LoadError
++ puts "although not required, it's recommended that you use bundler during development"
++end
++
++require 'rspec'
++require 'rspec/autorun'
++
++$VERBOSE = true
++require 'multi_json'
++
++def jruby?
++ defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby"
++end
diff --git a/dev-ruby/multi_json/multi_json-1.0.3.ebuild b/dev-ruby/multi_json/multi_json-1.0.3.ebuild
new file mode 100644
index 000000000000..9772aa8d861f
--- /dev/null
+++ b/dev-ruby/multi_json/multi_json-1.0.3.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-ruby/multi_json/multi_json-1.0.3.ebuild,v 1.1 2011/07/19 04:43:26 graaff Exp $
+
+EAPI=2
+
+USE_RUBY="ruby18 ruby19 ree18 jruby"
+
+RUBY_FAKEGEM_TASK_TEST="spec"
+RUBY_FAKEGEM_TASK_DOC="rdoc"
+
+RUBY_FAKEGEM_DOCDIR="rdoc"
+RUBY_FAKEGEM_EXTRADOC="README.md"
+
+RUBY_FAKEGEM_GEMSPEC="multi_json.gemspec"
+
+inherit ruby-fakegem
+
+DESCRIPTION="A gem to provide swappable JSON backends"
+HOMEPAGE="http://github.com/intridea/multi_json"
+LICENSE="MIT"
+
+KEYWORDS="~amd64 ~x86"
+SLOT="0"
+IUSE=""
+
+ruby_add_rdepend "|| ( >=dev-ruby/json-1.4 >=dev-ruby/yajl-ruby-0.7 =dev-ruby/activesupport-3* )"
+
+# I've switched one of the tests from requiring yajl to requiring
+# json-pure since it's the only implementation that is available for all
+# the Ruby interpreters we support. This is fixed upstream in 1.0.2 but
+# got broken again in 1.0.3:
+# https://github.com/intridea/multi_json/issues/18
+RUBY_PATCHES=( "${FILESDIR}/${P}-gentoo.patch" )
+
+ruby_add_bdepend "test? ( dev-ruby/rspec:2 dev-ruby/json )"
+
+all_ruby_prepare() {
+ sed -i -e '/[Bb]undler/d' Rakefile spec/helper.rb || die "Unable to remove bundler."
+ rm Gemfile || die "Unable to remove bundler Gemfile."
+
+ # Remove simplecov support since we only care about the test results
+ # and this avoids another dependency.
+ sed -i -e '/[Ss]imple[Cc]ov/d' spec/helper.rb || die
+
+ # Provide version otherwise provided by bundler.
+ sed -i -e "s/#{MultiJson::VERSION}/${PV}/" Rakefile || die
+}