Permalink
Browse files

Removed the gem dev dependencies from the gemspec to the gemfile as s…

…ome dependencies required specific ruby engines. Also changed a RUBY_VERSION reference to RUBY_ENGINE which was left over from the previous commit
  • Loading branch information...
1 parent 485b9b7 commit a43c43370e82f7e12d0c08a4aab164833712a05a @joshk joshk committed Apr 18, 2011
Showing with 10 additions and 15 deletions.
  1. +5 −1 Gemfile
  2. +0 −13 multi_json.gemspec
  3. +1 −1 spec/multi_json_spec.rb
  4. +4 −0 spec/spec_helper.rb
View
@@ -2,6 +2,10 @@ source "http://rubygems.org"
gemspec
+gem 'rake', '~> 0.8'
+gem 'rspec', '~> 2.5'
+gem 'rcov', '~> 0.9', :platforms => [:mri, :jruby]
+
gem 'json', '~> 1.4', :require => nil
gem 'json_pure', '~> 1.4', :require => nil
-gem 'yajl-ruby', '~> 0.7', :require => nil, :platforms => :ruby
+gem 'yajl-ruby', '~> 0.7', :require => nil, :platforms => :ruby
View
@@ -21,18 +21,5 @@ Gem::Specification.new do |s|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.require_paths = ["lib"]
-
- s.add_development_dependency("rake", "~> 0.8")
- s.add_development_dependency("rspec", "~> 2.0")
- s.add_development_dependency("json", "~> 1.4")
- s.add_development_dependency("json_pure", "~> 1.4")
-
- unless RUBY_ENGINE == "rbx"
- s.add_development_dependency("rcov", "~> 0.9")
- end
-
- unless RUBY_ENGINE == "jruby"
- s.add_development_dependency("yajl-ruby", "~> 0.7")
- end
end
View
@@ -14,7 +14,7 @@ def self.encode(string)
context 'engines' do
it 'should default to the best available gem' do
# the yajl-ruby gem does not work on jruby, so the best engine is the JsonGem engine
- if ENV['RUBY_VERSION'].match(/^jruby-/)
+ if jruby?
require 'json'
MultiJson.engine.name.should == 'MultiJson::Engines::JsonGem'
else
View
@@ -9,3 +9,7 @@
$VERBOSE = true
require 'multi_json'
+
+def jruby?
+ defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby"
+end

0 comments on commit a43c433

Please sign in to comment.