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