-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Don't require multi_json and multi_xml. #1623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# This file was generated by Appraisal | ||
|
||
source 'https://rubygems.org' | ||
|
||
gem 'multi_json', require: 'multi_json' | ||
|
||
group :development, :test do | ||
gem 'bundler' | ||
gem 'rake' | ||
gem 'rubocop', '0.47.0' | ||
gem 'hashie' | ||
end | ||
|
||
group :development do | ||
gem 'guard' | ||
gem 'guard-rspec' | ||
gem 'guard-rubocop' | ||
gem 'yard' | ||
gem 'appraisal' | ||
gem 'benchmark-ips' | ||
gem 'redcarpet' | ||
end | ||
|
||
group :test do | ||
gem 'grape-entity', '~> 0.6' | ||
gem 'maruku' | ||
gem 'rack-test' | ||
gem 'rspec', '~> 3.0' | ||
gem 'cookiejar' | ||
gem 'rack-jsonp', require: 'rack/jsonp' | ||
gem 'mime-types' | ||
gem 'ruby-grape-danger', '~> 0.1.0', require: false | ||
gem 'coveralls', '~> 0.8.17', require: false | ||
end | ||
|
||
gemspec path: '../' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# This file was generated by Appraisal | ||
|
||
source 'https://rubygems.org' | ||
|
||
gem 'multi_xml', require: 'multi_xml' | ||
|
||
group :development, :test do | ||
gem 'bundler' | ||
gem 'rake' | ||
gem 'rubocop', '0.47.0' | ||
gem 'hashie' | ||
end | ||
|
||
group :development do | ||
gem 'guard' | ||
gem 'guard-rspec' | ||
gem 'guard-rubocop' | ||
gem 'yard' | ||
gem 'appraisal' | ||
gem 'benchmark-ips' | ||
gem 'redcarpet' | ||
end | ||
|
||
group :test do | ||
gem 'grape-entity', '~> 0.6' | ||
gem 'maruku' | ||
gem 'rack-test' | ||
gem 'rspec', '~> 3.0' | ||
gem 'cookiejar' | ||
gem 'rack-jsonp', require: 'rack/jsonp' | ||
gem 'mime-types' | ||
gem 'ruby-grape-danger', '~> 0.1.0', require: false | ||
gem 'coveralls', '~> 0.8.17', require: false | ||
end | ||
|
||
gemspec path: '../' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module Grape | ||
if Object.const_defined? :MultiJson | ||
Json = ::MultiJson | ||
else | ||
Json = ::JSON | ||
Json::ParseError = Json::ParserError | ||
end | ||
end | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module Grape | ||
if Object.const_defined? :MultiXml | ||
Xml = ::MultiXml | ||
else | ||
Xml = ::ActiveSupport::XmlMini | ||
Xml::ParseError = StandardError | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Likewise, I'd like to declare There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or are you saying that I should add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. Do I understand things correctly? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, take a look at the PR as now, any issues? Thank you. |
||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to declare
require 'json'
explicitly instead of trying to require it here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean exactly? That the user has to
require 'multi_json'
explicitly instead of trying to require and catchLoadError
here? That's a bit tricky because that forces you to includemulti_json
before Grape, doesn't it?