mail_grabber 1.0.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 700d9bdbeeed0c02117ec588e990fb4d69e5b239aa4fec3d13fbc70acbba1230
4
- data.tar.gz: 71b84af90f8496cb0a07d9b96312ec37efa3b03e5fc871d57bd11468affabfb0
3
+ metadata.gz: 0dd58a8c4a209377bde0a889539208418aa1245b1b42a3e1799a4976711b01c4
4
+ data.tar.gz: e8fa33ca7477ff7c0366eb5239f8718e6e1b000693288b282406084489cfa398
5
5
  SHA512:
6
- metadata.gz: 6aca1623fb80aa3f79ef16050d799c955352ac463cdd8dd03928b828ed5abb6a4821f19f7045ab592e79ad1524e3cd04ff59d4df2c7055064969e1ac00e9edb3
7
- data.tar.gz: 981f1b1bb7f4310e3b6c703ea75e5c43a7e8626a377a80884a660c4d3f69b6d3546b21fa9acbcfea1c657379caea4aa6ed9ca4e508a7d374878efff255dadc5a
6
+ metadata.gz: f328e5349f02f4a4f0236f85b1712d9795ca9a41b74662d231c781c045f1122fa816dc1d49d10bae9026fd4c4da57fd3f193cef6aa2cb98ad0966367e6d0fb90
7
+ data.tar.gz: 5eb4c771eefb94b130e601d5be15fe816eb8503d5a0c93997a3c2a2e46b151d6c11e76cee6e38c0665c6c9b6b88009f33b811e6a0e81a775e40165d222787dc3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # Change log
2
2
 
3
+ ## 1.2.1 (2022-05-27)
4
+
5
+ ### Changes
6
+
7
+ * Update rack to version 2.2.3.1 because of security issues.
8
+
9
+
10
+ ## 1.2.0 (2022-05-26)
11
+
12
+ ### Changes
13
+
14
+ * Drop Ruby 2.6 support.
15
+ * Fix some grammar issues and typos.
16
+ * Update bundler and gems.
17
+
18
+
19
+ ## 1.1.0 (2021-12-31)
20
+
21
+ ### Changes
22
+
23
+ * Add Ruby 3.1 support.
24
+ * Drop Ruby 2.5 support.
25
+ * Replace Travis with GitHub Actions.
26
+ * Update bundler and gems.
27
+
28
+ ### Bug fixes
29
+
30
+ * Update apparition gem from github to fix issues.
31
+
32
+
3
33
  ## 1.0.0 (2021-04-02)
4
34
 
5
35
  ### Changes
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![Gem Version](https://badge.fury.io/rb/mail_grabber.svg)](https://badge.fury.io/rb/mail_grabber)
4
4
  [![MIT license](https://img.shields.io/badge/license-MIT-brightgreen)](https://github.com/MailToolbox/mail_grabber/blob/main/LICENSE.txt)
5
5
  [![Ruby Style Guide](https://img.shields.io/badge/code_style-rubocop-brightgreen.svg)](https://github.com/rubocop-hq/rubocop)
6
- [![Build Status](https://travis-ci.com/MailToolbox/mail_grabber.svg?branch=main)](https://travis-ci.com/MailToolbox/mail_grabber)
6
+ [![MailGrabber CI](https://github.com/MailToolbox/mail_grabber/actions/workflows/mail_grabber_ci.yml/badge.svg)](https://github.com/MailToolbox/mail_grabber/actions/workflows/mail_grabber_ci.yml)
7
7
  [![Maintainability](https://api.codeclimate.com/v1/badges/97deed5c1fbd003ca810/maintainability)](https://codeclimate.com/github/MailToolbox/mail_grabber/maintainability)
8
8
  [![Test Coverage](https://api.codeclimate.com/v1/badges/97deed5c1fbd003ca810/test_coverage)](https://codeclimate.com/github/MailToolbox/mail_grabber/test_coverage)
9
9
 
@@ -20,9 +20,9 @@ module MailGrabber
20
20
 
21
21
  # Create connection to the SQLite3 database. Use foreign_keys pragmas that
22
22
  # we can use DELETE CASCADE option. It accepts block to execute queries.
23
- # If something goes wrong then it raise database helper error.
24
- # Also ensure to close the database (important to close database if we are
25
- # don't want to see database busy errors).
23
+ # If something goes wrong, then it raises a database helper error.
24
+ # Also ensure to close the database (important to close database if we don't
25
+ # want to see database busy errors).
26
26
  def connection
27
27
  database = open_database
28
28
  database.foreign_keys = 'ON'
@@ -43,8 +43,8 @@ module MailGrabber
43
43
  end
44
44
 
45
45
  # Create connection and execute many queries in transaction. It accepts
46
- # block to execute queries. If something goes wrong it rolls back the
47
- # changes and raise database helper error.
46
+ # block to execute queries. If something goes wrong, it rolls back the
47
+ # changes and raises a database helper error.
48
48
  def connection_execute_transaction
49
49
  connection do |db|
50
50
  db.transaction
@@ -158,8 +158,8 @@ module MailGrabber
158
158
  object.cid if object.respond_to?(:cid)
159
159
  end
160
160
 
161
- # Extract all parts from the Mail::Message object. If it is not multipart
162
- # then it returns back with original object in an Array.
161
+ # Extract all parts from the Mail::Message object. If it is not multipart,
162
+ # then it returns with the original object in an Array.
163
163
  #
164
164
  # @param [Mail::Message] message
165
165
  #
@@ -168,7 +168,7 @@ module MailGrabber
168
168
  message.multipart? ? message.all_parts : [message]
169
169
  end
170
170
 
171
- # Extract MIME type of the Mail::Part object. If it is nil then it returns
171
+ # Extract MIME type of the Mail::Part object. If it is nil, then it returns
172
172
  # with text/plain value.
173
173
  #
174
174
  # @param [Mail::Part] object
@@ -228,8 +228,9 @@ module MailGrabber
228
228
  end
229
229
  end
230
230
 
231
- # Open a database connection with the database. Also it checks that the
232
- # database is exist or not. If it does not exist then it creates a new one.
231
+ # Open a database connection with the database. Also, it checks that the
232
+ # database is existing or not. If it does not exist, then it creates a new
233
+ # one.
233
234
  #
234
235
  # @return [SQLite3::Database] a database object
235
236
  def open_database
@@ -20,7 +20,7 @@ module MailGrabber
20
20
  store_mail(message)
21
21
  end
22
22
 
23
- # Delivery method settings (needed when run mail.deliver! method)
23
+ # Delivery method settings (needed when run mail.deliver! method).
24
24
  def settings
25
25
  {}
26
26
  end
@@ -2,10 +2,10 @@
2
2
 
3
3
  module MailGrabber
4
4
  class Error < StandardError
5
- # Specific error class for errors if database error happen
5
+ # Specific error class for errors if database error happen.
6
6
  class DatabaseHelperError < Error; end
7
7
 
8
- # Specific error class for errors if parameter is not given
8
+ # Specific error class for errors if parameter is not given.
9
9
  class WrongParameter < Error; end
10
10
  end
11
11
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MailGrabber
4
- VERSION = '1.0.0'
4
+ VERSION = '1.2.1'
5
5
  end
@@ -13,7 +13,7 @@ module MailGrabber
13
13
  attr_reader :request, :response
14
14
 
15
15
  # Method to call MailGrabber::Web::Application. This method will call the
16
- # initialize method and returns back with response of the application.
16
+ # initialize method and returns with response of the application.
17
17
  #
18
18
  # @param [Hash] env the environment variables
19
19
  #
@@ -23,7 +23,7 @@ module MailGrabber
23
23
  new(env).response.finish
24
24
  end
25
25
 
26
- # Initialize web application request and response then process the given
26
+ # Initialize web application request and response, then process the given
27
27
  # request.
28
28
  #
29
29
  # @param [Hash] env the environment variables
@@ -34,7 +34,7 @@ module MailGrabber
34
34
  process_request
35
35
  end
36
36
 
37
- # Extract env['PATH_INFO'] value. If the path info is empty then it will
37
+ # Extract env['PATH_INFO'] value. If the path info is empty, then it will
38
38
  # return with root path.
39
39
  #
40
40
  # @return [String] path the requested path or the root path if this value
@@ -43,7 +43,7 @@ module MailGrabber
43
43
  @path ||= request.path_info.empty? ? '/' : request.path_info
44
44
  end
45
45
 
46
- # This method returns back with extracted request parameters.
46
+ # This method returns with extracted request parameters.
47
47
  #
48
48
  # @return [Hash] params
49
49
  def params
@@ -64,12 +64,12 @@ module MailGrabber
64
64
  request.script_name
65
65
  end
66
66
 
67
- # Parse the routes of the ApplicationRouter and tries to find matching
67
+ # Parse the routes of the ApplicationRouter and tries to find a matching
68
68
  # route for the request method, which was defined in the
69
- # get, post, put, patch or delete blocks. If the 'extracted_params' is nil
70
- # then it could not found any defined routes. If it can find a defined
71
- # route then it saves the params and call the given block. If it cannot
72
- # find anything then it will set response with 404 Not Found.
69
+ # get, post, put, patch or delete blocks. If the 'extracted_params' is
70
+ # nil, then it could not find any defined routes. If it can find a defined
71
+ # route, then it saves the params and call the given block. If it cannot
72
+ # find anything, then it will set the response with 404 Not Found.
73
73
  def process_request
74
74
  self.class.routes[request_method].each do |route|
75
75
  extracted_params = route.extract_params(path)
@@ -4,7 +4,7 @@ module MailGrabber
4
4
  module Web
5
5
  # Helper module for views
6
6
  module ApplicationHelper
7
- # This method helps us that e.g. we can load style or javascript files
7
+ # This method helps us that e.g. we can load style or JavaScript files
8
8
  # when we are running this application standalone or in Ruby on Rails.
9
9
  def root_path
10
10
  script_name.to_s
@@ -9,13 +9,13 @@ module MailGrabber
9
9
 
10
10
  Route =
11
11
  Struct.new(:pattern, :block) do
12
- # Extract parameters from the given path. All routes has a
12
+ # Extract parameters from the given path. All routes have a
13
13
  # path pattern which helps to the router to find which block it should
14
- # execute. If path contains request parameters like '/test/1' then
15
- # it will match with the '/test/:id' pattern. In this case it will
14
+ # execute. If the path contains request parameters like '/test/1' then
15
+ # it will match with the '/test/:id' pattern. In this case, it will
16
16
  # return with '{"id" => "1"}' hash. If it is just a simple path like
17
- # '/' and it has a pattern to match then it will return with '{}'.
18
- # In the other case it will return with nil.
17
+ # '/' and it has a pattern to match, then it will return with '{}'.
18
+ # In the other case, it will return with nil.
19
19
  #
20
20
  # @param [String] path
21
21
  #
@@ -85,7 +85,7 @@ var MailGrabberApplication = {
85
85
 
86
86
  /**
87
87
  * Initialize MailGrabber. Add some event listeners to the Reload and the
88
- * Clear tabs then load messages and the default background.
88
+ * Clear tabs, then load messages and the default background.
89
89
  */
90
90
  init: function() {
91
91
  document
@@ -1,8 +1,8 @@
1
1
  var MailGrabberDOM = {
2
2
  /**
3
- * Change which content (message part) should show. When the page is loading
3
+ * Change which content (message part) should show. When the page is loading,
4
4
  * the HTML content will be active and the others will be hidden. When we
5
- * click on tab e.g. Plain Text then this content will active and other
5
+ * click on tab e.g. Plain Text then this content will be active and other
6
6
  * hidden.
7
7
  *
8
8
  * @param {Object} event - which part we clicked
@@ -33,9 +33,9 @@ var MailGrabberDOM = {
33
33
  },
34
34
 
35
35
  /**
36
- * Create a clone from an element e.g. template tag.
36
+ * Create a clone from an element, e.g. template tag.
37
37
  *
38
- * @param {String} selector - which describe how find the element
38
+ * @param {String} selector - which describe how to find the element
39
39
  *
40
40
  * @return {Object} the clone of the found element
41
41
  */
@@ -44,7 +44,7 @@ var MailGrabberDOM = {
44
44
  },
45
45
 
46
46
  /**
47
- * Show default backgroud image instead of any content.
47
+ * Show default background image instead of any content.
48
48
  */
49
49
  defaultBackground: function() {
50
50
  var messageContent =
@@ -62,7 +62,7 @@ var MailGrabberDOM = {
62
62
 
63
63
  /**
64
64
  * Delete all content (message list and message content as well),
65
- * set default backgroud and the infinite scroll params when we click on
65
+ * set default background and the infinite scroll params when we click on
66
66
  * the Reload or Delete tabs.
67
67
  */
68
68
  deleteContent: function() {
@@ -76,7 +76,7 @@ var MailGrabberDOM = {
76
76
  },
77
77
 
78
78
  /**
79
- * Root path which returns back with the server's root path. It can be empty
79
+ * Root path, which returns with the server's root path. It can be an empty
80
80
  * string or a string. It depends on how the server is running (standalone
81
81
  * or in Ruby on Rails).
82
82
  */
@@ -82,7 +82,7 @@ var MailGrabberMessageContent = {
82
82
 
83
83
  /**
84
84
  * Render the content of the message (all parts, inline attachments and
85
- * attachments). Also it sets up event listeners of the HTML, PlainText,
85
+ * attachments). Also, it sets up event listeners of the HTML, PlainText,
86
86
  * Raw, Delete and Close tabs.
87
87
  *
88
88
  * @param {Object} response - the response of the get message request
@@ -1,6 +1,6 @@
1
1
  var MailGrabberMessageHtmlPart = {
2
2
  /**
3
- * Render the HTML part of the message. If the message has inline images
3
+ * Render the HTML part of the message. If the message has inline images,
4
4
  * then it will render those images as well. An iframe will contain this
5
5
  * content.
6
6
  *
@@ -36,7 +36,7 @@ var MailGrabberMessageList = {
36
36
 
37
37
  /**
38
38
  * Render the list of the messages. Also add event listener when click on a
39
- * message then it will load that conent.
39
+ * message then it will load that content.
40
40
  *
41
41
  * @param {Object} messages - the list of the given message.
42
42
  */
@@ -17,7 +17,7 @@ var MailGrabberVariables = {
17
17
 
18
18
  /**
19
19
  * Params that we can follow how many messages we have on the list. We are
20
- * loading 15 messages in every requests.
20
+ * loading 15 messages in every request.
21
21
  */
22
22
  page: 1,
23
23
  perPage: 15
@@ -1,6 +1,6 @@
1
1
  (function() {
2
2
  /**
3
- * When DOM loaded then call MailGrabber's init function.
3
+ * When DOM loaded, then call MailGrabber's init function.
4
4
  */
5
5
  document.addEventListener('DOMContentLoaded', MailGrabberApplication.init);
6
6
  })();
@@ -14,7 +14,8 @@ module MailGrabber
14
14
  module Web
15
15
  module_function
16
16
 
17
- # Method which build a Rack application and run the Web::Application
17
+ # Method which build a Rack application and run the
18
+ # MailGrabber::Web::Application.
18
19
  def app
19
20
  @app ||= Rack::Builder.new do
20
21
  use Rack::Static,
data/lib/mail_grabber.rb CHANGED
@@ -3,6 +3,6 @@
3
3
  require 'mail_grabber/error'
4
4
  require 'mail_grabber/database_helper'
5
5
  require 'mail_grabber/delivery_method'
6
- # If we are using this gem outside of Rails then do not load this code.
6
+ # If we are using this gem outside of Rails, then do not load this code.
7
7
  require 'mail_grabber/railtie' if defined?(Rails)
8
8
  require 'mail_grabber/version'
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.0.0
4
+ version: 1.2.1
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: 2021-04-02 00:00:00.000000000 Z
11
+ date: 2022-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mail
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: rack
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '2.2'
33
+ version: 2.2.3.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '2.2'
40
+ version: 2.2.3.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: sqlite3
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -102,6 +102,7 @@ metadata:
102
102
  changelog_uri: https://github.com/MailToolbox/mail_grabber/blob/main/CHANGELOG.md
103
103
  bug_tracker_uri: https://github.com/MailToolbox/mail_grabber/issues
104
104
  documentation_uri: https://rubydoc.info/github/MailToolbox/mail_grabber/main
105
+ rubygems_mfa_required: 'true'
105
106
  post_install_message:
106
107
  rdoc_options: []
107
108
  require_paths:
@@ -110,7 +111,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
110
111
  requirements:
111
112
  - - ">="
112
113
  - !ruby/object:Gem::Version
113
- version: 2.5.0
114
+ version: 2.7.0
114
115
  required_rubygems_version: !ruby/object:Gem::Requirement
115
116
  requirements:
116
117
  - - ">="