mailgun-ruby 1.3.4 → 1.3.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 +4 -4
- data/.github/workflows/ci.yml +28 -0
- data/CHANGELOG.md +5 -1
- data/README.md +2 -2
- data/lib/mailgun/messages/message_builder.rb +4 -3
- data/lib/mailgun/suppressions.rb +2 -2
- data/lib/mailgun/version.rb +1 -1
- data/spec/unit/messages/message_builder_spec.rb +3 -2
- metadata +3 -3
- data/.travis.yml +0 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d95de7e9d0beb5c9abeafdef8f05c7413566102807dedc3d8aa47236eeecf100
|
4
|
+
data.tar.gz: f1678c985501ecc657c2163f55f1a8073bca3990a84894ed4b914886d9a0f5d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46af44b97dd11918113681f366489b8640de80efa05e08dea0102f4e97635634d241739be47d63107342400af8712b079d8360326697e81a78ca94cb6526e42f
|
7
|
+
data.tar.gz: 9b72d7230d1c14f9f9515f9e740e7c002436675e14dda9302234ad263ff586cd3a7d1cd9759913a14e1a180f692b505a197308fa78299446906c57a9c007da55
|
@@ -0,0 +1,28 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ "master" ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ "master" ]
|
8
|
+
|
9
|
+
permissions:
|
10
|
+
contents: read
|
11
|
+
|
12
|
+
jobs:
|
13
|
+
test:
|
14
|
+
|
15
|
+
runs-on: ubuntu-latest
|
16
|
+
strategy:
|
17
|
+
matrix:
|
18
|
+
ruby-version: ['3.1', '3.4']
|
19
|
+
|
20
|
+
steps:
|
21
|
+
- uses: actions/checkout@v4
|
22
|
+
- name: Set up Ruby
|
23
|
+
uses: ruby/setup-ruby@v1
|
24
|
+
with:
|
25
|
+
ruby-version: ${{ matrix.ruby-version }}
|
26
|
+
bundler-cache: true
|
27
|
+
- name: Run tests
|
28
|
+
run: bundle exec rake
|
data/CHANGELOG.md
CHANGED
@@ -2,7 +2,11 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
-
## [
|
5
|
+
## [1.3.5] - 2025-04-07
|
6
|
+
|
7
|
+
### Fixed
|
8
|
+
|
9
|
+
- Set attachment filename on upload IO (https://github.com/mailgun/mailgun-ruby/pull/351)
|
6
10
|
|
7
11
|
## [1.3.4] - 2025-03-28
|
8
12
|
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Mailgun-Ruby
|
2
2
|
============
|
3
3
|
|
4
|
-
[](https://github.com/mailgun/mailgun-ruby/actions/workflows/ci.yml) [](http://badge.fury.io/rb/mailgun-ruby)
|
5
5
|
|
6
6
|
This is the Mailgun Ruby Library. This library contains methods for easily interacting
|
7
7
|
with the Mailgun API.
|
@@ -19,7 +19,7 @@ gem install mailgun-ruby
|
|
19
19
|
Gemfile:
|
20
20
|
|
21
21
|
```ruby
|
22
|
-
gem 'mailgun-ruby', '~>1.3.
|
22
|
+
gem 'mailgun-ruby', '~>1.3.6'
|
23
23
|
```
|
24
24
|
|
25
25
|
Usage
|
@@ -389,10 +389,11 @@ module Mailgun
|
|
389
389
|
#
|
390
390
|
# @param [String] parameter The message object parameter name.
|
391
391
|
# @param [String] value The attachment.
|
392
|
+
# @param [String] filename Filename of the attachment.
|
392
393
|
# @return [void]
|
393
|
-
def add_faraday_attachment(parameter, attachment)
|
394
|
+
def add_faraday_attachment(parameter, attachment, filename)
|
394
395
|
content_type = attachment.respond_to?(:content_type) ? attachment.content_type : nil
|
395
|
-
@message[parameter] << Faraday::Multipart::FilePart.new(attachment, content_type)
|
396
|
+
@message[parameter] << Faraday::Multipart::FilePart.new(attachment, content_type, filename)
|
396
397
|
end
|
397
398
|
|
398
399
|
# Converts boolean type to string
|
@@ -480,7 +481,7 @@ module Mailgun
|
|
480
481
|
attachment.instance_variable_set :@original_filename, filename
|
481
482
|
attachment.instance_eval 'def original_filename; @original_filename; end'
|
482
483
|
end
|
483
|
-
add_faraday_attachment(disposition, attachment)
|
484
|
+
add_faraday_attachment(disposition, attachment, filename)
|
484
485
|
end
|
485
486
|
end
|
486
487
|
|
data/lib/mailgun/suppressions.rb
CHANGED
@@ -261,14 +261,14 @@ module Mailgun
|
|
261
261
|
# Build the `next` endpoint
|
262
262
|
page_next = URI.parse(page_info["next"])
|
263
263
|
@paging_next = {
|
264
|
-
:path => page_next.path[/\/v[\d](.+)/, 1],
|
264
|
+
:path => page_next.path[/\/v[\d]\/(.+)/, 1],
|
265
265
|
:params => Hash[URI.decode_www_form page_next.query],
|
266
266
|
}
|
267
267
|
|
268
268
|
# Build the `prev` endpoint
|
269
269
|
page_prev = URI.parse(page_info["previous"])
|
270
270
|
@paging_prev = {
|
271
|
-
:path => page_prev.path[/\/v[\d](.+)/, 1],
|
271
|
+
:path => page_prev.path[/\/v[\d]\/(.+)/, 1],
|
272
272
|
:params => Hash[URI.decode_www_form page_prev.query],
|
273
273
|
}
|
274
274
|
end
|
data/lib/mailgun/version.rb
CHANGED
@@ -262,10 +262,11 @@ describe 'The method add_attachment' do
|
|
262
262
|
io = StringIO.new
|
263
263
|
io << File.binread(File.dirname(__FILE__) + "/sample_data/mailgun_icon.png")
|
264
264
|
|
265
|
-
@mb_obj.add_attachment io, '
|
265
|
+
@mb_obj.add_attachment io, 'cool_attachment.png'
|
266
266
|
|
267
267
|
expect(@mb_obj.message[:attachment].length).to eq(1)
|
268
|
-
expect(@mb_obj.message[:attachment].first.io.original_filename).to eq '
|
268
|
+
expect(@mb_obj.message[:attachment].first.io.original_filename).to eq 'cool_attachment.png'
|
269
|
+
expect(@mb_obj.message[:attachment].first.original_filename).to eq 'cool_attachment.png'
|
269
270
|
end
|
270
271
|
|
271
272
|
context 'when attachment has unknown type' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mailgun-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mailgun
|
8
8
|
- Travis Swientek
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -184,11 +184,11 @@ executables: []
|
|
184
184
|
extensions: []
|
185
185
|
extra_rdoc_files: []
|
186
186
|
files:
|
187
|
+
- ".github/workflows/ci.yml"
|
187
188
|
- ".gitignore"
|
188
189
|
- ".rubocop.yml"
|
189
190
|
- ".rubocop_todo.yml"
|
190
191
|
- ".ruby-env.yml.example"
|
191
|
-
- ".travis.yml"
|
192
192
|
- CHANGELOG.md
|
193
193
|
- Gemfile
|
194
194
|
- LICENSE
|
data/.travis.yml
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
sudo: false
|
3
|
-
rvm:
|
4
|
-
- 2.2.2
|
5
|
-
- 2.2.10
|
6
|
-
- 2.3.7
|
7
|
-
- 2.4.4
|
8
|
-
- 2.5.1
|
9
|
-
script:
|
10
|
-
- bundle install
|
11
|
-
- bundle exec rake spec
|
12
|
-
- '[[ "${TRAVIS_PULL_REQUEST}" == "false" ]] && ( bundle exec rake spec:integration
|
13
|
-
) || ( echo "Testing PR - No integration tests available")'
|
14
|
-
deploy:
|
15
|
-
provider: rubygems
|
16
|
-
api_key:
|
17
|
-
secure: DoX3w48gRyhDM1o1OLvtWsTi8ehLIarIsErzg/UlNRoLacQt5l5UzwD+u6wqsCEr4+c2uAHNahafpnw/j1rPG3LBPIXOK5A0SYbjovlckutiAC0330Q4PHwOZb73AFN1DG5JTeg4/fguEjdsEBdZObF7mh5gBMBQtNjo1Fos+4w=
|
18
|
-
gemspec: mailgun.gemspec
|
19
|
-
on:
|
20
|
-
tags: true
|
21
|
-
condition: "$TRAVIS_RUBY_VERSION == 2.5.1"
|
22
|
-
notifications:
|
23
|
-
slack:
|
24
|
-
rooms:
|
25
|
-
secure: G4iBtDfFGeryQslfrKZK4hSPikOy9y3SDnpzwmN8SoB0uIAWE2mLfMUJZonKm7yoz+DbPU0u3c1SwiMLwHkXZhPdnJdC1fb1DpicXnVgGZYdiLGiY+OAwkvcBE9p3piWhpwigTjvmSqTaNSRL/VLhG4qwQbHU0fTl1M1zwU4e6c=
|