mail_grabber 1.3.7 → 1.4.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: 7481466486152961f626a03c822c1f48c92ebb53b94b8d103fe6c00d499cf190
4
- data.tar.gz: 306c24a014002a0d8e0e13c1dedc2045ad2f0ee29cb30844be35de2bbafb600e
3
+ metadata.gz: ef691ca8a02a3e47272157b3716d1649d87a978e01041bd647b193380a919e8c
4
+ data.tar.gz: 2fc7e0068292f24d2f5eea3a6f9a6cffac6b13edb554177ef1adfb85bd4431a0
5
5
  SHA512:
6
- metadata.gz: e98a6333e469aae73f3aae8d3cf918d783443b16b8f427c361bb8c4ac9e7fbe21b17afd14ecd9567e2057818fec2288f5fe2aba1bbef5e4165081c2f18d8a009
7
- data.tar.gz: 3eff4aabf2f91797c45755039577100216f98b2f1ecd232148425b4344b41270ff15fce2753df290e84be4f3bd5daa7d209bca5d29f981553c0e43d66a0f0625
6
+ metadata.gz: d77878cf2659f64335b006d54f7c6207052f6d717a2dbba3dd71b9e93d364d5ff40096e2a947bad54a64881c6239b1c5adb81cfe48345d216890fe0e1d6895f9
7
+ data.tar.gz: 51023a0ad5ec0a0e2caac72c17ab74e05dae19c6da2bcba0a08bcab2128abcccdf1bd21a76cf76eca171777241bf82135adfbd65fa62a9a9f23fdb44ba3201f3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Change log
2
2
 
3
+ ## 1.4.0 (2025-01-07)
4
+
5
+ ### Changes
6
+
7
+ * Upgrade sqlite3 to version 2.0.4
8
+ * Add Ruby 3.4 support.
9
+ * Drop Ruby 2.7 support.
10
+ * Update bundler and gems.
11
+
12
+
3
13
  ## 1.3.7 (2024-09-25)
4
14
 
5
15
  ### Changes
@@ -38,8 +38,8 @@ module MailGrabber
38
38
  #
39
39
  # @param [String] query which query we would like to execute
40
40
  # @param [Array] args any arguments which we will use in the query
41
- def connection_execute(query, *args)
42
- connection { |db| db.execute(query, *args) }
41
+ def connection_execute(query, args = [])
42
+ connection { |db| db.execute(query, args) }
43
43
  end
44
44
 
45
45
  # Create connection and execute many queries in transaction. It accepts
@@ -68,7 +68,7 @@ module MailGrabber
68
68
  #
69
69
  # @param [String/Integer] id the identifier of the message
70
70
  def delete_message_by(id)
71
- connection_execute('DELETE FROM mail WHERE id = ?', id.to_i)
71
+ connection_execute('DELETE FROM mail WHERE id = ?', [id.to_i])
72
72
  end
73
73
 
74
74
  # Helper method to get all messages.
@@ -80,14 +80,14 @@ module MailGrabber
80
80
  #
81
81
  # @param [String/Integer] id the identifier of the message
82
82
  def select_message_by(id)
83
- connection_execute('SELECT * FROM mail WHERE id = ?', id.to_i).first
83
+ connection_execute('SELECT * FROM mail WHERE id = ?', [id.to_i]).first
84
84
  end
85
85
 
86
86
  # Helper method to get a message part.
87
87
  #
88
88
  # @param [String/Integer] id the identifier of the message part
89
89
  def select_message_parts_by(id)
90
- connection_execute('SELECT * FROM mail_part WHERE mail_id = ?', id.to_i)
90
+ connection_execute('SELECT * FROM mail_part WHERE mail_id = ?', [id.to_i])
91
91
  end
92
92
 
93
93
  # Helper method to get a specific number of messages. We can specify which
@@ -101,8 +101,10 @@ module MailGrabber
101
101
 
102
102
  connection_execute(
103
103
  select_messages_with_pagination_query,
104
- per_page * (page - 1),
105
- per_page
104
+ [
105
+ per_page * (page - 1),
106
+ per_page
107
+ ]
106
108
  )
107
109
  end
108
110
 
@@ -194,12 +196,14 @@ module MailGrabber
194
196
  def insert_into_mail(db, message)
195
197
  db.execute(
196
198
  insert_into_mail_query,
197
- message.subject,
198
- message.from&.join(', '),
199
- message.to&.join(', '),
200
- message.cc&.join(', '),
201
- message.bcc&.join(', '),
202
- convert_to_utf8_string(message)
199
+ [
200
+ message.subject,
201
+ message.from&.join(', '),
202
+ message.to&.join(', '),
203
+ message.cc&.join(', '),
204
+ message.bcc&.join(', '),
205
+ convert_to_utf8_string(message)
206
+ ]
203
207
  )
204
208
  end
205
209
 
@@ -215,15 +219,17 @@ module MailGrabber
215
219
 
216
220
  db.execute(
217
221
  insert_into_mail_part_query,
218
- mail_id,
219
- extract_cid(part),
220
- extract_mime_type(part),
221
- attachment?(part),
222
- inline?(part),
223
- part.filename,
224
- part.charset,
225
- encode_if_attachment(part, body),
226
- body.length
222
+ [
223
+ mail_id,
224
+ extract_cid(part),
225
+ extract_mime_type(part),
226
+ attachment?(part),
227
+ inline?(part),
228
+ part.filename,
229
+ part.charset,
230
+ encode_if_attachment(part, body),
231
+ body.length
232
+ ]
227
233
  )
228
234
  end
229
235
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MailGrabber
4
- VERSION = '1.3.7'
4
+ VERSION = '1.4.0'
5
5
  end
@@ -3,7 +3,7 @@
3
3
  module MailGrabber
4
4
  module Web
5
5
  module ApplicationRouter
6
- NAMED_SEGMENTS_PATTERN = %r{/([^/]*):([^.:$/]+)}.freeze
6
+ NAMED_SEGMENTS_PATTERN = %r{/([^/]*):([^.:$/]+)}
7
7
 
8
8
  attr_reader :routes
9
9
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mail_grabber
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.7
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Norbert Szivós
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-25 00:00:00.000000000 Z
11
+ date: 2025-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mail
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.4'
47
+ version: '2.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.4'
54
+ version: '2.0'
55
55
  description: MailGrabber is yet another solution to inspect sent emails.
56
56
  email:
57
57
  - sysqa@yahoo.com
@@ -110,14 +110,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
110
110
  requirements:
111
111
  - - ">="
112
112
  - !ruby/object:Gem::Version
113
- version: 2.7.0
113
+ version: 3.0.0
114
114
  required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  requirements:
116
116
  - - ">="
117
117
  - !ruby/object:Gem::Version
118
118
  version: '0'
119
119
  requirements: []
120
- rubygems_version: 3.1.6
120
+ rubygems_version: 3.2.33
121
121
  signing_key:
122
122
  specification_version: 4
123
123
  summary: Grab mails to inspect with MailGrabber.