Use therubyrhino as JavaScript runtime for JRuby on Linux

This commit is contained in:
Luca Guidi 2016-10-20 11:50:32 +02:00
parent 896d6b252d
commit 0ce764923d
2 changed files with 8 additions and 3 deletions

View File

@ -36,9 +36,10 @@ gem 'unicorn', require: false, platforms: :ruby
# `hanami server` integration tests (web pages)
gem 'capybara', require: false
if RUBY_PLATFORM =~ /linux|jruby/
if RUBY_DESCRIPTION =~ /linux/
gem 'poltergeist', require: false
gem 'therubyracer', require: false
gem 'therubyracer', require: false, platforms: :ruby
gem 'therubyrhino', require: false, platforms: :jruby
else
gem 'capybara-webkit', require: false
end

View File

@ -4,7 +4,11 @@ RSpec.describe 'hanami assets', type: :cli do
describe 'precompile' do
it "precompiles assets" do
gems = ['sass', 'coffee-script']
gems.push('therubyracer') if Platform.match?(os: :linux)
Platform.match do
os(:linux).engine(:ruby) { gems.push('therubyracer') }
os(:linux).engine(:jruby) { gems.push('therubyrhino') }
end
with_project("bookshelf_assets_precompile", gems: gems) do
#