Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Remove stdlib warning since it's doing more harm than good #122

Merged
merged 1 commit into from

2 participants

Pavel Pravosud Erik Michaels-Ober
Pavel Pravosud
Collaborator
rwz commented

Discuss?

Pavel Pravosud
Collaborator
rwz commented

We got a lot of complaining about MultiJson suddenly became noisy from people who sometimes didn't even realized they were using it.

So, education is important, but this seems to do more harm than good.

Erik Michaels-Ober sferik merged commit 601466a into from
Erik Michaels-Ober sferik referenced this pull request in cucumber/cucumber
Closed

Remove JSON Dependencies from Cucumber #451

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
10 lib/multi_json/adapters/json_common.rb
View
@@ -5,16 +5,6 @@ module Adapters
class JsonCommon < Adapter
defaults :load, :create_additions => false, :quirks_mode => true
- GEM_VERSION = '1.7.7'
-
- def activate
- if JSON::VERSION < GEM_VERSION
- Kernel.warn "You are using an old or stdlib version of #{gem_name} gem\n" +
- "Please upgrade to the recent version by adding this to your Gemfile:\n\n" +
- " gem '#{gem_name}', '~> #{GEM_VERSION}'\n"
- end
- end
-
def load(string, options={})
string = string.read if string.respond_to?(:read)
4 lib/multi_json/adapters/json_gem.rb
View
@@ -6,10 +6,6 @@ module Adapters
# Use the JSON gem to dump/load.
class JsonGem < JsonCommon
ParseError = ::JSON::ParserError
-
- def gem_name
- 'json'
- end
end
end
end
4 lib/multi_json/adapters/json_pure.rb
View
@@ -6,10 +6,6 @@ module Adapters
# Use JSON pure to dump/load.
class JsonPure < JsonCommon
ParseError = ::JSON::ParserError
-
- def gem_name
- 'json_pure'
- end
end
end
end
19 spec/multi_json_spec.rb
View
@@ -62,25 +62,6 @@
end
end
- context 'with stdlib version' do
- around do |example|
- version = JSON::VERSION
- silence_warnings{ JSON::VERSION = '1.5.5' }
- example.call
- silence_warnings{ JSON::VERSION = version }
- end
-
- it 'should warn about json' do
- Kernel.should_receive(:warn).with(/'json', '~> 1.7.7'/)
- MultiJson.use :json_gem
- end
-
- it 'should warn about json/pure' do
- Kernel.should_receive(:warn).with(/'json_pure', '~> 1.7.7'/)
- MultiJson.use :json_pure
- end
- end
-
it 'defaults to the best available gem' do
# Clear cache variable already set by previous tests
MultiJson.send(:remove_instance_variable, :@adapter)
Something went wrong with that request. Please try again.