consul 0.12.0 → 0.12.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of consul might be problematic. Click here for more details.

@@ -78,14 +78,16 @@ module Consul
78
78
  "#{name.to_s.singularize}_ids"
79
79
  end
80
80
 
81
- THREAD_KEY = :'Power.current'
81
+ def self.thread_key(klass)
82
+ "consul|#{klass.to_s}.current"
83
+ end
82
84
 
83
85
  def current
84
- Thread.current[THREAD_KEY]
86
+ Thread.current[ClassMethods.thread_key(self)]
85
87
  end
86
88
 
87
89
  def current=(power)
88
- Thread.current[THREAD_KEY] = power
90
+ Thread.current[ClassMethods.thread_key(self)] = power
89
91
  end
90
92
 
91
93
  def with_power(inner_power, &block)
@@ -18,9 +18,11 @@ module Consul
18
18
  "expected #{@controller_class} to check against power #{@expected_args.inspect} but it checked against #{@actual_args.inspect}"
19
19
  end
20
20
 
21
- def negative_failure_message
21
+ def failure_message_when_negated
22
22
  "expected #{@controller_class} to not check against power #{@expected_args.inspect}"
23
23
  end
24
+ # Compatibility for older rspec versions
25
+ alias_method :negative_failure_message, :failure_message_when_negated
24
26
 
25
27
  def description
26
28
  description = "check against power #{@expected_args.inspect}"
@@ -1,3 +1,3 @@
1
1
  module Consul
2
- VERSION = '0.12.0'
2
+ VERSION = '0.12.1'
3
3
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- consul (0.12.0)
4
+ consul (0.12.1)
5
5
  edge_rider (>= 0.3.0)
6
6
  memoizer
7
7
  rails
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- consul (0.12.0)
4
+ consul (0.12.1)
5
5
  edge_rider (>= 0.3.0)
6
6
  memoizer
7
7
  rails
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- consul (0.12.0)
4
+ consul (0.12.1)
5
5
  edge_rider (>= 0.3.0)
6
6
  memoizer
7
7
  rails
@@ -468,6 +468,18 @@ describe Consul::Power do
468
468
  Power.current.should be_nil
469
469
  end
470
470
 
471
+ it 'should keep multiple powers separated' do
472
+ FrontendPower = Class.new(Power)
473
+ BackendPower = Class.new(Power)
474
+ frontend_power = FrontendPower.new
475
+ backend_power = BackendPower.new
476
+ FrontendPower.current = frontend_power
477
+ BackendPower.current = backend_power
478
+
479
+ FrontendPower.current.should == frontend_power
480
+ BackendPower.current.should == backend_power
481
+ end
482
+
471
483
  end
472
484
 
473
485
  describe '.with_power' do
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: consul
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henning Koch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-16 00:00:00.000000000 Z
11
+ date: 2015-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: memoizer
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rails
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: edge_rider
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: 0.3.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.3.0
55
55
  description: A scope-based authorization solution for Ruby on Rails.
@@ -58,8 +58,8 @@ executables: []
58
58
  extensions: []
59
59
  extra_rdoc_files: []
60
60
  files:
61
- - .gitignore
62
- - .travis.yml
61
+ - ".gitignore"
62
+ - ".travis.yml"
63
63
  - LICENSE
64
64
  - README.md
65
65
  - Rakefile
@@ -200,134 +200,18 @@ require_paths:
200
200
  - lib
201
201
  required_ruby_version: !ruby/object:Gem::Requirement
202
202
  requirements:
203
- - - ! '>='
203
+ - - ">="
204
204
  - !ruby/object:Gem::Version
205
205
  version: '0'
206
206
  required_rubygems_version: !ruby/object:Gem::Requirement
207
207
  requirements:
208
- - - ! '>='
208
+ - - ">="
209
209
  - !ruby/object:Gem::Version
210
210
  version: '0'
211
211
  requirements: []
212
212
  rubyforge_project:
213
- rubygems_version: 2.2.1
213
+ rubygems_version: 2.2.2
214
214
  signing_key:
215
215
  specification_version: 4
216
216
  summary: A scope-based authorization solution for Ruby on Rails.
217
- test_files:
218
- - spec/rails-2.3/Gemfile
219
- - spec/rails-2.3/Gemfile.lock
220
- - spec/rails-2.3/Rakefile
221
- - spec/rails-2.3/app_root/config/boot.rb
222
- - spec/rails-2.3/app_root/config/database.yml
223
- - spec/rails-2.3/app_root/config/environment.rb
224
- - spec/rails-2.3/app_root/config/environments/in_memory.rb
225
- - spec/rails-2.3/app_root/config/environments/mysql.rb
226
- - spec/rails-2.3/app_root/config/environments/postgresql.rb
227
- - spec/rails-2.3/app_root/config/environments/sqlite.rb
228
- - spec/rails-2.3/app_root/config/environments/sqlite3.rb
229
- - spec/rails-2.3/app_root/config/initializers/fix_missing_source_file.rb
230
- - spec/rails-2.3/app_root/config/preinitializer.rb
231
- - spec/rails-2.3/app_root/config/routes.rb
232
- - spec/rails-2.3/app_root/log/.gitignore
233
- - spec/rails-2.3/rcov.opts
234
- - spec/rails-2.3/spec.opts
235
- - spec/rails-2.3/spec/spec_helper.rb
236
- - spec/rails-3.0/.rspec
237
- - spec/rails-3.0/Gemfile
238
- - spec/rails-3.0/Gemfile.lock
239
- - spec/rails-3.0/Rakefile
240
- - spec/rails-3.0/app_root/.gitignore
241
- - spec/rails-3.0/app_root/config/application.rb
242
- - spec/rails-3.0/app_root/config/boot.rb
243
- - spec/rails-3.0/app_root/config/database.yml
244
- - spec/rails-3.0/app_root/config/environment.rb
245
- - spec/rails-3.0/app_root/config/environments/test.rb
246
- - spec/rails-3.0/app_root/config/initializers/backtrace_silencers.rb
247
- - spec/rails-3.0/app_root/config/initializers/inflections.rb
248
- - spec/rails-3.0/app_root/config/initializers/mime_types.rb
249
- - spec/rails-3.0/app_root/config/initializers/secret_token.rb
250
- - spec/rails-3.0/app_root/config/initializers/session_store.rb
251
- - spec/rails-3.0/app_root/config/routes.rb
252
- - spec/rails-3.0/app_root/lib/tasks/.gitkeep
253
- - spec/rails-3.0/app_root/log/.gitkeep
254
- - spec/rails-3.0/app_root/script/rails
255
- - spec/rails-3.0/rcov.opts
256
- - spec/rails-3.0/spec/spec_helper.rb
257
- - spec/rails-3.2/.rspec
258
- - spec/rails-3.2/Gemfile
259
- - spec/rails-3.2/Gemfile.lock
260
- - spec/rails-3.2/Rakefile
261
- - spec/rails-3.2/app_root/.gitignore
262
- - spec/rails-3.2/app_root/config/application.rb
263
- - spec/rails-3.2/app_root/config/boot.rb
264
- - spec/rails-3.2/app_root/config/database.yml
265
- - spec/rails-3.2/app_root/config/environment.rb
266
- - spec/rails-3.2/app_root/config/environments/test.rb
267
- - spec/rails-3.2/app_root/config/initializers/backtrace_silencers.rb
268
- - spec/rails-3.2/app_root/config/initializers/inflections.rb
269
- - spec/rails-3.2/app_root/config/initializers/mime_types.rb
270
- - spec/rails-3.2/app_root/config/initializers/secret_token.rb
271
- - spec/rails-3.2/app_root/config/initializers/session_store.rb
272
- - spec/rails-3.2/app_root/config/routes.rb
273
- - spec/rails-3.2/app_root/log/.gitignore
274
- - spec/rails-3.2/rcov.opts
275
- - spec/rails-3.2/spec/spec_helper.rb
276
- - spec/rails-4.1/.rspec
277
- - spec/rails-4.1/Gemfile
278
- - spec/rails-4.1/Gemfile.lock
279
- - spec/rails-4.1/Rakefile
280
- - spec/rails-4.1/app_root/.gitignore
281
- - spec/rails-4.1/app_root/bin/bundle
282
- - spec/rails-4.1/app_root/bin/rails
283
- - spec/rails-4.1/app_root/bin/rake
284
- - spec/rails-4.1/app_root/bin/spring
285
- - spec/rails-4.1/app_root/config/application.rb
286
- - spec/rails-4.1/app_root/config/boot.rb
287
- - spec/rails-4.1/app_root/config/database.yml
288
- - spec/rails-4.1/app_root/config/environment.rb
289
- - spec/rails-4.1/app_root/config/environments/development.rb
290
- - spec/rails-4.1/app_root/config/environments/production.rb
291
- - spec/rails-4.1/app_root/config/environments/test.rb
292
- - spec/rails-4.1/app_root/config/initializers/backtrace_silencers.rb
293
- - spec/rails-4.1/app_root/config/initializers/cookies_serializer.rb
294
- - spec/rails-4.1/app_root/config/initializers/filter_parameter_logging.rb
295
- - spec/rails-4.1/app_root/config/initializers/inflections.rb
296
- - spec/rails-4.1/app_root/config/initializers/mime_types.rb
297
- - spec/rails-4.1/app_root/config/initializers/session_store.rb
298
- - spec/rails-4.1/app_root/config/initializers/wrap_parameters.rb
299
- - spec/rails-4.1/app_root/config/locales/en.yml
300
- - spec/rails-4.1/app_root/config/routes.rb
301
- - spec/rails-4.1/app_root/config/secrets.yml
302
- - spec/rails-4.1/log/test.log
303
- - spec/rails-4.1/rcov.opts
304
- - spec/rails-4.1/spec/spec_helper.rb
305
- - spec/shared/app_root/app/controllers/application_controller.rb
306
- - spec/shared/app_root/app/controllers/cakes_controller.rb
307
- - spec/shared/app_root/app/controllers/client_notes_controller.rb
308
- - spec/shared/app_root/app/controllers/colors_controller.rb
309
- - spec/shared/app_root/app/controllers/dashboards_controller.rb
310
- - spec/shared/app_root/app/controllers/risks_controller.rb
311
- - spec/shared/app_root/app/controllers/songs_controller.rb
312
- - spec/shared/app_root/app/controllers/users_controller.rb
313
- - spec/shared/app_root/app/models/client.rb
314
- - spec/shared/app_root/app/models/deal.rb
315
- - spec/shared/app_root/app/models/deal/item.rb
316
- - spec/shared/app_root/app/models/note.rb
317
- - spec/shared/app_root/app/models/power.rb
318
- - spec/shared/app_root/app/models/song.rb
319
- - spec/shared/app_root/app/models/user.rb
320
- - spec/shared/app_root/db/migrate/001_create_users.rb
321
- - spec/shared/app_root/db/migrate/002_create_clients.rb
322
- - spec/shared/app_root/db/migrate/003_create_notes.rb
323
- - spec/shared/app_root/db/migrate/004_create_songs.rb
324
- - spec/shared/consul/active_record_spec.rb
325
- - spec/shared/consul/controllers/cakes_controller_spec.rb
326
- - spec/shared/consul/controllers/client_notes_controller_spec.rb
327
- - spec/shared/consul/controllers/colors_controller_spec.rb
328
- - spec/shared/consul/controllers/dashboards_controller_spec.rb
329
- - spec/shared/consul/controllers/risks_controller_spec.rb
330
- - spec/shared/consul/controllers/songs_controller_spec.rb
331
- - spec/shared/consul/controllers/users_controller_spec.rb
332
- - spec/shared/consul/power_spec.rb
333
- - spec/shared/consul/util_spec.rb
217
+ test_files: []