shrimple 0.8.4 → 0.8.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3633a648b23d0453ea8ac9e0c088923d4e37a24c
4
- data.tar.gz: 9a11cfb9c649b5f924329506809a42ffdda8165b
3
+ metadata.gz: 310c4b7211c3312385b0a2037f886f953de7dc67
4
+ data.tar.gz: 2a831b00ab771d0fd85eecf2164d6e1c585f0095
5
5
  SHA512:
6
- metadata.gz: b118cb629b1654df68d33d6e48bb871bfa81997b082c740d5d68a4786cb04725121875b1d7a8f4e034dda62f7e75f8be9a720af1eca1cb3f1c4582fb57e873b7
7
- data.tar.gz: 3c563f397680572f285f3cbaf9c1635f9c8f25e8f253ac205083d002d01d25c7a61980fff47fa043cb3ed95b6c3ce0fba48d3700b980bfd76a3cf9544a9e0f8f
6
+ metadata.gz: 4202f11f06bfc7dec4ddeabd7b26127ab02e2bf352d1e8c874e5a42aed81cf1731e2703aa4e3d272dff402ed902d83c573c35a8d49a11e6f91e93cda6c7cc06e
7
+ data.tar.gz: 153c56a6fd32b8656d600e5f3173732349126fa2f45b3385a10493e4216b3e0d8559db5929e365713b467b8680f86e414f0a022f0e2a73b513a182894fb357a1
@@ -81,15 +81,16 @@ class Shrimple
81
81
 
82
82
  def get_full_options src, *inopts
83
83
  exopts = options.dup
84
+ # can't deep_dup procs so remove them and add them back
84
85
  onSuccess = exopts.delete(:onSuccess)
85
86
  onError = exopts.delete(:onError)
86
87
 
87
88
  full_opts = Shrimple.deep_dup(exopts)
89
+ full_opts.merge!(onSuccess: onSuccess, onError: onError)
88
90
  full_opts.deep_merge!(src) if src && src.kind_of?(Hash)
89
91
  inopts.each { |opt| full_opts.deep_merge!(opt) }
90
92
  full_opts.merge!(input: src) if src && !src.kind_of?(Hash)
91
93
  full_opts.merge!(output: full_opts.delete(:to)) if full_opts[:to]
92
- full_opts.merge!(onSuccess: onSuccess, onError: onError)
93
94
 
94
95
  self.class.compact!(full_opts)
95
96
  full_opts
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'shrimple'
3
- s.version = '0.8.4'
3
+ s.version = '0.8.6'
4
4
  s.authors = ['Scott Bronson']
5
5
  s.email = ['brons_shrimple@rinspin.com']
6
6
  s.homepage = 'http://github.com/bronson/shrimple'
@@ -89,6 +89,13 @@ describe Shrimple do
89
89
  expect(Shrimple.compact!(s.to_hash)).to eq({'executable' => 'symbol'}.merge(custom_headers))
90
90
  end
91
91
 
92
+ it "properly merges callbacks" do
93
+ # this is in response to a bug where it was impossible to pass onSuccess/onError directly to render
94
+ s = Shrimple.new
95
+ s.merge!('executable' => nil, renderer: nil) # can't pass to constructor since nil means use default
96
+ expect(s.get_full_options(onSuccess: 4, onError: 5)).to eq({'onSuccess' => 4, 'onError' => 5}.merge(custom_headers))
97
+ end
98
+
92
99
  it "has a working compact" do
93
100
  expect(Shrimple.compact!({
94
101
  a: nil,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shrimple
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.4
4
+ version: 0.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Bronson