Commit 68de1f34f61ae7eb97db6c246a90b8c8ff8aefcb
Exists in
master
and in
1 other branch
Merge pull request #819 from stevecrozz/experimental_jruby_compatibility
add experimental support for jruby-9000-dev
Showing
7 changed files
with
37 additions
and
6 deletions
Show diff stats
.travis.yml
Gemfile
| ... | ... | @@ -55,7 +55,8 @@ gem 'flowdock' |
| 55 | 55 | gem 'omniauth-github' |
| 56 | 56 | |
| 57 | 57 | gem 'ri_cal' |
| 58 | -gem 'yajl-ruby', :require => "yajl" | |
| 58 | +gem 'yajl-ruby', platform: 'ruby' | |
| 59 | +gem 'json', platform: 'jruby' | |
| 59 | 60 | |
| 60 | 61 | group :development, :test do |
| 61 | 62 | gem 'airbrake', :require => false |
| ... | ... | @@ -72,7 +73,7 @@ group :development do |
| 72 | 73 | |
| 73 | 74 | # better errors |
| 74 | 75 | gem 'better_errors' |
| 75 | - gem 'binding_of_caller' | |
| 76 | + gem 'binding_of_caller', platform: 'ruby' | |
| 76 | 77 | gem 'meta_request' |
| 77 | 78 | gem 'foreman', :require => false |
| 78 | 79 | end |
| ... | ... | @@ -96,7 +97,7 @@ end |
| 96 | 97 | |
| 97 | 98 | group :heroku, :production do |
| 98 | 99 | gem 'rails_12factor', require: !!ENV["HEROKU"] |
| 99 | - gem 'unicorn', :require => false | |
| 100 | + gem 'unicorn', require: false, platform: 'ruby' | |
| 100 | 101 | end |
| 101 | 102 | |
| 102 | 103 | gem 'sass-rails' | ... | ... |
Gemfile.lock
| ... | ... | @@ -51,12 +51,14 @@ GEM |
| 51 | 51 | json |
| 52 | 52 | arel (5.0.1.20140414130214) |
| 53 | 53 | bcrypt (3.1.9) |
| 54 | + bcrypt (3.1.9-java) | |
| 54 | 55 | better_errors (1.0.1) |
| 55 | 56 | coderay (>= 1.0.0) |
| 56 | 57 | erubis (>= 2.6.6) |
| 57 | 58 | binding_of_caller (0.7.2) |
| 58 | 59 | debug_inspector (>= 0.0.1) |
| 59 | 60 | bson (2.3.0) |
| 61 | + bson (2.3.0-java) | |
| 60 | 62 | builder (3.2.2) |
| 61 | 63 | byebug (2.7.0) |
| 62 | 64 | columnize (~> 0.3) |
| ... | ... | @@ -132,6 +134,7 @@ GEM |
| 132 | 134 | fabrication (2.9.0) |
| 133 | 135 | faraday (0.8.9) |
| 134 | 136 | multipart-post (~> 1.2.0) |
| 137 | + ffi (1.9.6-java) | |
| 135 | 138 | flowdock (0.3.1) |
| 136 | 139 | httparty (~> 0.7) |
| 137 | 140 | multi_json |
| ... | ... | @@ -160,6 +163,7 @@ GEM |
| 160 | 163 | railties (>= 3.0, < 5.0) |
| 161 | 164 | thor (>= 0.14, < 2.0) |
| 162 | 165 | json (1.8.2) |
| 166 | + json (1.8.2-java) | |
| 163 | 167 | jwt (0.1.8) |
| 164 | 168 | multi_json (>= 1.5) |
| 165 | 169 | kaminari (0.14.1) |
| ... | ... | @@ -168,6 +172,9 @@ GEM |
| 168 | 172 | kgio (2.9.2) |
| 169 | 173 | launchy (2.4.3) |
| 170 | 174 | addressable (~> 2.3) |
| 175 | + launchy (2.4.3-java) | |
| 176 | + addressable (~> 2.3) | |
| 177 | + spoon (~> 0.0.1) | |
| 171 | 178 | mail (2.6.3) |
| 172 | 179 | mime-types (>= 1.16, < 3) |
| 173 | 180 | meta_request (0.2.8) |
| ... | ... | @@ -204,6 +211,7 @@ GEM |
| 204 | 211 | net-ssh (2.9.1) |
| 205 | 212 | nokogiri (1.6.5) |
| 206 | 213 | mini_portile (~> 0.6.0) |
| 214 | + nokogiri (1.6.5-java) | |
| 207 | 215 | oauth2 (0.8.1) |
| 208 | 216 | faraday (~> 0.8) |
| 209 | 217 | httpauth (~> 0.1) |
| ... | ... | @@ -239,6 +247,11 @@ GEM |
| 239 | 247 | coderay (~> 1.0.5) |
| 240 | 248 | method_source (~> 0.8) |
| 241 | 249 | slop (~> 3.4) |
| 250 | + pry (0.9.12.2-java) | |
| 251 | + coderay (~> 1.0.5) | |
| 252 | + method_source (~> 0.8) | |
| 253 | + slop (~> 3.4) | |
| 254 | + spoon (~> 0.0) | |
| 242 | 255 | pry-byebug (1.3.2) |
| 243 | 256 | byebug (~> 2.7) |
| 244 | 257 | pry (~> 0.9.12) |
| ... | ... | @@ -332,6 +345,8 @@ GEM |
| 332 | 345 | simplecov-html (~> 0.7.1) |
| 333 | 346 | simplecov-html (0.7.1) |
| 334 | 347 | slop (3.4.6) |
| 348 | + spoon (0.0.4) | |
| 349 | + ffi | |
| 335 | 350 | sprockets (2.12.3) |
| 336 | 351 | hike (~> 1.2) |
| 337 | 352 | multi_json (~> 1.0) |
| ... | ... | @@ -351,6 +366,7 @@ GEM |
| 351 | 366 | power_assert |
| 352 | 367 | thor (0.19.1) |
| 353 | 368 | thread_safe (0.3.4) |
| 369 | + thread_safe (0.3.4-java) | |
| 354 | 370 | tilt (1.4.1) |
| 355 | 371 | timecop (0.6.3) |
| 356 | 372 | tins (0.12.0) |
| ... | ... | @@ -369,6 +385,8 @@ GEM |
| 369 | 385 | rack (>= 1.0) |
| 370 | 386 | websocket-driver (0.5.1) |
| 371 | 387 | websocket-extensions (>= 0.1.0) |
| 388 | + websocket-driver (0.5.1-java) | |
| 389 | + websocket-extensions (>= 0.1.0) | |
| 372 | 390 | websocket-extensions (0.1.1) |
| 373 | 391 | xmpp4r (0.5.5) |
| 374 | 392 | xpath (2.0.0) |
| ... | ... | @@ -376,6 +394,7 @@ GEM |
| 376 | 394 | yajl-ruby (1.1.0) |
| 377 | 395 | |
| 378 | 396 | PLATFORMS |
| 397 | + java | |
| 379 | 398 | ruby |
| 380 | 399 | |
| 381 | 400 | DEPENDENCIES |
| ... | ... | @@ -411,6 +430,7 @@ DEPENDENCIES |
| 411 | 430 | htmlentities |
| 412 | 431 | httparty |
| 413 | 432 | jquery-rails (~> 2.1.4) |
| 433 | + json | |
| 414 | 434 | kaminari (>= 0.14.1) |
| 415 | 435 | launchy |
| 416 | 436 | meta_request | ... | ... |
app/controllers/api/v1/notices_controller.rb
| ... | ... | @@ -16,7 +16,7 @@ class Api::V1::NoticesController < ApplicationController |
| 16 | 16 | end |
| 17 | 17 | |
| 18 | 18 | respond_to do |format| |
| 19 | - format.any(:html, :json) { render :json => Yajl.dump(results) } # render JSON if no extension specified on path | |
| 19 | + format.any(:html, :json) { render :json => JSON.dump(results) } # render JSON if no extension specified on path | |
| 20 | 20 | format.xml { render :xml => results } |
| 21 | 21 | end |
| 22 | 22 | end | ... | ... |
app/controllers/api/v1/problems_controller.rb
| ... | ... | @@ -32,7 +32,7 @@ class Api::V1::ProblemsController < ApplicationController |
| 32 | 32 | end |
| 33 | 33 | |
| 34 | 34 | respond_to do |format| |
| 35 | - format.any(:html, :json) { render :json => Yajl.dump(results) } # render JSON if no extension specified on path | |
| 35 | + format.any(:html, :json) { render :json => JSON.dump(results) } # render JSON if no extension specified on path | |
| 36 | 36 | format.xml { render :xml => results } |
| 37 | 37 | end |
| 38 | 38 | end | ... | ... |
app/controllers/api/v1/stats_controller.rb
| ... | ... | @@ -18,7 +18,7 @@ class Api::V1::StatsController < ApplicationController |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | respond_to do |format| |
| 21 | - format.any(:html, :json) { render :json => Yajl.dump(stats) } # render JSON if no extension specified on path | |
| 21 | + format.any(:html, :json) { render :json => JSON.dump(stats) } # render JSON if no extension specified on path | |
| 22 | 22 | format.xml { render :xml => stats } |
| 23 | 23 | end |
| 24 | 24 | end | ... | ... |
config/boot.rb
| ... | ... | @@ -2,3 +2,11 @@ |
| 2 | 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) |
| 3 | 3 | |
| 4 | 4 | require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) |
| 5 | +require 'json' | |
| 6 | + | |
| 7 | +begin | |
| 8 | + # try to use Yajl, the json_gem compatibility layer must be loaded after json | |
| 9 | + require 'yajl/json_gem' | |
| 10 | +rescue LoadError | |
| 11 | + # fail silently because json gem is fine | |
| 12 | +end | ... | ... |