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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9e125cf7a784d74a2cb6d73d750126b9770a54ed
4
- data.tar.gz: b414e4fa457d7ee3f8e57f4cd81912489da64a24
3
+ metadata.gz: bcabc9259ed272094102b2bdc76962fc592ee2b6
4
+ data.tar.gz: 847eff97909c506f217f39c36ad93b53ee4a96fb
5
5
  SHA512:
6
- metadata.gz: 47d951d41f4f6b30cd2c757461a371f7f2ca408efaba7d7d7d6ae4e1a747b40ad6a37c17ec137d489ac7fdb44fda4a0756318171c6f5da2d464d6217805a7128
7
- data.tar.gz: 3d93c0c5f7b0fcabb32b2ea8e42d8a974abb06c713bcd9339ea86a3dc9179a2b0cdf67b7a5ffcdd89ddf33ce038dd9284f18eb3bcd98ead391f76766b030f90c
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.6'
10
- gem 'capybara', '~> 2.16'
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', '~> 0.7.0'
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
- else
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
 
@@ -1,5 +1,5 @@
1
1
  module CriticalPathCSS
2
2
  module Rails
3
- VERSION = '3.0.0'.freeze
3
+ VERSION = '3.0.1'.freeze
4
4
  end
5
5
  end
@@ -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
@@ -10,6 +10,8 @@ require 'rspec/rails'
10
10
  require 'capybara/rails'
11
11
 
12
12
  RSpec.configure do |config|
13
+ config.include Capybara::DSL
14
+
13
15
  config.use_transactional_fixtures = true
14
16
 
15
17
  # Enable flags like --only-failures and --next-failure
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.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-24 00:00:00.000000000 Z
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: 0.7.0
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: 0.7.0
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: []