Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,29 @@ rvm:

gemfile:
- gemfiles/rails_3.2.gemfile
- gemfiles/rails_4.0.gemfile
- gemfiles/rails_4.0.5.gemfile
- gemfiles/rails_4.0_with_therubyracer.gemfile
- gemfiles/rails_4.1.gemfile
- gemfiles/rails_4.2_sprockets_2.gemfile
- gemfiles/rails_4.2_sprockets_3.gemfile
- gemfiles/rails_4.2_sprockets_4.gemfile
- gemfiles/rails_4.1.gemfile
- gemfiles/rails_5.gemfile
- gemfiles/rails_5_no_sprockets.gemfile
- gemfiles/rails_5_mini_racer.gemfile
- gemfiles/rails_5_sprockets_4.gemfile

matrix:
fast_finish: true
exclude:
- rvm: 2.1
gemfile: gemfiles/rails_3.2.gemfile
- rvm: 2.3.0
gemfile: gemfiles/rails_3.2.gemfile
- rvm: 2.1
gemfile: gemfiles/rails_4.0.gemfile
gemfile: rails_4.0.5.gemfile
- rvm: 2.1
gemfile: rails_4.0_with_therubyracer.gemfile
- rvm: 2.1
gemfile: gemfiles/rails_4.1.gemfile
- rvm: 2.1
gemfile: gemfiles/rails_4.2_sprockets_2.gemfile
- rvm: 2.1
gemfile: gemfiles/rails_4.2_sprockets_3.gemfile
- rvm: 2.1
gemfile: gemfiles/rails_4.2_sprockets_4.gemfile
- rvm: 2.1
Expand All @@ -44,8 +40,6 @@ matrix:
gemfile: gemfiles/rails_5_no_sprockets.gemfile
- rvm: 2.1
gemfile: gemfiles/rails_5_sprockets_4.gemfile
- rvm: 2.1
gemfile: gemfiles/rails_5_mini_racer.gemfile
- rvm: jruby-9.0.1.0
gemfile: gemfiles/rails_4.0.gemfile
- rvm: jruby-9.0.1.0
Expand Down
10 changes: 5 additions & 5 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
appraise "rails-3.2" do
gem 'rails', '~> 3.2.21'
gem 'rack-cache', '~> 1.6.1'
end

appraise "rails-4.0" do
gem 'rails', '~> 4.0.13'
# Modern turbolinks depends on `Rails.application.assets` which no-worky
gem 'turbolinks', '~> 2.0'
end

appraise "rails-4.0.5" do
Expand All @@ -14,11 +12,13 @@ appraise "rails-4.0.5" do
# sprockets-rails 2.2.2. Ensure that server rendering falls back to
# `ServerRendering::EnvironmentContainer`.`
gem 'rails', '4.0.5'
gem "turbolinks"
end

appraise "rails-4.0-with-therubyracer" do
gem 'rails', '~> 4.0.13'
gem 'therubyracer', '0.12.0', :platform => :mri
gem "turbolinks"
end

appraise "rails-4.1" do
Expand All @@ -30,6 +30,7 @@ end
appraise "rails-4.2-sprockets_2" do
gem 'rails', '~> 4.2.1'
gem "sprockets", "~> 2.12"
gem "turbolinks"
end

appraise "rails-4.2-sprockets_3" do
Expand All @@ -51,7 +52,6 @@ end

appraise "rails-5-no_sprockets" do
gem 'rails', '~> 5.0.0'
gem "turbolinks", "~> 5.0.0"
end

appraise "rails-5-sprockets_4" do
Expand Down
1 change: 1 addition & 0 deletions gemfiles/rails_3.2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ source "http://rubygems.org"

gem "rails", "~> 3.2.21"
gem "rack-cache", "~> 1.6.1"
gem "turbolinks", "~> 2.0"

gemspec :path => "../"
1 change: 1 addition & 0 deletions gemfiles/rails_4.0.5.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
source "http://rubygems.org"

gem "rails", "4.0.5"
gem "turbolinks"

gemspec :path => "../"
7 changes: 0 additions & 7 deletions gemfiles/rails_4.0.gemfile

This file was deleted.

1 change: 1 addition & 0 deletions gemfiles/rails_4.0_with_therubyracer.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ source "http://rubygems.org"

gem "rails", "~> 4.0.13"
gem "therubyracer", "0.12.0", :platform => :mri
gem "turbolinks"

gemspec :path => "../"
1 change: 1 addition & 0 deletions gemfiles/rails_4.2_sprockets_2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ source "http://rubygems.org"

gem "rails", "~> 4.2.1"
gem "sprockets", "~> 2.12"
gem "turbolinks"

gemspec :path => "../"
9 changes: 0 additions & 9 deletions gemfiles/rails_5_mini_racer.gemfile

This file was deleted.

1 change: 0 additions & 1 deletion gemfiles/rails_5_no_sprockets.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
source "http://rubygems.org"

gem "rails", "~> 5.0.0"
gem "turbolinks", "~> 5.0.0", require: false

gemspec :path => "../"
12 changes: 9 additions & 3 deletions lib/react/server_rendering/yaml_manifest_container.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,24 @@ module ServerRendering
# but sometimes, they're compiled to other directories (or other servers)
class YamlManifestContainer
def initialize
@assets = YAML.load_file(::Rails.root.join("public", ::Rails.application.config.assets.prefix, "manifest.yml"))
@assets = YAML.load_file(public_asset_path("manifest.yml"))
end

def find_asset(logical_path)
asset_path = @assets[logical_path] || raise("No compiled asset for #{logical_path}, was it precompiled?")
asset_full_path = ::Rails.root.join("public", ::Rails.application.config.assets.prefix, asset_path)
File.read(asset_full_path)
File.read(public_asset_path(asset_path))
end

def self.compatible?
::Rails::VERSION::MAJOR == 3
end

private

def public_asset_path(asset_name)
asset_path = File.join("public", ::Rails.application.config.assets.prefix, asset_name)
::Rails.root.join(asset_path)
end
end
end
end
1 change: 0 additions & 1 deletion react-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Gem::Specification.new do |s|
s.add_development_dependency 'listen', '~> 3.0.0' # support Ruby 2.1
s.add_development_dependency 'poltergeist', '>= 0.3.3'
s.add_development_dependency 'test-unit', '~> 2.5'
s.add_development_dependency 'turbolinks', '>= 2.0.0'
s.add_development_dependency 'rails', '>= 3.2'

s.add_dependency 'coffee-script-source', '~>1.8'
Expand Down
2 changes: 1 addition & 1 deletion test/react/server_rendering/sprockets_renderer_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class SprocketsRendererTest < ActiveSupport::TestCase

CALLBACKS.each do |callback_name|
test "#render should pass prerender options to ##{callback_name}" do
mocked_method = MiniTest::Mock.new
mocked_method = Minitest::Mock.new
mocked_method.expect :call, '', [
"Todo",
"{\"todo\":\"write tests\"}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ def test_find_asset_gets_asset_contents
end
end
end