consul 0.11.0 → 0.11.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.
- data/.gitignore +1 -0
- data/.travis.yml +1 -0
- data/Rakefile +3 -1
- data/lib/consul/errors.rb +1 -0
- data/lib/consul/power.rb +22 -2
- data/lib/consul/power/dynamic_access.rb +4 -4
- data/lib/consul/version.rb +1 -1
- data/spec/rails-2.3/Gemfile +1 -2
- data/spec/rails-2.3/Gemfile.lock +1 -11
- data/spec/rails-3.0/Gemfile +1 -2
- data/spec/rails-3.0/Gemfile.lock +2 -12
- data/spec/rails-3.0/spec/spec_helper.rb +1 -1
- data/spec/rails-3.2/Gemfile +1 -2
- data/spec/rails-3.2/Gemfile.lock +2 -12
- data/spec/rails-3.2/spec/spec_helper.rb +1 -1
- metadata +4 -4
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/Rakefile
CHANGED
@@ -31,7 +31,9 @@ namespace :all do
|
|
31
31
|
desc "Bundle all spec apps"
|
32
32
|
task :bundle do
|
33
33
|
for_each_directory_of('spec/**/Gemfile') do |directory|
|
34
|
-
|
34
|
+
Bundler.with_clean_env do
|
35
|
+
system("cd #{directory} && bundle install")
|
36
|
+
end
|
35
37
|
end
|
36
38
|
end
|
37
39
|
|
data/lib/consul/errors.rb
CHANGED
data/lib/consul/power.rb
CHANGED
@@ -59,6 +59,12 @@ module Consul
|
|
59
59
|
# spy for tests
|
60
60
|
end
|
61
61
|
|
62
|
+
def singularize_power_name(name)
|
63
|
+
self.class.singularize_power_name(name)
|
64
|
+
end
|
65
|
+
|
66
|
+
|
67
|
+
|
62
68
|
module ClassMethods
|
63
69
|
include Consul::Power::DynamicAccess::ClassMethods
|
64
70
|
|
@@ -108,8 +114,12 @@ module Consul
|
|
108
114
|
else
|
109
115
|
define_method(name, &block)
|
110
116
|
define_query_and_bang_methods(name) { |*args| default_include_power?(name, *args) }
|
111
|
-
|
112
|
-
|
117
|
+
begin
|
118
|
+
singular = singularize_power_name(name)
|
119
|
+
define_query_and_bang_methods(singular) { |*args| default_include_object?(name, *args) }
|
120
|
+
rescue Consul::PowerNotSingularizable
|
121
|
+
# We do not define singularized power methods if it would
|
122
|
+
# override the collection method
|
113
123
|
end
|
114
124
|
ids_method = power_ids_name(name)
|
115
125
|
define_method(ids_method) { |*args| default_power_ids(name, *args) }
|
@@ -118,6 +128,16 @@ module Consul
|
|
118
128
|
name
|
119
129
|
end
|
120
130
|
|
131
|
+
def singularize_power_name(name)
|
132
|
+
name = name.to_s
|
133
|
+
singularized = name.singularize
|
134
|
+
if singularized == name
|
135
|
+
raise Consul::PowerNotSingularizable, "Power name can not have an singular form: #{name}"
|
136
|
+
else
|
137
|
+
singularized
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
121
141
|
end
|
122
142
|
end
|
123
143
|
end
|
@@ -5,7 +5,7 @@ module Consul
|
|
5
5
|
module InstanceMethods
|
6
6
|
|
7
7
|
def include?(power_name, *args)
|
8
|
-
warn "#include?
|
8
|
+
warn "makandra/consul: #include? is deprececated. Use #include_power? and #include_object? instead."
|
9
9
|
if args.size == 0
|
10
10
|
include_power?(power_name, *args)
|
11
11
|
else
|
@@ -14,7 +14,7 @@ module Consul
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def include!(power_name, *args)
|
17
|
-
warn "#include!
|
17
|
+
warn "makandra/consul: #include! is deprececated. Use #include_power! and #include_object! instead."
|
18
18
|
if args.size == 0
|
19
19
|
include_power!(power_name, *args)
|
20
20
|
else
|
@@ -32,12 +32,12 @@ module Consul
|
|
32
32
|
|
33
33
|
def include_object?(power_name, *context_and_object)
|
34
34
|
power_name = power_name.to_s
|
35
|
-
send("#{power_name
|
35
|
+
send("#{singularize_power_name(power_name)}?", *context_and_object)
|
36
36
|
end
|
37
37
|
|
38
38
|
def include_object!(power_name, *context_and_object)
|
39
39
|
power_name = power_name.to_s
|
40
|
-
send("#{power_name
|
40
|
+
send("#{singularize_power_name(power_name)}!", *context_and_object)
|
41
41
|
end
|
42
42
|
|
43
43
|
def for_record(*args)
|
data/lib/consul/version.rb
CHANGED
data/spec/rails-2.3/Gemfile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
source
|
1
|
+
source 'https://rubygems.org'
|
2
2
|
|
3
3
|
gem 'assignable_values'
|
4
4
|
gem 'rails', '~>2.3'
|
@@ -7,7 +7,6 @@ gem 'rspec-rails', '~>1.3'
|
|
7
7
|
gem 'shoulda-matchers', '<2'
|
8
8
|
gem 'sqlite3'
|
9
9
|
gem 'rspec_candy'
|
10
|
-
gem 'ruby-debug', :platforms => :mri_18
|
11
10
|
gem 'test-unit', '~>1.2', :platforms => :ruby_19
|
12
11
|
gem 'hoe', '=2.8.0', :platforms => :ruby_19
|
13
12
|
|
data/spec/rails-2.3/Gemfile.lock
CHANGED
@@ -7,7 +7,7 @@ PATH
|
|
7
7
|
rails
|
8
8
|
|
9
9
|
GEM
|
10
|
-
remote:
|
10
|
+
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
12
|
actionmailer (2.3.18)
|
13
13
|
actionpack (= 2.3.18)
|
@@ -21,13 +21,10 @@ GEM
|
|
21
21
|
activesupport (2.3.18)
|
22
22
|
assignable_values (0.7.1)
|
23
23
|
activerecord
|
24
|
-
columnize (0.3.6)
|
25
24
|
edge_rider (0.2.3)
|
26
25
|
activerecord
|
27
26
|
hoe (2.8.0)
|
28
27
|
rake (>= 0.8.7)
|
29
|
-
linecache (0.46)
|
30
|
-
rbx-require-relative (> 0.0.4)
|
31
28
|
memoizer (1.0.1)
|
32
29
|
rack (1.1.6)
|
33
30
|
rails (2.3.18)
|
@@ -38,7 +35,6 @@ GEM
|
|
38
35
|
activesupport (= 2.3.18)
|
39
36
|
rake (>= 0.8.3)
|
40
37
|
rake (10.0.4)
|
41
|
-
rbx-require-relative (0.0.9)
|
42
38
|
rspec (1.3.2)
|
43
39
|
rspec-rails (1.3.4)
|
44
40
|
rack (>= 1.0.0)
|
@@ -46,11 +42,6 @@ GEM
|
|
46
42
|
rspec_candy (0.2.9)
|
47
43
|
rspec
|
48
44
|
sneaky-save
|
49
|
-
ruby-debug (0.10.4)
|
50
|
-
columnize (>= 0.1)
|
51
|
-
ruby-debug-base (~> 0.10.4.0)
|
52
|
-
ruby-debug-base (0.10.4)
|
53
|
-
linecache (>= 0.3)
|
54
45
|
shoulda-matchers (1.0.0)
|
55
46
|
sneaky-save (0.0.2)
|
56
47
|
activerecord (>= 2.3.2)
|
@@ -69,7 +60,6 @@ DEPENDENCIES
|
|
69
60
|
rspec (~> 1.3)
|
70
61
|
rspec-rails (~> 1.3)
|
71
62
|
rspec_candy
|
72
|
-
ruby-debug
|
73
63
|
shoulda-matchers (< 2)
|
74
64
|
sqlite3
|
75
65
|
test-unit (~> 1.2)
|
data/spec/rails-3.0/Gemfile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
source
|
1
|
+
source 'https://rubygems.org'
|
2
2
|
|
3
3
|
gem 'assignable_values'
|
4
4
|
gem 'rails', '~>3.0.17'
|
@@ -7,6 +7,5 @@ gem 'rspec-rails'
|
|
7
7
|
gem 'shoulda-matchers', '<2'
|
8
8
|
gem 'sqlite3'
|
9
9
|
gem 'rspec_candy'
|
10
|
-
gem 'ruby-debug', :platforms => :mri_18
|
11
10
|
|
12
11
|
gem 'consul', :path => '../..'
|
data/spec/rails-3.0/Gemfile.lock
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../..
|
3
3
|
specs:
|
4
|
-
consul (0.
|
4
|
+
consul (0.11.0)
|
5
5
|
edge_rider
|
6
6
|
memoizer
|
7
7
|
rails
|
8
8
|
|
9
9
|
GEM
|
10
|
-
remote:
|
10
|
+
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
12
|
abstract (1.0.0)
|
13
13
|
actionmailer (3.0.20)
|
@@ -42,7 +42,6 @@ GEM
|
|
42
42
|
bourne (1.4.0)
|
43
43
|
mocha (~> 0.13.2)
|
44
44
|
builder (2.1.2)
|
45
|
-
columnize (0.3.6)
|
46
45
|
diff-lcs (1.2.4)
|
47
46
|
edge_rider (0.2.3)
|
48
47
|
activerecord
|
@@ -50,8 +49,6 @@ GEM
|
|
50
49
|
abstract (>= 1.0.0)
|
51
50
|
i18n (0.5.0)
|
52
51
|
json (1.8.0)
|
53
|
-
linecache (0.46)
|
54
|
-
rbx-require-relative (> 0.0.4)
|
55
52
|
mail (2.2.20)
|
56
53
|
activesupport (>= 2.3.6)
|
57
54
|
i18n (>= 0.4.0)
|
@@ -83,7 +80,6 @@ GEM
|
|
83
80
|
rdoc (~> 3.4)
|
84
81
|
thor (~> 0.14.4)
|
85
82
|
rake (10.0.4)
|
86
|
-
rbx-require-relative (0.0.9)
|
87
83
|
rdoc (3.12.2)
|
88
84
|
json (~> 1.4)
|
89
85
|
rspec (2.13.0)
|
@@ -104,11 +100,6 @@ GEM
|
|
104
100
|
rspec_candy (0.2.9)
|
105
101
|
rspec
|
106
102
|
sneaky-save
|
107
|
-
ruby-debug (0.10.4)
|
108
|
-
columnize (>= 0.1)
|
109
|
-
ruby-debug-base (~> 0.10.4.0)
|
110
|
-
ruby-debug-base (0.10.4)
|
111
|
-
linecache (>= 0.3)
|
112
103
|
shoulda-matchers (1.5.6)
|
113
104
|
activesupport (>= 3.0.0)
|
114
105
|
bourne (~> 1.3)
|
@@ -131,6 +122,5 @@ DEPENDENCIES
|
|
131
122
|
rspec
|
132
123
|
rspec-rails
|
133
124
|
rspec_candy
|
134
|
-
ruby-debug
|
135
125
|
shoulda-matchers (< 2)
|
136
126
|
sqlite3
|
@@ -4,7 +4,7 @@ $: << File.join(File.dirname(__FILE__), "/../../lib" )
|
|
4
4
|
ENV['RAILS_ENV'] ||= 'test'
|
5
5
|
ENV['RAILS_ROOT'] = 'app_root'
|
6
6
|
|
7
|
-
FileUtils.rm(Dir.glob("db/*.db"), :force => true)
|
7
|
+
FileUtils.rm(Dir.glob("app_root/db/*.db"), :force => true)
|
8
8
|
|
9
9
|
# Load the Rails environment and testing framework
|
10
10
|
require "#{File.dirname(__FILE__)}/../app_root/config/environment"
|
data/spec/rails-3.2/Gemfile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
source
|
1
|
+
source 'https://rubygems.org'
|
2
2
|
|
3
3
|
gem 'assignable_values'
|
4
4
|
gem 'rails', '~>3.2.0'
|
@@ -7,6 +7,5 @@ gem 'rspec-rails'
|
|
7
7
|
gem 'shoulda-matchers', '<2'
|
8
8
|
gem 'sqlite3'
|
9
9
|
gem 'rspec_candy'
|
10
|
-
gem 'ruby-debug', :platforms => :mri_18
|
11
10
|
|
12
11
|
gem 'consul', :path => '../..'
|
data/spec/rails-3.2/Gemfile.lock
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../..
|
3
3
|
specs:
|
4
|
-
consul (0.
|
4
|
+
consul (0.11.0)
|
5
5
|
edge_rider
|
6
6
|
memoizer
|
7
7
|
rails
|
8
8
|
|
9
9
|
GEM
|
10
|
-
remote:
|
10
|
+
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
12
|
actionmailer (3.2.13)
|
13
13
|
actionpack (= 3.2.13)
|
@@ -42,7 +42,6 @@ GEM
|
|
42
42
|
bourne (1.4.0)
|
43
43
|
mocha (~> 0.13.2)
|
44
44
|
builder (3.0.4)
|
45
|
-
columnize (0.3.6)
|
46
45
|
diff-lcs (1.2.4)
|
47
46
|
edge_rider (0.2.3)
|
48
47
|
activerecord
|
@@ -51,8 +50,6 @@ GEM
|
|
51
50
|
i18n (0.6.1)
|
52
51
|
journey (1.0.4)
|
53
52
|
json (1.8.0)
|
54
|
-
linecache (0.46)
|
55
|
-
rbx-require-relative (> 0.0.4)
|
56
53
|
mail (2.5.4)
|
57
54
|
mime-types (~> 1.16)
|
58
55
|
treetop (~> 1.4.8)
|
@@ -86,7 +83,6 @@ GEM
|
|
86
83
|
rdoc (~> 3.4)
|
87
84
|
thor (>= 0.14.6, < 2.0)
|
88
85
|
rake (10.0.4)
|
89
|
-
rbx-require-relative (0.0.9)
|
90
86
|
rdoc (3.12.2)
|
91
87
|
json (~> 1.4)
|
92
88
|
rspec (2.13.0)
|
@@ -107,11 +103,6 @@ GEM
|
|
107
103
|
rspec_candy (0.2.9)
|
108
104
|
rspec
|
109
105
|
sneaky-save
|
110
|
-
ruby-debug (0.10.4)
|
111
|
-
columnize (>= 0.1)
|
112
|
-
ruby-debug-base (~> 0.10.4.0)
|
113
|
-
ruby-debug-base (0.10.4)
|
114
|
-
linecache (>= 0.3)
|
115
106
|
shoulda-matchers (1.5.6)
|
116
107
|
activesupport (>= 3.0.0)
|
117
108
|
bourne (~> 1.3)
|
@@ -140,6 +131,5 @@ DEPENDENCIES
|
|
140
131
|
rspec
|
141
132
|
rspec-rails
|
142
133
|
rspec_candy
|
143
|
-
ruby-debug
|
144
134
|
shoulda-matchers (< 2)
|
145
135
|
sqlite3
|
@@ -3,7 +3,7 @@ $: << File.join(File.dirname(__FILE__), "/../../lib" )
|
|
3
3
|
ENV['RAILS_ENV'] ||= 'test'
|
4
4
|
ENV['RAILS_ROOT'] = 'app_root'
|
5
5
|
|
6
|
-
FileUtils.rm(Dir.glob("db/*.db"), :force => true)
|
6
|
+
FileUtils.rm(Dir.glob("app_root/db/*.db"), :force => true)
|
7
7
|
|
8
8
|
# Load the Rails environment and testing framework
|
9
9
|
require "#{File.dirname(__FILE__)}/../app_root/config/environment"
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: consul
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 49
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 11
|
9
|
-
-
|
10
|
-
version: 0.11.
|
9
|
+
- 1
|
10
|
+
version: 0.11.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Henning Koch
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2014-02-20 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|