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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NzM4YTZkNDI2MWFlM2VmMWI0NzBhNDIyNjhjNTllNWRkZDdhZDk4Zg==
4
+ MDhkZTljM2VlM2FhM2Y0N2EwYWJkNTdkYjIzMThlZDhkNzVmOGJmOQ==
5
5
  data.tar.gz: !binary |-
6
- MDIwODJkZDY5OWRlZDEzMzljNGI0ZDBiYTAyMDE0YzM1MTU2Mzc2Mg==
6
+ NjEyNjFlYWIzY2RlNDllZDJjYWQxZWM0YThkNWQxMTgwZTVkMzIxNQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YWRhYjc0YTMzMDEyMTJiOGQ2MDc1MWQ2YzJhNWMzODRmYTA3OWM4OTE4OWI3
10
- NTNiNTYyYjAyYWFlOWYzNDI4NGE0YTViNWM2MTFhMDVjMTEyYjQ3NTBkMDUw
11
- YzE2YjgxYjBkYzQzZDQ5MTUyNGMwNjllODZhMTBiNTk1OGZjMzU=
9
+ NmQ3NzhmNzMyODM1OTEzNTdmYThmYWJiOTM1ZWViYTNlYzY5YzQxM2M0NTE3
10
+ ODI0ZTFmZmI1YjZiYjBkODEwMGY3MTkwNjU2MzdkZTkzYjIyY2ZiMmZhNWVl
11
+ NjIxMzIwMzA1ZmI4ZTRiM2Y5MjAxMTY5MGNmZjI3NGJlMGYzOGI=
12
12
  data.tar.gz: !binary |-
13
- Y2I2MGYxODc5YmJiZjEzOWYzZDJhODE1ZTRmZjU5NjQ0ZTE4NTMzMTI1MzUz
14
- ZWJhYzk0M2M0YzQ0ZWNhNmVhYWNkYmEwMzg2NTAzOTcyOGEyZjBkOTU4MjQ5
15
- NGI5MmM1YmY2NTg2MDI1YTQ3MzUwZDAzNTJjZTBkZWZiMDNhNzQ=
13
+ YTRiMDgxNWM4MDU2MDVhYjVhNTg2ZDBlMGExNTMyM2Y4ODdmZWQyZDRhNDgy
14
+ YjcyZmFhMjA4MGE0N2Q4NGRhMWY4ZTZhMjExZmM3MGFlYmE1NDcxNTNkZjZl
15
+ MjIwYjMwNjYzMjFjMmQ5N2MyODJlMzYyMGE3OTBkNDIwMGVkMGY=
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tms_bridge (0.0.9)
4
+ tms_bridge (0.1)
5
5
  actionpack (>= 3.2.0)
6
6
  activerecord (>= 3.2.0)
7
7
  iron_cache
@@ -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}
@@ -1,3 +1,3 @@
1
1
  module Bridge
2
- VERSION = "0.0.10"
2
+ VERSION = "0.1"
3
3
  end
@@ -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.0.10
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-19 00:00:00.000000000 Z
11
+ date: 2013-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler