setsuzoku 0.10.7 → 0.10.12

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
  SHA256:
3
- metadata.gz: 4a375b5eda528f0a8d9887cd3d6b13463eca4eb25c47b53279392fee980ae835
4
- data.tar.gz: 8cc9ed0995e1d675c365765f53860f99182d117ff36cc4822c4591b74b670f9e
3
+ metadata.gz: 39fda212a16a449e09d41daff1b4dac7188dadcee5e179f8feb5bf28449aa662
4
+ data.tar.gz: ba5b6a928f35b2cf319ee0cac4569d72f14ed5c3d11e52ed48bbfb05bd78aa4b
5
5
  SHA512:
6
- metadata.gz: a1a0c5300853cbca45ff76169b79a644c321da4fe416184863b8cb8718942da81bfc91eb244d3ef9aef9cae3c0f799203dbb1827991f9c68fe944646f7435aa4
7
- data.tar.gz: 84b790767b2f727e124643588d14eeefc20c0ecf25f83cae2d2d907dadb05041a9d019b407e749549d496a363fbc2b9e2794f742cc62beb07d6ecde7dafc8ca6
6
+ metadata.gz: 9ad9ee7d67eedf16c91549dd7e12ecd18e6783f6debbe1615259e5d183ff4eb3367b46cbfae092645394958f3d57ffaeb8ac29c30b42b3aa725dd83231192c7a
7
+ data.tar.gz: 9eedaf2642a3537d5c02284578319ec859329425d47ebfade8a7793c169b7e019dca0d0f0d4a6435cf05e93768190622dc7ce2e3fed53895f6b2fbb30cf9b85b
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- setsuzoku (0.10.7)
4
+ setsuzoku (0.10.12)
5
5
  activesupport (~> 5.0)
6
6
  faraday (~> 0.11)
7
7
  httparty (~> 0.16.4)
@@ -57,7 +57,7 @@ GEM
57
57
  safe_yaml (1.0.5)
58
58
  sorbet (0.5.5675)
59
59
  sorbet-static (= 0.5.5675)
60
- sorbet-runtime (0.5.5794)
60
+ sorbet-runtime (0.5.5862)
61
61
  sorbet-static (0.5.5675-universal-darwin-14)
62
62
  thread_safe (0.3.6)
63
63
  tzinfo (1.2.7)
@@ -231,13 +231,9 @@ module Setsuzoku
231
231
  def get_url_and_body(plugin, propz, stub_directory, action_name, url_params = nil)
232
232
  body = nil
233
233
  url = propz[:url]
234
- format = propz[:request_format].to_s.include?('x-www-form') ? :json : propz[:request_format]
234
+ format = propz[:request_format].to_s.include?('x-www-form') || propz[:request_format] == :file ? :json : propz[:request_format]
235
235
  begin
236
- body = if propz[:request_format] == :binary
237
- JSON.parse(ERB.new(File.read("#{Dir.pwd}/spec/support/setsuzoku/#{stub_directory}/#{action_name}_request.json.erb")))
238
- else
239
- File.read("#{Dir.pwd}/spec/support/setsuzoku/#{stub_directory}/#{action_name}_request.#{format}")
240
- end
236
+ body = File.read("#{Dir.pwd}/spec/support/setsuzoku/#{stub_directory}/#{action_name}_request.#{format}")
241
237
  body.squish!
242
238
  case format
243
239
  when :xml
@@ -251,8 +247,6 @@ module Setsuzoku
251
247
  end
252
248
 
253
249
  # We will convert these to url params when making requests. need to replicate that.
254
-
255
-
256
250
  req_params = case format
257
251
  when :json
258
252
  temp_body = JSON.parse(body)
@@ -271,9 +265,11 @@ module Setsuzoku
271
265
  url, body = plugin.api_strategy.replace_dynamic_vars(full_url: url, req_params: req_params)
272
266
  end
273
267
 
274
- case format
275
- when :json
268
+ if propz[:request_format] == :file
269
+ body = body.to_json if body.is_a?(Hash)
270
+ elsif format == :json
276
271
  #faraday sorts hash keys for some reason
272
+ body = body.to_json if body.is_a?(Hash)
277
273
  body = JSON.parse(body).sort.to_h
278
274
  end
279
275
  [url, body]
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Setsuzoku
5
- VERSION = '0.10.7'
5
+ VERSION = '0.10.12'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: setsuzoku
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.7
4
+ version: 0.10.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luke Stadtler
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-07-02 00:00:00.000000000 Z
11
+ date: 2020-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler