yeti 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/yeti/editor.rb +1 -0
- data/lib/yeti/version.rb +1 -1
- data/lib/yeti/viewer.rb +3 -2
- data/spec/yeti/viewer_spec.rb +2 -2
- metadata +9 -3
data/lib/yeti/editor.rb
CHANGED
data/lib/yeti/version.rb
CHANGED
data/lib/yeti/viewer.rb
CHANGED
@@ -10,12 +10,13 @@ module Yeti
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def self.from_id(context, id)
|
13
|
-
new context, (find_by_id id if id)
|
13
|
+
new context, (find_by_id context, id if id)
|
14
14
|
end
|
15
15
|
|
16
16
|
protected
|
17
17
|
|
18
|
-
|
18
|
+
# ~~~ methods to be implemented in subclasses ~~~
|
19
|
+
def self.find_by_id(context, id)
|
19
20
|
raise NotImplementedError, "#{inspect}.find_by_id"
|
20
21
|
end
|
21
22
|
|
data/spec/yeti/viewer_spec.rb
CHANGED
@@ -5,7 +5,7 @@ describe ::Yeti::Viewer do
|
|
5
5
|
subject{ described_class.new context }
|
6
6
|
it ".find_by_id is virtual" do
|
7
7
|
lambda do
|
8
|
-
described_class.find_by_id 1
|
8
|
+
described_class.find_by_id context, 1
|
9
9
|
end.should raise_error NotImplementedError, "Yeti::Viewer.find_by_id"
|
10
10
|
end
|
11
11
|
describe "initialization" do
|
@@ -31,7 +31,7 @@ describe ::Yeti::Viewer do
|
|
31
31
|
let(:existing_object){ mock :existing_object }
|
32
32
|
subject{ described_class.from_id context, "1" }
|
33
33
|
it "uses .find_by_id to find object to edit" do
|
34
|
-
described_class.should_receive(:find_by_id).with("1").and_return do
|
34
|
+
described_class.should_receive(:find_by_id).with(context, "1").and_return do
|
35
35
|
existing_object
|
36
36
|
end
|
37
37
|
subject.decorated.should be existing_object
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yeti
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activemodel
|
@@ -114,15 +114,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
114
114
|
- - ! '>='
|
115
115
|
- !ruby/object:Gem::Version
|
116
116
|
version: '0'
|
117
|
+
segments:
|
118
|
+
- 0
|
119
|
+
hash: 2568117032009414659
|
117
120
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
121
|
none: false
|
119
122
|
requirements:
|
120
123
|
- - ! '>='
|
121
124
|
- !ruby/object:Gem::Version
|
122
125
|
version: '0'
|
126
|
+
segments:
|
127
|
+
- 0
|
128
|
+
hash: 2568117032009414659
|
123
129
|
requirements: []
|
124
130
|
rubyforge_project:
|
125
|
-
rubygems_version: 1.8.
|
131
|
+
rubygems_version: 1.8.23
|
126
132
|
signing_key:
|
127
133
|
specification_version: 3
|
128
134
|
summary: Editor pattern simplifies edition of multiple objects at once using ActiveModel
|