setsuzoku 0.14.9 → 0.15.0

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: 4ebd323b4c61479bb8a3dba4b979ddf121a1492b5aab8393f5fabd42c02a9755
4
- data.tar.gz: 4ddfb9aecd477c2c418766cb5415498324ecfbe48e37fc1ebd005a0b54feade2
3
+ metadata.gz: 113d13e0305fa193bb0a433ff116d5c0edb874eb8fe4f2cf29e67ee94aef5c35
4
+ data.tar.gz: cc375d2b21ec798a44759ffde0949a389cdf982dfb89046b98e48b19b5abe416
5
5
  SHA512:
6
- metadata.gz: 2c0ee8c5930e4bdb6eb5ea4f7ef4f75febeea48e73ddde381b4f43d278d69aa9557f2111ab1c53a0dc986b1ae9053dea4e1ccab9711354ecc1f7c741bac19b68
7
- data.tar.gz: 96a6814e10c5aef72829216c7b69869811c5ab7db98f1762b2c35658af7356675cde516d232d5367f2ed30a10b15031817879539dba897d244f7005dec053593
6
+ metadata.gz: f178c75650965ab61a221ac0f6c89d4664536e311545f7b85e7e8f687e30cf7ea53f434ad0d129fffd7f04a8e7ac21641e0be5b588a60dc713e2a3f5c5f6905b
7
+ data.tar.gz: dffed87de3ee9c1e622d03bba857c5e21048585a5c64ebec3281c7e804e7abf312c5bac335cf8fb600a37fcc46f34259cfa82ed4e1da7e7f24ee0d5f95c35d6f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- setsuzoku (0.14.9)
4
+ setsuzoku (0.15.0)
5
5
  activesupport (>= 5.0, < 7)
6
6
  faraday (~> 0.11)
7
7
  nokogiri (~> 1.10)
@@ -28,8 +28,8 @@ GEM
28
28
  i18n (1.10.0)
29
29
  concurrent-ruby (~> 1.0)
30
30
  mini_portile2 (2.8.0)
31
- minitest (5.15.0)
32
- multipart-post (2.1.1)
31
+ minitest (5.16.1)
32
+ multipart-post (2.2.3)
33
33
  nokogiri (1.13.6)
34
34
  mini_portile2 (~> 2.8.0)
35
35
  racc (~> 1.4)
@@ -52,7 +52,7 @@ GEM
52
52
  safe_yaml (1.0.5)
53
53
  sorbet (0.5.10030)
54
54
  sorbet-static (= 0.5.10030)
55
- sorbet-runtime (0.5.10030)
55
+ sorbet-runtime (0.5.10125)
56
56
  sorbet-static (0.5.10030-universal-darwin-14)
57
57
  tzinfo (2.0.4)
58
58
  concurrent-ruby (~> 1.0)
@@ -60,7 +60,7 @@ GEM
60
60
  addressable (>= 2.3.6)
61
61
  crack (>= 0.3.2)
62
62
  hashdiff (>= 0.4.0, < 2.0.0)
63
- zeitwerk (2.5.4)
63
+ zeitwerk (2.6.0)
64
64
 
65
65
  PLATFORMS
66
66
  ruby
@@ -57,11 +57,13 @@ module Setsuzoku
57
57
  end
58
58
  faraday.adapter Faraday.default_adapter
59
59
  end
60
-
61
- if options[:attachment_urls].present?
60
+ attachment_urls = options[:attachment_url] || options[:attachment_urls]
61
+ if attachment_urls.present?
62
62
  resp = @faraday.post do |req|
63
63
  payload = {}
64
- attachments = options[:attachment_urls].map do |url|
64
+ # create an array to just iterate over for 1 or many urls
65
+ attachment_urls = [attachment_urls] if options[:attachment_url]
66
+ attachments = attachment_urls.map do |url|
65
67
  image = open(url, 'rb')
66
68
  Faraday::UploadIO.new(image, T.must(image).content_type, File.basename(url))
67
69
  end
@@ -70,7 +72,8 @@ module Setsuzoku
70
72
  else
71
73
  payload.merge!(full_request)
72
74
  end
73
- payload[options[:attachment_url_key]] = attachments
75
+ # if using the singular "attachment_url" key pull out the first item
76
+ payload[options[:attachment_url_key]] = options[:attachment_url] ? attachments.first : attachments
74
77
  req.body = payload
75
78
  end
76
79
  else
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Setsuzoku
5
- VERSION = '0.14.9'
5
+ VERSION = '0.15.0'
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.14.9
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luke Stadtler
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-05-26 00:00:00.000000000 Z
11
+ date: 2022-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler