blue_print 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/blue_print/context.rb +4 -3
- data/lib/blue_print/environment.rb +2 -1
- data/lib/blue_print/version.rb +1 -1
- data/spec/lib/blue_print/context_spec.rb +8 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cffa5deccd7b54684a2f9f68c47a230e82941371
|
4
|
+
data.tar.gz: 876910ce766e6f29ede2d1fd254fc1f1ddd786dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a5f7f41a4099403accdb80b2f6419de88dd474abe30ca8d8b9e22920c6bb821531e1c45bd080491c687966e2723fc57e6fa1564bba32d895a9c0c6d62836289
|
7
|
+
data.tar.gz: 15b15f4eb73607016afc2255689ae58e726165cf5063c68d4719e7dcb5009efb45e712eb800b8a574dabd62e8032e2dfae6163e9167ba7bdac5e2dbf92b4f985
|
data/lib/blue_print/context.rb
CHANGED
@@ -37,9 +37,10 @@ class BluePrint::Context
|
|
37
37
|
|
38
38
|
action!
|
39
39
|
|
40
|
-
BluePrint.env[context_name] =
|
41
|
-
memo
|
42
|
-
|
40
|
+
BluePrint.env[context_name] =
|
41
|
+
!!active_ifs.inject(active_ifs.first.try(:active?)) do |memo, active_if|
|
42
|
+
memo && active_if.active?
|
43
|
+
end
|
43
44
|
end
|
44
45
|
|
45
46
|
def self.deactive?
|
data/lib/blue_print/version.rb
CHANGED
@@ -73,6 +73,14 @@ describe BluePrint::Context do
|
|
73
73
|
it { should be_false }
|
74
74
|
end
|
75
75
|
|
76
|
+
context 'only always active' do
|
77
|
+
before do
|
78
|
+
context.active_if(always_active)
|
79
|
+
end
|
80
|
+
|
81
|
+
it { should be_true }
|
82
|
+
end
|
83
|
+
|
76
84
|
context 'with empty' do
|
77
85
|
it { should be_false }
|
78
86
|
end
|