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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3c548622e35b491381ce58dcb9ae08dda61f0397
4
- data.tar.gz: 55752678a2d5cfb9a1a2fcfbbb7ed087e9159b9a
3
+ metadata.gz: cffa5deccd7b54684a2f9f68c47a230e82941371
4
+ data.tar.gz: 876910ce766e6f29ede2d1fd254fc1f1ddd786dd
5
5
  SHA512:
6
- metadata.gz: a418665ce91d0fe292cc57ed2aa9a065b61e666ccd193f8c3331e3c01c9676a65400fbf6ee8fa7e2293e88a0cb2e4c0f09b231977bd99054fb84e29caf50708b
7
- data.tar.gz: f26de505f6974276e02c6daa0c25abaa8886a01761040498fc8416c353df14948c34ff69cf404f7492c1d67c5303d9900bba4ba8243db1a1612dd9a4f11f0aca
6
+ metadata.gz: 8a5f7f41a4099403accdb80b2f6419de88dd474abe30ca8d8b9e22920c6bb821531e1c45bd080491c687966e2723fc57e6fa1564bba32d895a9c0c6d62836289
7
+ data.tar.gz: 15b15f4eb73607016afc2255689ae58e726165cf5063c68d4719e7dcb5009efb45e712eb800b8a574dabd62e8032e2dfae6163e9167ba7bdac5e2dbf92b4f985
@@ -37,9 +37,10 @@ class BluePrint::Context
37
37
 
38
38
  action!
39
39
 
40
- BluePrint.env[context_name] = !!active_ifs.reduce do |memo, active_if|
41
- memo && active_if.active?
42
- end
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?
@@ -2,7 +2,8 @@ require 'hashie'
2
2
  require 'blue_print'
3
3
 
4
4
  class BluePrint::Environment < Hashie::Mash
5
- def initialize(context)
5
+ def initialize(context, default = nil)
6
+ super({}, default)
6
7
  @context = context
7
8
  end
8
9
 
@@ -1,3 +1,3 @@
1
1
  module BluePrint
2
- VERSION = '1.1.1'
2
+ VERSION = '1.1.2'
3
3
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blue_print
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sho Kusano