Commit e11e584b by lanrion

修复 yajl-ruby 不支持 jruby 无法使用问题

parent 941b16f2
source 'https://rubygems.org'
group :test, :development do
gem "rspec"
gem 'redis-namespace'
gem 'simplecov', '~> 0.7.1', :require => false
gem "codeclimate-test-reporter", require: nil
gem 'coveralls', require: false
# For debugger
gem "pry-rails"
gem "pry-byebug"
end
# Specify your gem's dependencies in weixin_authorize.gemspec
gemspec
require "rest-client"
require "carrierwave"
require 'yajl/json_gem'
if defined? Yajl
require 'yajl/json_gem'
else
require "json"
end
require "weixin_authorize/carrierwave/weixin_uploader"
require "weixin_authorize/config"
......
......@@ -15,7 +15,6 @@
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
require "rspec"
require "weixin_authorize"
require 'yajl/json_gem'
require "redis"
require "redis-namespace"
......
......@@ -26,9 +26,23 @@ Gem::Specification.new do |spec|
# A streaming JSON parsing and encoding library for Ruby (C bindings to yajl)
# https://github.com/brianmario/yajl-ruby
spec.add_dependency "yajl-ruby", ">= 1.2.0"
# yajl-ruby 不支持 jruby
if RUBY_PLATFORM == 'java'
spec.add_dependency "json"
else
spec.add_dependency "yajl-ruby", ">= 1.2.0"
end
spec.add_development_dependency "bundler"
spec.add_development_dependency "rake"
spec.add_development_dependency "rspec"
spec.add_development_dependency "redis-namespace"
spec.add_development_dependency "codeclimate-test-reporter"
spec.add_development_dependency "simplecov", "~> 0.10.0"
spec.add_development_dependency 'coveralls', '~> 0.8.2'
spec.add_development_dependency 'pry-rails'
if RUBY_PLATFORM != 'java'
spec.add_development_dependency 'pry-byebug'
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment