summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2010-06-19 11:35:43 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2010-06-19 11:35:43 +0000
commitf4c32d1edd74620bb5eee79540aa65d604a7c932 (patch)
treeeb7b5395c097d57577430358fa4cc9d92f6fb6f1 /dev-ruby
parentAutomated update of use.local.desc (diff)
downloadgentoo-2-f4c32d1edd74620bb5eee79540aa65d604a7c932.tar.gz
gentoo-2-f4c32d1edd74620bb5eee79540aa65d604a7c932.tar.bz2
gentoo-2-f4c32d1edd74620bb5eee79540aa65d604a7c932.zip
Initial import of multi_json needed for the new version of oauth2. The tests are particularly patched (and not all of it is upstreamed yet) so that they pass on Ruby 1.9 and JRuby properly.
(Portage version: 2.2_rc67/cvs/Linux x86_64)
Diffstat (limited to 'dev-ruby')
-rw-r--r--dev-ruby/multi_json/ChangeLog13
-rw-r--r--dev-ruby/multi_json/files/multi_json-0.0.3-gentoo.patch84
-rw-r--r--dev-ruby/multi_json/metadata.xml5
-rw-r--r--dev-ruby/multi_json/multi_json-0.0.3.ebuild32
4 files changed, 134 insertions, 0 deletions
diff --git a/dev-ruby/multi_json/ChangeLog b/dev-ruby/multi_json/ChangeLog
new file mode 100644
index 000000000000..b3747efccfba
--- /dev/null
+++ b/dev-ruby/multi_json/ChangeLog
@@ -0,0 +1,13 @@
+# ChangeLog for dev-ruby/multi_json
+# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-ruby/multi_json/ChangeLog,v 1.1 2010/06/19 11:35:43 flameeyes Exp $
+
+*multi_json-0.0.3 (19 Jun 2010)
+
+ 19 Jun 2010; Diego E. Pettenò <flameeyes@gentoo.org>
+ +multi_json-0.0.3.ebuild, +files/multi_json-0.0.3-gentoo.patch,
+ +metadata.xml:
+ Initial import of multi_json needed for the new version of oauth2. The
+ tests are particularly patched (and not all of it is upstreamed yet) so
+ that they pass on Ruby 1.9 and JRuby properly.
+
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
new file mode 100644
index 000000000000..f143b6afcc36
--- /dev/null
+++ b/dev-ruby/multi_json/files/multi_json-0.0.3-gentoo.patch
@@ -0,0 +1,84 @@
+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/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/metadata.xml b/dev-ruby/multi_json/metadata.xml
new file mode 100644
index 000000000000..852136183369
--- /dev/null
+++ b/dev-ruby/multi_json/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>ruby</herd>
+</pkgmetadata>
diff --git a/dev-ruby/multi_json/multi_json-0.0.3.ebuild b/dev-ruby/multi_json/multi_json-0.0.3.ebuild
new file mode 100644
index 000000000000..18c4e81fd28f
--- /dev/null
+++ b/dev-ruby/multi_json/multi_json-0.0.3.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-ruby/multi_json/multi_json-0.0.3.ebuild,v 1.1 2010/06/19 11:35:43 flameeyes 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.rdoc"
+
+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 dev-ruby/yajl-ruby dev-ruby/activesupport )"
+
+# 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.
+ruby_add_bdepend "test? ( dev-ruby/rspec dev-ruby/json )"
+
+RUBY_PATCHES=( "${FILESDIR}"/${P}-gentoo.patch )