bowtie-io 1.3.4 → 1.3.5

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: 09d1663d62a33d7f9227556fa5267e48f3393dca
4
- data.tar.gz: b3f75a5eebb76798b44a2e1fa61cd65b459e8afb
3
+ metadata.gz: 7e72bbf8a5ab9d5dd6b4a137fc2b59f1b324f51e
4
+ data.tar.gz: f6b35e5449efabf45da2458ff7acf48ed1578cc5
5
5
  SHA512:
6
- metadata.gz: 8343a28c83a7c26194f5b83f35d98dc5fd4a6b40342287eb67a82c9de1683805047fd1759a5228c1d0daef0ada775a53af1bce90c78cad5b7da31f8f0337ce21
7
- data.tar.gz: 22e61ab0e09645a86a1a632e22199eed8924a49eb178b52bdb90a6036ad9ce04a1a3cff61974af2358be4929ee7ffc29615d4d66448e11856260f886decfc2fb
6
+ metadata.gz: 61e3284cb488a17cb51b704515b5a454b7382c059ce00e6641b4182e2350fef54f11a37c99b72deb9cd3a3edbef8e028220e9fb4a40fcb94d071570858cb3e40
7
+ data.tar.gz: 42f1225f4a1d279227c8374f1464707411bbf4895ccc7de776edc266edff94337a0616151c7cb713307d601f1826ab86413c4d2c2805bc7bdc07c921767babed
@@ -50,8 +50,6 @@ module Bowtie::Middleware
50
50
  CONFIG_PROFILE_KEY = 'profile'
51
51
  CONFIG_STATUS_KEY = 'status'
52
52
 
53
- def branch; 'development' end
54
-
55
53
  def policy_records(source)
56
54
  records = Dir["#{source}/**/.bowtie.yml"].collect { |path|
57
55
  policy_records_for_path(path.gsub(source, ''), File.read(path))
@@ -63,8 +61,7 @@ module Bowtie::Middleware
63
61
  end
64
62
 
65
63
  def default_permit_all
66
- Policy.new(branch,
67
- '',
64
+ Policy.new('',
68
65
  nil,
69
66
  nil,
70
67
  0,
@@ -76,9 +73,9 @@ module Bowtie::Middleware
76
73
  base_path = "/#{base_path}" unless base_path.start_with? '/'
77
74
  base_path = base_path[0..-2] if base_path.end_with? '/'
78
75
 
79
- branch_config = YAML.load(content)[branch] || {}
76
+ environment_config = YAML.load(content) || {}
80
77
 
81
- permitted_section_configs = branch_config[CONFIG_BLOCK_KEY] || []
78
+ permitted_section_configs = environment_config[CONFIG_BLOCK_KEY] || []
82
79
  permitted_section_configs = [permitted_section_configs] unless permitted_section_configs.is_a? Array
83
80
 
84
81
  policy_records_from_permitted_section_configs(base_path, permitted_section_configs)
@@ -109,8 +106,7 @@ module Bowtie::Middleware
109
106
 
110
107
  methods.each do |method|
111
108
  plans.each do |plan|
112
- records << Policy.new(branch,
113
- policy_path,
109
+ records << Policy.new(policy_path,
114
110
  method,
115
111
  plan,
116
112
  policy_path.length,
@@ -167,8 +163,7 @@ module Bowtie::Middleware
167
163
  end
168
164
  end
169
165
 
170
- Policy = Struct.new(:branch,
171
- :path,
166
+ Policy = Struct.new(:path,
172
167
  :request_method,
173
168
  :plan,
174
169
  :weight,
@@ -194,8 +189,7 @@ module Bowtie::Middleware
194
189
 
195
190
  def applicable_for(rack_request)
196
191
  applicable_to_request = all.select { |policy|
197
- policy.branch == 'development' &&
198
- rack_request.path.start_with?(policy.path)
192
+ rack_request.path.start_with?(policy.path)
199
193
  }.sort_by!(&:weight).reverse
200
194
 
201
195
  heaviest = applicable_to_request.first
@@ -1,3 +1,3 @@
1
1
  module Bowtie
2
- VERSION = '1.3.4'
2
+ VERSION = '1.3.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bowtie-io
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.4
4
+ version: 1.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Kassemi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-28 00:00:00.000000000 Z
11
+ date: 2016-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll