Skip to content

Commit 96cedde

Browse files
authored
Merge pull request #679 from reactjs/fix-ci
fix(tests) test on Rails 3.2, fix no-sprockets test
2 parents 4e854e4 + c18cc12 commit 96cedde

13 files changed

+23
-38
lines changed

.travis.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,29 @@ rvm:
99

1010
gemfile:
1111
- gemfiles/rails_3.2.gemfile
12-
- gemfiles/rails_4.0.gemfile
1312
- gemfiles/rails_4.0.5.gemfile
1413
- gemfiles/rails_4.0_with_therubyracer.gemfile
14+
- gemfiles/rails_4.1.gemfile
1515
- gemfiles/rails_4.2_sprockets_2.gemfile
1616
- gemfiles/rails_4.2_sprockets_3.gemfile
1717
- gemfiles/rails_4.2_sprockets_4.gemfile
18-
- gemfiles/rails_4.1.gemfile
1918
- gemfiles/rails_5.gemfile
2019
- gemfiles/rails_5_no_sprockets.gemfile
21-
- gemfiles/rails_5_mini_racer.gemfile
2220
- gemfiles/rails_5_sprockets_4.gemfile
2321

2422
matrix:
2523
fast_finish: true
2624
exclude:
2725
- rvm: 2.1
2826
gemfile: gemfiles/rails_3.2.gemfile
29-
- rvm: 2.3.0
30-
gemfile: gemfiles/rails_3.2.gemfile
3127
- rvm: 2.1
32-
gemfile: gemfiles/rails_4.0.gemfile
28+
gemfile: rails_4.0.5.gemfile
3329
- rvm: 2.1
3430
gemfile: rails_4.0_with_therubyracer.gemfile
35-
- rvm: 2.1
36-
gemfile: gemfiles/rails_4.1.gemfile
3731
- rvm: 2.1
3832
gemfile: gemfiles/rails_4.2_sprockets_2.gemfile
33+
- rvm: 2.1
34+
gemfile: gemfiles/rails_4.2_sprockets_3.gemfile
3935
- rvm: 2.1
4036
gemfile: gemfiles/rails_4.2_sprockets_4.gemfile
4137
- rvm: 2.1
@@ -44,8 +40,6 @@ matrix:
4440
gemfile: gemfiles/rails_5_no_sprockets.gemfile
4541
- rvm: 2.1
4642
gemfile: gemfiles/rails_5_sprockets_4.gemfile
47-
- rvm: 2.1
48-
gemfile: gemfiles/rails_5_mini_racer.gemfile
4943
- rvm: jruby-9.0.1.0
5044
gemfile: gemfiles/rails_4.0.gemfile
5145
- rvm: jruby-9.0.1.0

Appraisals

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
appraise "rails-3.2" do
22
gem 'rails', '~> 3.2.21'
33
gem 'rack-cache', '~> 1.6.1'
4-
end
5-
6-
appraise "rails-4.0" do
7-
gem 'rails', '~> 4.0.13'
4+
# Modern turbolinks depends on `Rails.application.assets` which no-worky
5+
gem 'turbolinks', '~> 2.0'
86
end
97

108
appraise "rails-4.0.5" do
@@ -14,11 +12,13 @@ appraise "rails-4.0.5" do
1412
# sprockets-rails 2.2.2. Ensure that server rendering falls back to
1513
# `ServerRendering::EnvironmentContainer`.`
1614
gem 'rails', '4.0.5'
15+
gem "turbolinks"
1716
end
1817

1918
appraise "rails-4.0-with-therubyracer" do
2019
gem 'rails', '~> 4.0.13'
2120
gem 'therubyracer', '0.12.0', :platform => :mri
21+
gem "turbolinks"
2222
end
2323

2424
appraise "rails-4.1" do
@@ -30,6 +30,7 @@ end
3030
appraise "rails-4.2-sprockets_2" do
3131
gem 'rails', '~> 4.2.1'
3232
gem "sprockets", "~> 2.12"
33+
gem "turbolinks"
3334
end
3435

3536
appraise "rails-4.2-sprockets_3" do
@@ -51,7 +52,6 @@ end
5152

5253
appraise "rails-5-no_sprockets" do
5354
gem 'rails', '~> 5.0.0'
54-
gem "turbolinks", "~> 5.0.0"
5555
end
5656

5757
appraise "rails-5-sprockets_4" do

gemfiles/rails_3.2.gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ source "http://rubygems.org"
44

55
gem "rails", "~> 3.2.21"
66
gem "rack-cache", "~> 1.6.1"
7+
gem "turbolinks", "~> 2.0"
78

89
gemspec :path => "../"

gemfiles/rails_4.0.5.gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
source "http://rubygems.org"
44

55
gem "rails", "4.0.5"
6+
gem "turbolinks"
67

78
gemspec :path => "../"

gemfiles/rails_4.0.gemfile

Lines changed: 0 additions & 7 deletions
This file was deleted.

gemfiles/rails_4.0_with_therubyracer.gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ source "http://rubygems.org"
44

55
gem "rails", "~> 4.0.13"
66
gem "therubyracer", "0.12.0", :platform => :mri
7+
gem "turbolinks"
78

89
gemspec :path => "../"

gemfiles/rails_4.2_sprockets_2.gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ source "http://rubygems.org"
44

55
gem "rails", "~> 4.2.1"
66
gem "sprockets", "~> 2.12"
7+
gem "turbolinks"
78

89
gemspec :path => "../"

gemfiles/rails_5_mini_racer.gemfile

Lines changed: 0 additions & 9 deletions
This file was deleted.

gemfiles/rails_5_no_sprockets.gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
source "http://rubygems.org"
44

55
gem "rails", "~> 5.0.0"
6-
gem "turbolinks", "~> 5.0.0", require: false
76

87
gemspec :path => "../"

lib/react/server_rendering/yaml_manifest_container.rb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,24 @@ module ServerRendering
66
# but sometimes, they're compiled to other directories (or other servers)
77
class YamlManifestContainer
88
def initialize
9-
@assets = YAML.load_file(::Rails.root.join("public", ::Rails.application.config.assets.prefix, "manifest.yml"))
9+
@assets = YAML.load_file(public_asset_path("manifest.yml"))
1010
end
1111

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

1817
def self.compatible?
1918
::Rails::VERSION::MAJOR == 3
2019
end
20+
21+
private
22+
23+
def public_asset_path(asset_name)
24+
asset_path = File.join("public", ::Rails.application.config.assets.prefix, asset_name)
25+
::Rails.root.join(asset_path)
26+
end
2127
end
2228
end
2329
end

0 commit comments

Comments
 (0)