faceted 0.6.3 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +2 -2
- data/VERSION +1 -1
- data/faceted.gemspec +3 -3
- data/lib/faceted/presenter.rb +3 -1
- data/spec/presenter_spec.rb +10 -3
- metadata +4 -4
data/Rakefile
CHANGED
@@ -17,8 +17,8 @@ Jeweler::Tasks.new do |gem|
|
|
17
17
|
gem.name = "faceted"
|
18
18
|
gem.homepage = "http://github.com/trunkclub/faceted"
|
19
19
|
gem.license = "MIT"
|
20
|
-
gem.summary = %Q{
|
21
|
-
gem.description = %Q{
|
20
|
+
gem.summary = %Q{Faceted provides set of tools, patterns, and modules for use in API implementations.}
|
21
|
+
gem.description = %Q{Faceted provides set of tools, patterns, and modules for use in API implementations.}
|
22
22
|
gem.email = "corey@trunkclub.com"
|
23
23
|
gem.authors = ["Corey Ehmke", "Max Thom Stahl"]
|
24
24
|
# dependencies defined in Gemfile
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.4
|
data/faceted.gemspec
CHANGED
@@ -5,12 +5,12 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "faceted"
|
8
|
-
s.version = "0.6.
|
8
|
+
s.version = "0.6.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Corey Ehmke", "Max Thom Stahl"]
|
12
12
|
s.date = "2012-09-18"
|
13
|
-
s.description = "
|
13
|
+
s.description = "Faceted provides set of tools, patterns, and modules for use in API implementations."
|
14
14
|
s.email = "corey@trunkclub.com"
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE.txt",
|
@@ -39,7 +39,7 @@ Gem::Specification.new do |s|
|
|
39
39
|
s.licenses = ["MIT"]
|
40
40
|
s.require_paths = ["lib"]
|
41
41
|
s.rubygems_version = "1.8.24"
|
42
|
-
s.summary = "
|
42
|
+
s.summary = "Faceted provides set of tools, patterns, and modules for use in API implementations."
|
43
43
|
|
44
44
|
if s.respond_to? :specification_version then
|
45
45
|
s.specification_version = 3
|
data/lib/faceted/presenter.rb
CHANGED
@@ -96,7 +96,9 @@ module Faceted
|
|
96
96
|
|
97
97
|
def save
|
98
98
|
schema_fields.each{ |k| object.send("#{k}=", self.send(k)) if object.respond_to?("#{k}=") }
|
99
|
-
object.save
|
99
|
+
self.success = object.save
|
100
|
+
self.errors = object.errors && object.errors.full_messages
|
101
|
+
self.success
|
100
102
|
end
|
101
103
|
|
102
104
|
def to_hash
|
data/spec/presenter_spec.rb
CHANGED
@@ -57,17 +57,24 @@ module MyApi
|
|
57
57
|
|
58
58
|
it 'successfully' do
|
59
59
|
musician = MyApi::Musician.new(:id => 1)
|
60
|
-
@ar_musician.should_receive(:save
|
60
|
+
@ar_musician.should_receive(:save) { true }
|
61
61
|
musician.save.should be_true
|
62
62
|
end
|
63
63
|
|
64
64
|
it 'handling failure' do
|
65
65
|
musician = MyApi::Musician.new(:id => 1)
|
66
|
-
@ar_musician.should_receive(:save
|
66
|
+
@ar_musician.should_receive(:save) { false }
|
67
67
|
musician.save.should be_false
|
68
68
|
end
|
69
69
|
|
70
|
-
it 'failing and populating its errors'
|
70
|
+
it 'failing and populating its errors' do
|
71
|
+
musician = MyApi::Musician.new(:id => 1)
|
72
|
+
@ar_musician.should_receive(:save) { false }
|
73
|
+
@ar_musician.stub_chain(:errors, :full_messages) { ["Something went wrong", "Terribly wrong"] }
|
74
|
+
musician.save
|
75
|
+
musician.errors.count.should == 2
|
76
|
+
musician.errors.last.should == "Terribly wrong"
|
77
|
+
end
|
71
78
|
|
72
79
|
end
|
73
80
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: faceted
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -140,7 +140,7 @@ dependencies:
|
|
140
140
|
- - ! '>='
|
141
141
|
- !ruby/object:Gem::Version
|
142
142
|
version: '0'
|
143
|
-
description:
|
143
|
+
description: Faceted provides set of tools, patterns, and modules for use in API implementations.
|
144
144
|
email: corey@trunkclub.com
|
145
145
|
executables: []
|
146
146
|
extensions: []
|
@@ -180,7 +180,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
180
180
|
version: '0'
|
181
181
|
segments:
|
182
182
|
- 0
|
183
|
-
hash:
|
183
|
+
hash: 3167010834966888439
|
184
184
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
185
185
|
none: false
|
186
186
|
requirements:
|
@@ -192,5 +192,5 @@ rubyforge_project:
|
|
192
192
|
rubygems_version: 1.8.24
|
193
193
|
signing_key:
|
194
194
|
specification_version: 3
|
195
|
-
summary:
|
195
|
+
summary: Faceted provides set of tools, patterns, and modules for use in API implementations.
|
196
196
|
test_files: []
|