rest_model 0.1.10 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rest_model/version.rb +1 -1
- data/lib/rest_model.rb +0 -5
- data/spec/unit/rest_model_spec.rb +0 -28
- metadata +14 -14
data/lib/rest_model/version.rb
CHANGED
data/lib/rest_model.rb
CHANGED
@@ -94,11 +94,6 @@ class RestModel
|
|
94
94
|
@convert_input_keys
|
95
95
|
end
|
96
96
|
|
97
|
-
def self.method_added(method_name)
|
98
|
-
return unless not_allowed_names.include?(method_name.to_s)
|
99
|
-
puts "warning: redefining '#{method_name}' may cause serious problems"
|
100
|
-
end
|
101
|
-
|
102
97
|
def self.not_allowed_names
|
103
98
|
%w(resource_id resource link)
|
104
99
|
end
|
@@ -15,32 +15,4 @@ describe RestModel do
|
|
15
15
|
example.resource.should == {login: 'jackiechan2010', name: 'Jackie Chan', age: 45}
|
16
16
|
end
|
17
17
|
end
|
18
|
-
|
19
|
-
context "when using not allowed names" do
|
20
|
-
[:resource_id, :resource, :link].each do |unallowed|
|
21
|
-
it "warns when method #{unallowed} is redefined" do
|
22
|
-
output = out do
|
23
|
-
eval <<-RUBY
|
24
|
-
class Example < RestModel
|
25
|
-
def #{unallowed}
|
26
|
-
end
|
27
|
-
end
|
28
|
-
RUBY
|
29
|
-
end
|
30
|
-
output.should =~ /^warning: redefining '#{unallowed}' may cause serious problems/
|
31
|
-
end
|
32
|
-
|
33
|
-
%w(property embeds_one embeds_many has_one has_many belongs_to).each do |kind|
|
34
|
-
it "removes method #{unallowed} created by #{kind}" do
|
35
|
-
expect {
|
36
|
-
eval <<-RUBY
|
37
|
-
class Example < RestModel
|
38
|
-
#{kind} :#{unallowed}
|
39
|
-
end
|
40
|
-
RUBY
|
41
|
-
}.to raise_error "you can't define a key with name '#{unallowed}'"
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
18
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rest_model
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.11
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,11 +11,11 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2011-11-
|
14
|
+
date: 2011-11-10 00:00:00.000000000Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activesupport
|
18
|
-
requirement: &
|
18
|
+
requirement: &70225631314800 !ruby/object:Gem::Requirement
|
19
19
|
none: false
|
20
20
|
requirements:
|
21
21
|
- - ~>
|
@@ -23,10 +23,10 @@ dependencies:
|
|
23
23
|
version: '3.0'
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
|
-
version_requirements: *
|
26
|
+
version_requirements: *70225631314800
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: i18n
|
29
|
-
requirement: &
|
29
|
+
requirement: &70225631314220 !ruby/object:Gem::Requirement
|
30
30
|
none: false
|
31
31
|
requirements:
|
32
32
|
- - ! '>='
|
@@ -34,10 +34,10 @@ dependencies:
|
|
34
34
|
version: '0.5'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
|
-
version_requirements: *
|
37
|
+
version_requirements: *70225631314220
|
38
38
|
- !ruby/object:Gem::Dependency
|
39
39
|
name: rspec
|
40
|
-
requirement: &
|
40
|
+
requirement: &70225631313740 !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
42
42
|
requirements:
|
43
43
|
- - ~>
|
@@ -45,10 +45,10 @@ dependencies:
|
|
45
45
|
version: '2.6'
|
46
46
|
type: :development
|
47
47
|
prerelease: false
|
48
|
-
version_requirements: *
|
48
|
+
version_requirements: *70225631313740
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
50
|
name: guard
|
51
|
-
requirement: &
|
51
|
+
requirement: &70225631313260 !ruby/object:Gem::Requirement
|
52
52
|
none: false
|
53
53
|
requirements:
|
54
54
|
- - ~>
|
@@ -56,10 +56,10 @@ dependencies:
|
|
56
56
|
version: '0.5'
|
57
57
|
type: :development
|
58
58
|
prerelease: false
|
59
|
-
version_requirements: *
|
59
|
+
version_requirements: *70225631313260
|
60
60
|
- !ruby/object:Gem::Dependency
|
61
61
|
name: guard-rspec
|
62
|
-
requirement: &
|
62
|
+
requirement: &70225631312800 !ruby/object:Gem::Requirement
|
63
63
|
none: false
|
64
64
|
requirements:
|
65
65
|
- - ~>
|
@@ -67,10 +67,10 @@ dependencies:
|
|
67
67
|
version: '0.4'
|
68
68
|
type: :development
|
69
69
|
prerelease: false
|
70
|
-
version_requirements: *
|
70
|
+
version_requirements: *70225631312800
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: growl
|
73
|
-
requirement: &
|
73
|
+
requirement: &70225631312340 !ruby/object:Gem::Requirement
|
74
74
|
none: false
|
75
75
|
requirements:
|
76
76
|
- - ~>
|
@@ -78,7 +78,7 @@ dependencies:
|
|
78
78
|
version: '1.0'
|
79
79
|
type: :development
|
80
80
|
prerelease: false
|
81
|
-
version_requirements: *
|
81
|
+
version_requirements: *70225631312340
|
82
82
|
description: ''
|
83
83
|
email:
|
84
84
|
- victorcrodrigues@gmail.com
|