Skip to content

Commit acff4b4

Browse files
author
Arthur Nogueira Neves
committed
Merge pull request #356 from k0kubun/rails5
Support Rails 5.0
2 parents b370178 + 55d13a9 commit acff4b4

File tree

9 files changed

+49
-13
lines changed

9 files changed

+49
-13
lines changed

sass-rails.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
1313
s.description = %q{Sass adapter for the Rails asset pipeline.}
1414
s.license = %q{MIT}
1515

16-
s.add_dependency 'railties', '>= 4.0.0', '< 5.0'
16+
s.add_dependency 'railties', '>= 4.0.0', '< 5.1'
1717
s.add_dependency 'sass', '~> 3.4'
1818
s.add_dependency 'sprockets-rails', '< 4.0'
1919
s.add_dependency 'sprockets', '~> 4.x'

test/fixtures/alternate_config_project/config/environments/production.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
config.action_controller.perform_caching = true
1212

1313
# Disable Rails's static asset server (Apache or nginx will already do this)
14-
if config.respond_to?(:serve_static_files)
14+
if config.respond_to?(:public_file_server)
15+
config.public_file_server.enabled = false
16+
elsif config.respond_to?(:serve_static_files)
1517
config.serve_static_files = false
1618
else
1719
config.serve_static_assets = false

test/fixtures/alternate_config_project/config/environments/test.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,19 @@
88
config.cache_classes = true
99

1010
# Configure static asset server for tests with Cache-Control for performance
11-
if config.respond_to?(:serve_static_files)
11+
if config.respond_to?(:public_file_server)
12+
config.public_file_server.enabled = true
13+
elsif config.respond_to?(:serve_static_files)
1214
config.serve_static_files = true
1315
else
1416
config.serve_static_assets = true
1517
end
16-
config.static_cache_control = "public, max-age=3600"
18+
19+
if config.respond_to?(:public_file_server)
20+
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
21+
else
22+
config.static_cache_control = "public, max-age=3600"
23+
end
1724

1825
config.eager_load = false
1926

test/fixtures/engine_project/test/dummy/config/environments/production.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
# config.action_dispatch.rack_cache = true
2121

2222
# Disable Rails's static asset server (Apache or nginx will already do this).
23-
if config.respond_to?(:serve_static_files)
23+
if config.respond_to?(:public_file_server)
24+
config.public_file_server.enabled = false
25+
elsif config.respond_to?(:serve_static_files)
2426
config.serve_static_files = false
2527
else
2628
config.serve_static_assets = false

test/fixtures/engine_project/test/dummy/config/environments/test.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,19 @@
1313
config.eager_load = false
1414

1515
# Configure static asset server for tests with Cache-Control for performance.
16-
if config.respond_to?(:serve_static_files)
16+
if config.respond_to?(:public_file_server)
17+
config.public_file_server.enabled = true
18+
elsif config.respond_to?(:serve_static_files)
1719
config.serve_static_files = true
1820
else
1921
config.serve_static_assets = true
2022
end
21-
config.static_cache_control = "public, max-age=3600"
23+
24+
if config.respond_to?(:public_file_server)
25+
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
26+
else
27+
config.static_cache_control = "public, max-age=3600"
28+
end
2229

2330
# Show full error reports and disable caching.
2431
config.consider_all_requests_local = true

test/fixtures/sass_project/config/environments/production.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
config.action_controller.perform_caching = true
1313

1414
# Disable Rails's static asset server (Apache or nginx will already do this)
15-
if config.respond_to?(:serve_static_files)
15+
if config.respond_to?(:public_file_server)
16+
config.public_file_server.enabled = false
17+
elsif config.respond_to?(:serve_static_files)
1618
config.serve_static_files = false
1719
else
1820
config.serve_static_assets = false

test/fixtures/sass_project/config/environments/test.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,19 @@
1111
config.eager_load = false
1212

1313
# Configure static asset server for tests with Cache-Control for performance
14-
if config.respond_to?(:serve_static_files)
14+
if config.respond_to?(:public_file_server)
15+
config.public_file_server.enabled = true
16+
elsif config.respond_to?(:serve_static_files)
1517
config.serve_static_files = true
1618
else
1719
config.serve_static_assets = true
1820
end
19-
config.static_cache_control = "public, max-age=3600"
21+
22+
if config.respond_to?(:public_file_server)
23+
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
24+
else
25+
config.static_cache_control = "public, max-age=3600"
26+
end
2027

2128
# Show full error reports and disable caching
2229
config.consider_all_requests_local = true

test/fixtures/scss_project/config/environments/production.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
config.action_controller.perform_caching = true
1212

1313
# Disable Rails's static asset server (Apache or nginx will already do this)
14-
if config.respond_to?(:serve_static_files)
14+
if config.respond_to?(:public_file_server)
15+
config.public_file_server.enabled = false
16+
elsif config.respond_to?(:serve_static_files)
1517
config.serve_static_files = false
1618
else
1719
config.serve_static_assets = false

test/fixtures/scss_project/config/environments/test.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,19 @@
1010
config.eager_load = false
1111

1212
# Configure static asset server for tests with Cache-Control for performance
13-
if config.respond_to?(:serve_static_files)
13+
if config.respond_to?(:public_file_server)
14+
config.public_file_server.enabled = true
15+
elsif config.respond_to?(:serve_static_files)
1416
config.serve_static_files = true
1517
else
1618
config.serve_static_assets = true
1719
end
18-
config.static_cache_control = "public, max-age=3600"
20+
21+
if config.respond_to?(:public_file_server)
22+
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
23+
else
24+
config.static_cache_control = "public, max-age=3600"
25+
end
1926

2027
# Show full error reports and disable caching
2128
config.consider_all_requests_local = true

0 commit comments

Comments
 (0)