pugin 1.5.1 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/views/pugin/layouts/_layout.html.haml +4 -0
- data/lib/pugin/feature.rb +1 -0
- data/lib/pugin/feature/asset_overrides.rb +6 -0
- data/lib/pugin/version.rb +1 -1
- data/spec/lib/pugin/feature/asset_overrides_spec.rb +5 -0
- data/spec/lib/pugin/feature/simple_feature_spec.rb +2 -41
- data/spec/lib/pugin/feature/status_banner_spec.rb +2 -50
- data/spec/lib/pugin/feature/top_navigation_spec.rb +2 -50
- data/spec/support/shared_feature_examples.rb +50 -0
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16e131573dafc92fcd70c188811b7fb5cee1ca41
|
4
|
+
data.tar.gz: '028705f2ec88d17e24c24151bacddaad49768de6'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38375cf7843442ffe34d6b0cfdb56ea76a3b696707b2f0b1f9d3493383a31aae17deb550715f85c2e353720cfa14e5d38743ec617e29c941ee59508121f2d572
|
7
|
+
data.tar.gz: 3a6e6c27ad271130c7a67e265980b5957657db61d24d13d8af97f0d16efbb3e6acd168266cafa7acee4df76ea285dd78a26f617dcbd5f4f4a1219f6b2512208c
|
@@ -3,6 +3,8 @@
|
|
3
3
|
%head
|
4
4
|
%title= content_for(:title).nil? ? I18n.t('pugin.layouts.pugin.website_brand') : content_for(:title) + ' - ' + I18n.t('pugin.layouts.pugin.website_brand')
|
5
5
|
%link{rel: 'stylesheet', href: "#{Pugin::ASSET_LOCATION_URL}/#{Pugin::ASSET_VERSION}/stylesheets/main.css" }
|
6
|
+
- if Pugin::Feature::AssetOverrides.enabled?
|
7
|
+
%link{rel: 'stylesheet', href: "https://s3-eu-west-1.amazonaws.com/web1live.static-assets/hybrid-bills/stylesheets/main.css" }
|
6
8
|
%meta{name: 'viewport', content: 'width=device-width, initial-scale=1.0'}
|
7
9
|
%meta{'http-equiv': 'X-UA-Compatible', content: 'IE=edge'}
|
8
10
|
%link{rel: 'shortcut icon', type: 'image/x-icon', href: "#{Pugin::STATIC_ASSET_LOCATION_URL}/favicon.ico"}
|
@@ -28,4 +30,6 @@
|
|
28
30
|
= yield
|
29
31
|
= render 'pugin/components/footer'
|
30
32
|
%script{src: "#{Pugin::ASSET_LOCATION_URL}/#{Pugin::ASSET_VERSION}/javascripts/main.js"}
|
33
|
+
- if Pugin::Feature::AssetOverrides.enabled?
|
34
|
+
%script{src: "https://s3-eu-west-1.amazonaws.com/web1live.static-assets/hybrid-bills/javascripts/main.js"}
|
31
35
|
= render partial: 'pugin/javascript/pingdom' if Pugin::Feature::Pingdom.enabled?
|
data/lib/pugin/feature.rb
CHANGED
data/lib/pugin/version.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe
|
3
|
+
describe Pugin::Feature::SimpleFeature do
|
4
4
|
|
5
5
|
before :example do
|
6
6
|
Pugin::Feature::SimpleFeature.disable
|
@@ -10,46 +10,7 @@ describe 'Pugin simple feature' do
|
|
10
10
|
Pugin::Feature::SimpleFeature.disable
|
11
11
|
end
|
12
12
|
|
13
|
-
|
14
|
-
expect(Pugin::Feature::SimpleFeature.enabled?).to equal(false)
|
15
|
-
end
|
16
|
-
|
17
|
-
context 'without being altered' do
|
18
|
-
it "returns false when checked if it's enabled" do
|
19
|
-
expect(Pugin::Feature::SimpleFeature.enabled?).to equal(false)
|
20
|
-
end
|
21
|
-
it "returns true when checked if it's disabled" do
|
22
|
-
expect(Pugin::Feature::SimpleFeature.disabled?).to equal(true)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
context 'when being enabled' do
|
27
|
-
|
28
|
-
before :each do
|
29
|
-
Pugin::Feature::SimpleFeature.enable
|
30
|
-
end
|
31
|
-
|
32
|
-
it "returns true when checked if it's enabled" do
|
33
|
-
expect(Pugin::Feature::SimpleFeature.enabled?).to equal(true)
|
34
|
-
end
|
35
|
-
it "returns false when checked if it's disabled" do
|
36
|
-
expect(Pugin::Feature::SimpleFeature.disabled?).to equal(false)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
context 'when being disabled' do
|
41
|
-
|
42
|
-
before :each do
|
43
|
-
Pugin::Feature::SimpleFeature.disable
|
44
|
-
end
|
45
|
-
|
46
|
-
it "returns false when checked if it's enabled" do
|
47
|
-
expect(Pugin::Feature::SimpleFeature.enabled?).to equal(false)
|
48
|
-
end
|
49
|
-
it "returns true when checked if it's disabled" do
|
50
|
-
expect(Pugin::Feature::SimpleFeature.disabled?).to equal(true)
|
51
|
-
end
|
52
|
-
end
|
13
|
+
it_behaves_like 'a simple pugin feature'
|
53
14
|
|
54
15
|
context 'when enabling a subclass' do
|
55
16
|
it 'only enables that sub class' do
|
@@ -1,53 +1,5 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe
|
4
|
-
|
5
|
-
before :example do
|
6
|
-
Pugin::Feature::StatusBanner.disable
|
7
|
-
end
|
8
|
-
|
9
|
-
after :example do
|
10
|
-
Pugin::Feature::StatusBanner.disable
|
11
|
-
end
|
12
|
-
|
13
|
-
it 'is initially disabled' do
|
14
|
-
expect(Pugin::Feature::StatusBanner.enabled?).to equal(false)
|
15
|
-
end
|
16
|
-
|
17
|
-
context 'without being altered' do
|
18
|
-
it "returns false when checked if it's enabled" do
|
19
|
-
expect(Pugin::Feature::StatusBanner.enabled?).to equal(false)
|
20
|
-
end
|
21
|
-
it "returns true when checked if it's disabled" do
|
22
|
-
expect(Pugin::Feature::StatusBanner.disabled?).to equal(true)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
context 'when being enabled' do
|
27
|
-
|
28
|
-
before :each do
|
29
|
-
Pugin::Feature::StatusBanner.enable
|
30
|
-
end
|
31
|
-
|
32
|
-
it "returns true when checked if it's enabled" do
|
33
|
-
expect(Pugin::Feature::StatusBanner.enabled?).to equal(true)
|
34
|
-
end
|
35
|
-
it "returns false when checked if it's disabled" do
|
36
|
-
expect(Pugin::Feature::StatusBanner.disabled?).to equal(false)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
context 'when being disabled' do
|
41
|
-
|
42
|
-
before :each do
|
43
|
-
Pugin::Feature::StatusBanner.disable
|
44
|
-
end
|
45
|
-
|
46
|
-
it "returns false when checked if it's enabled" do
|
47
|
-
expect(Pugin::Feature::StatusBanner.enabled?).to equal(false)
|
48
|
-
end
|
49
|
-
it "returns true when checked if it's disabled" do
|
50
|
-
expect(Pugin::Feature::StatusBanner.disabled?).to equal(true)
|
51
|
-
end
|
52
|
-
end
|
3
|
+
describe Pugin::Feature::StatusBanner do
|
4
|
+
it_behaves_like 'a simple pugin feature'
|
53
5
|
end
|
@@ -1,53 +1,5 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe
|
4
|
-
|
5
|
-
before :example do
|
6
|
-
Pugin::Feature::TopNavigation.disable
|
7
|
-
end
|
8
|
-
|
9
|
-
after :example do
|
10
|
-
Pugin::Feature::TopNavigation.disable
|
11
|
-
end
|
12
|
-
|
13
|
-
it 'is initially disabled' do
|
14
|
-
expect(Pugin::Feature::TopNavigation.enabled?).to equal(false)
|
15
|
-
end
|
16
|
-
|
17
|
-
context 'without being altered' do
|
18
|
-
it "returns false when checked if it's enabled" do
|
19
|
-
expect(Pugin::Feature::TopNavigation.enabled?).to equal(false)
|
20
|
-
end
|
21
|
-
it "returns true when checked if it's disabled" do
|
22
|
-
expect(Pugin::Feature::TopNavigation.disabled?).to equal(true)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
context 'when being enabled' do
|
27
|
-
|
28
|
-
before :each do
|
29
|
-
Pugin::Feature::TopNavigation.enable
|
30
|
-
end
|
31
|
-
|
32
|
-
it "returns true when checked if it's enabled" do
|
33
|
-
expect(Pugin::Feature::TopNavigation.enabled?).to equal(true)
|
34
|
-
end
|
35
|
-
it "returns false when checked if it's disabled" do
|
36
|
-
expect(Pugin::Feature::TopNavigation.disabled?).to equal(false)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
context 'when being disabled' do
|
41
|
-
|
42
|
-
before :each do
|
43
|
-
Pugin::Feature::TopNavigation.disable
|
44
|
-
end
|
45
|
-
|
46
|
-
it "returns false when checked if it's enabled" do
|
47
|
-
expect(Pugin::Feature::TopNavigation.enabled?).to equal(false)
|
48
|
-
end
|
49
|
-
it "returns true when checked if it's disabled" do
|
50
|
-
expect(Pugin::Feature::TopNavigation.disabled?).to equal(true)
|
51
|
-
end
|
52
|
-
end
|
3
|
+
describe Pugin::Feature::TopNavigation do
|
4
|
+
it_behaves_like 'a simple pugin feature'
|
53
5
|
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
shared_examples 'a simple pugin feature' do
|
2
|
+
before :example do
|
3
|
+
described_class.disable
|
4
|
+
end
|
5
|
+
|
6
|
+
after :example do
|
7
|
+
described_class.disable
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'is initially disabled' do
|
11
|
+
expect(described_class.enabled?).to equal(false)
|
12
|
+
end
|
13
|
+
|
14
|
+
context 'without being altered' do
|
15
|
+
it 'returns false when checked if it\'s enabled' do
|
16
|
+
expect(described_class.enabled?).to equal(false)
|
17
|
+
end
|
18
|
+
it 'returns true when checked if it\'s disabled' do
|
19
|
+
expect(described_class.disabled?).to equal(true)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
context 'when being enabled' do
|
24
|
+
|
25
|
+
before :each do
|
26
|
+
described_class.enable
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'returns true when checked if it\'s enabled' do
|
30
|
+
expect(described_class.enabled?).to equal(true)
|
31
|
+
end
|
32
|
+
it 'returns false when checked if it\'s disabled' do
|
33
|
+
expect(described_class.disabled?).to equal(false)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
context 'when being disabled' do
|
38
|
+
|
39
|
+
before :each do
|
40
|
+
described_class.disable
|
41
|
+
end
|
42
|
+
|
43
|
+
it 'returns false when checked if it\'s enabled' do
|
44
|
+
expect(described_class.enabled?).to equal(false)
|
45
|
+
end
|
46
|
+
it 'returns true when checked if it\'s disabled' do
|
47
|
+
expect(described_class.disabled?).to equal(true)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pugin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Rayner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -222,6 +222,7 @@ files:
|
|
222
222
|
- lib/pugin/bandiera.rb
|
223
223
|
- lib/pugin/engine.rb
|
224
224
|
- lib/pugin/feature.rb
|
225
|
+
- lib/pugin/feature/asset_overrides.rb
|
225
226
|
- lib/pugin/feature/bandiera.rb
|
226
227
|
- lib/pugin/feature/pingdom_feature.rb
|
227
228
|
- lib/pugin/feature/simple_feature.rb
|
@@ -283,6 +284,7 @@ files:
|
|
283
284
|
- spec/dummy/public/apple-touch-icon-precomposed.png
|
284
285
|
- spec/dummy/public/apple-touch-icon.png
|
285
286
|
- spec/dummy/public/favicon.ico
|
287
|
+
- spec/lib/pugin/feature/asset_overrides_spec.rb
|
286
288
|
- spec/lib/pugin/feature/bandiera_spec.rb
|
287
289
|
- spec/lib/pugin/feature/simple_feature_spec.rb
|
288
290
|
- spec/lib/pugin/feature/status_banner_spec.rb
|
@@ -292,6 +294,7 @@ files:
|
|
292
294
|
- spec/pugin/engine_spec.rb
|
293
295
|
- spec/pugin_spec.rb
|
294
296
|
- spec/spec_helper.rb
|
297
|
+
- spec/support/shared_feature_examples.rb
|
295
298
|
- spec/views/pugin/cards/_person-list.html.haml_spec.rb
|
296
299
|
- spec/views/pugin/components/_footer.html.haml_spec.rb
|
297
300
|
- spec/views/pugin/components/_header.html.haml_spec.rb
|
@@ -331,6 +334,7 @@ summary: Pugin is a component-based pattern design library for UK Parliament mic
|
|
331
334
|
test_files:
|
332
335
|
- spec/spec_helper.rb
|
333
336
|
- spec/pugin_spec.rb
|
337
|
+
- spec/support/shared_feature_examples.rb
|
334
338
|
- spec/dummy/db/schema.rb
|
335
339
|
- spec/dummy/config/spring.rb
|
336
340
|
- spec/dummy/config/boot.rb
|
@@ -388,6 +392,7 @@ test_files:
|
|
388
392
|
- spec/lib/pugin/feature/top_navigation_spec.rb
|
389
393
|
- spec/lib/pugin/feature/simple_feature_spec.rb
|
390
394
|
- spec/lib/pugin/feature/bandiera_spec.rb
|
395
|
+
- spec/lib/pugin/feature/asset_overrides_spec.rb
|
391
396
|
- spec/pugin/engine_spec.rb
|
392
397
|
- spec/views/pugin/layouts/_layout.html.haml_spec.rb
|
393
398
|
- spec/views/pugin/cards/_person-list.html.haml_spec.rb
|