tms_bridge 0.0.10 → 0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/Gemfile.lock +1 -1
- data/lib/tms_bridge/controller_support.rb +1 -1
- data/lib/tms_bridge/version.rb +1 -1
- data/spec/tms_bridge/controller_support_spec.rb +11 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MDhkZTljM2VlM2FhM2Y0N2EwYWJkNTdkYjIzMThlZDhkNzVmOGJmOQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NjEyNjFlYWIzY2RlNDllZDJjYWQxZWM0YThkNWQxMTgwZTVkMzIxNQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NmQ3NzhmNzMyODM1OTEzNTdmYThmYWJiOTM1ZWViYTNlYzY5YzQxM2M0NTE3
|
10
|
+
ODI0ZTFmZmI1YjZiYjBkODEwMGY3MTkwNjU2MzdkZTkzYjIyY2ZiMmZhNWVl
|
11
|
+
NjIxMzIwMzA1ZmI4ZTRiM2Y5MjAxMTY5MGNmZjI3NGJlMGYzOGI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YTRiMDgxNWM4MDU2MDVhYjVhNTg2ZDBlMGExNTMyM2Y4ODdmZWQyZDRhNDgy
|
14
|
+
YjcyZmFhMjA4MGE0N2Q4NGRhMWY4ZTZhMjExZmM3MGFlYmE1NDcxNTNkZjZl
|
15
|
+
MjIwYjMwNjYzMjFjMmQ5N2MyODJlMzYyMGE3OTBkNDIwMGVkMGY=
|
data/Gemfile.lock
CHANGED
@@ -53,7 +53,7 @@ RUBY
|
|
53
53
|
self.update_only = options[:update_only]
|
54
54
|
class_eval <<-RUBY, __FILE__, __LINE__+1
|
55
55
|
def create
|
56
|
-
@#{self.bridged_resource} = #{class_name}.find_by_tms_id(@json['tms_id'])
|
56
|
+
@#{self.bridged_resource} = block_given? ? yield(#{class_name}, @json) : #{class_name}.find_by_tms_id(@json['tms_id'])
|
57
57
|
|
58
58
|
@#{self.bridged_resource} = #{class_name}.new if @#{self.bridged_resource}.nil? && !self.update_only?
|
59
59
|
if @#{self.bridged_resource}
|
data/lib/tms_bridge/version.rb
CHANGED
@@ -263,9 +263,20 @@ describe TmsBridge::ControllerSupport::Publish do
|
|
263
263
|
controller.create
|
264
264
|
controller.mock_publishing.called_save.should == true
|
265
265
|
end
|
266
|
+
|
266
267
|
it "should call render " do
|
267
268
|
controller.should_receive(:render).with(text: 'success')
|
268
269
|
controller.create
|
269
270
|
end
|
271
|
+
|
272
|
+
it "should yield to find a model if block_given?" do
|
273
|
+
yielded = false
|
274
|
+
controller.create{
|
275
|
+
yielded = true
|
276
|
+
nil
|
277
|
+
}
|
278
|
+
yielded.should == true
|
279
|
+
end
|
280
|
+
|
270
281
|
end
|
271
282
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tms_bridge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.1'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erich Timkar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|