critical-path-css-rails 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -2
- data/critical-path-css-rails.gemspec +1 -1
- data/lib/critical_path_css/rails/config_loader.rb +4 -1
- data/lib/critical_path_css/rails/version.rb +1 -1
- data/spec/lib/critical_path_css/rails/config_loader_spec.rb +26 -0
- data/spec/spec_helper.rb +2 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bcabc9259ed272094102b2bdc76962fc592ee2b6
|
4
|
+
data.tar.gz: 847eff97909c506f217f39c36ad93b53ee4a96fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b00c7b59f57f57491c430ef3ff2957658f72d856a25f960528f43169b828b94de9eb8fa6cc6668ab8ec33db2244f74a4d3e664c8c6ba4925233edfb394ff189e
|
7
|
+
data.tar.gz: 3b42e0ab67a73d36157bcfb84c6c727bbb0fba7cfd561fd72067e577d52aee51e0f72dfe673624499fbc3841fcf5c02e1329563679c3ed8a9060c42499494c7b
|
data/Gemfile
CHANGED
@@ -6,8 +6,8 @@ group :development, :test do
|
|
6
6
|
gem 'actionpack'
|
7
7
|
gem 'byebug', platform: [:ruby], require: false
|
8
8
|
gem 'rubocop', require: false
|
9
|
-
gem 'rspec-rails', '~> 3.
|
10
|
-
gem 'capybara', '~>
|
9
|
+
gem 'rspec-rails', '~> 3.8'
|
10
|
+
gem 'capybara', '~> 3.14'
|
11
11
|
gem 'pry-rails'
|
12
12
|
end
|
13
13
|
|
@@ -14,7 +14,7 @@ Gem::Specification.new do |gem|
|
|
14
14
|
gem.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
15
15
|
gem.require_path = 'lib'
|
16
16
|
|
17
|
-
gem.add_development_dependency 'combustion', '~>
|
17
|
+
gem.add_development_dependency 'combustion', '~> 1.1.0'
|
18
18
|
|
19
19
|
gem.extensions = ['ext/npm/extconf.rb']
|
20
20
|
end
|
@@ -22,9 +22,12 @@ module CriticalPathCss
|
|
22
22
|
if config['css_path']
|
23
23
|
config['css_path'] = format_path(config['css_path'])
|
24
24
|
config['css_paths'] = []
|
25
|
-
|
25
|
+
elsif config['css_paths']
|
26
26
|
config['css_path'] = ''
|
27
27
|
config['css_paths'] = config['css_paths'].collect { |path| format_path(path) }
|
28
|
+
else
|
29
|
+
config['css_path'] = ActionController::Base.helpers.stylesheet_path(config['manifest_name'], host: '')
|
30
|
+
config['css_paths'] = []
|
28
31
|
end
|
29
32
|
end
|
30
33
|
|
@@ -63,6 +63,32 @@ RSpec.describe 'ConfigLoader' do
|
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
66
|
+
context 'when no paths are specified' do
|
67
|
+
let(:config_file) {
|
68
|
+
<<~CONFIG
|
69
|
+
defaults: &defaults
|
70
|
+
base_url: http://0.0.0.0:9292
|
71
|
+
manifest_name: application
|
72
|
+
routes:
|
73
|
+
- /
|
74
|
+
|
75
|
+
development:
|
76
|
+
<<: *defaults
|
77
|
+
|
78
|
+
test:
|
79
|
+
<<: *defaults
|
80
|
+
CONFIG
|
81
|
+
}
|
82
|
+
|
83
|
+
it 'sets css_path with the path' do
|
84
|
+
expect(subject.config['css_path']).to eq '/stylesheets/application.css'
|
85
|
+
end
|
86
|
+
|
87
|
+
it 'leaves css_paths empty' do
|
88
|
+
expect(subject.config['css_paths']).to eq []
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
66
92
|
context 'when single css_path and multiple css_paths are both specified' do
|
67
93
|
let(:config_file) {
|
68
94
|
<<~CONFIG
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: critical-path-css-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Misshore
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02
|
11
|
+
date: 2019-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: combustion
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 1.1.0
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 1.1.0
|
27
27
|
description: Only load the CSS you need for the initial viewport in Rails!
|
28
28
|
email: mmisshore@gmail.com
|
29
29
|
executables: []
|