rmail 1.1.3 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/ChangeLog +14 -0
- data/Rakefile +0 -1
- data/lib/rmail/address.rb +2 -2
- data/lib/rmail/header.rb +8 -8
- data/lib/rmail/message.rb +3 -2
- data/lib/rmail/parser.rb +0 -1
- data/lib/rmail/parser/pushbackreader.rb +7 -7
- data/lib/rmail/serialize.rb +1 -1
- data/lib/rmail/version.rb +1 -1
- data/test/testaddress.rb +3 -3
- data/test/testbase.rb +20 -0
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 419bee362a39a953f99c8e6ff8adbbc1c921df6a4db9bb64f549ec6ed6a6ba3b
|
4
|
+
data.tar.gz: f93bce83b84092e1c05ef2472f1d1936b03ad7ff5ef398b2f85dd61eff5f726c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3084bf084c2be23361db1cdc21321f623ab32e486ff3a101516d8f12999853c6650158b6082208320b79fd638bc51e7b06952bab9f41c2013b0675697e11e91
|
7
|
+
data.tar.gz: 4801d74331dfa38682cb4484f16f5cb9f07704bb8305fa5dcb2e3a42a10460e912327c63a00a7f02b92e1ffc2a7d653cfa33cf7c45bc4b055b3c6d4e29fcd95c
|
data/ChangeLog
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
= Changes in RubyMail 1.1.4 (released 2020-07-08)
|
2
|
+
|
3
|
+
- Fix 'warning: constant ::Fixnum is deprecated' since Ruby 2.5 (Martin Vidner)
|
4
|
+
- Fix 'warning: instance variable @delimiters not initialized' (Martin Vidner)
|
5
|
+
- Fix 'warning: shadowing outer local variable - name, value' (Martin Vidner)
|
6
|
+
- Fix 'warning: optional boolean argument is obsoleted' (Martin Vidner)
|
7
|
+
- Fix 'warning: character class has duplicated range' (Martin Vidner)
|
8
|
+
- Fix 'warning: assigned but unused variable' (Martin Vidner)
|
9
|
+
- Enable code coverage analysis (Martin Vidner)
|
10
|
+
- Test Ruby 2.5 and 2.6 on Travis (Martin Vidner)
|
11
|
+
- Test Ruby 2.7 (Martin Vidner)
|
12
|
+
- include license text in a separate file (Dan Callaghan)
|
13
|
+
- Rakefile: drop usage of deprecated rubygems feature (Antonio Terceiro)
|
14
|
+
|
1
15
|
= Changes in RubyMail 1.1.3 (released 2017-07-16)
|
2
16
|
|
3
17
|
- Fix tests that suddenly started failing for no apparent reason
|
data/Rakefile
CHANGED
@@ -141,7 +141,6 @@ spec = Gem::Specification.new do |s|
|
|
141
141
|
|
142
142
|
s.required_ruby_version = Gem::Version::Requirement.new(">= 1.8.1")
|
143
143
|
|
144
|
-
s.has_rdoc = true
|
145
144
|
s.extra_rdoc_files = rdoc.rdoc_files.reject { |fn| fn =~ /\.rb$/ }.to_a
|
146
145
|
s.rdoc_options.concat([ '--title', rdoc.title, '--main', rdoc.main,
|
147
146
|
rdoc.options ].flatten)
|
data/lib/rmail/address.rb
CHANGED
@@ -661,7 +661,7 @@ module RMail
|
|
661
661
|
comment
|
662
662
|
when /\A""/ # skip empty quoted text
|
663
663
|
@string = $'
|
664
|
-
when /\A[\w!$%&\'
|
664
|
+
when /\A[\w!$%&\'*+\/=?^\`{\}|~#-]+/m
|
665
665
|
@string = $'
|
666
666
|
@sym = SYM_ATOM
|
667
667
|
break
|
@@ -703,7 +703,7 @@ module RMail
|
|
703
703
|
@sym = SYM_DOMAIN_LITERAL
|
704
704
|
@lexeme = $1.gsub(/(^|[^\\])[\r\n\t ]+/, '\1').gsub(/\\(.)/, '\1')
|
705
705
|
break
|
706
|
-
when /\A[\200-\377\w!$%&\'
|
706
|
+
when /\A[\200-\377\w!$%&\'*+\/=?^\`{\}|~#-]+/nm
|
707
707
|
# This is just like SYM_ATOM, but includes all characters
|
708
708
|
# with high bits. This is so we can allow such tokens in
|
709
709
|
# the display name portion of an address even though it
|
data/lib/rmail/header.rb
CHANGED
@@ -136,10 +136,10 @@ module RMail
|
|
136
136
|
end
|
137
137
|
|
138
138
|
# Return the value of the first matching field of a field name, or
|
139
|
-
# nil if none found. If passed
|
139
|
+
# nil if none found. If passed an Integer, returns the header
|
140
140
|
# indexed by the number.
|
141
141
|
def [](name_or_index)
|
142
|
-
if name_or_index.kind_of?
|
142
|
+
if name_or_index.kind_of? Integer
|
143
143
|
temp = @fields[name_or_index]
|
144
144
|
temp = temp.value unless temp.nil?
|
145
145
|
else
|
@@ -474,9 +474,9 @@ module RMail
|
|
474
474
|
#
|
475
475
|
# See also: #match
|
476
476
|
def match?(name, value)
|
477
|
-
massage_match_args(name, value) { |
|
477
|
+
massage_match_args(name, value) { |mname, mvalue|
|
478
478
|
match = detect {|n, v|
|
479
|
-
n =~
|
479
|
+
n =~ mname && v =~ mvalue
|
480
480
|
}
|
481
481
|
! match.nil?
|
482
482
|
}
|
@@ -507,10 +507,10 @@ module RMail
|
|
507
507
|
#
|
508
508
|
# See also: #match?
|
509
509
|
def match(name, value)
|
510
|
-
massage_match_args(name, value) { |
|
510
|
+
massage_match_args(name, value) { |mname, mvalue|
|
511
511
|
header = RMail::Header.new
|
512
|
-
|
513
|
-
if n.downcase =~
|
512
|
+
each { |n, v|
|
513
|
+
if n.downcase =~ mname && mvalue =~ v
|
514
514
|
header[n] = v
|
515
515
|
end
|
516
516
|
}
|
@@ -893,7 +893,7 @@ module RMail
|
|
893
893
|
|
894
894
|
protected
|
895
895
|
|
896
|
-
|
896
|
+
attr_accessor :fields
|
897
897
|
|
898
898
|
private
|
899
899
|
|
data/lib/rmail/message.rb
CHANGED
@@ -46,6 +46,7 @@ module RMail
|
|
46
46
|
@body = nil
|
47
47
|
@epilogue = nil
|
48
48
|
@preamble = nil
|
49
|
+
@delimiters = nil
|
49
50
|
end
|
50
51
|
|
51
52
|
# Test if this message is structured exactly the same as the other
|
@@ -130,14 +131,14 @@ module RMail
|
|
130
131
|
# Access the epilogue string for this message. The epilogue
|
131
132
|
# string is relevant only for multipart messages. It is the text
|
132
133
|
# that occurs after all parts of the message and is generally nil.
|
133
|
-
|
134
|
+
attr_accessor :epilogue
|
134
135
|
|
135
136
|
# Access the preamble string for this message. The preamble
|
136
137
|
# string is relevant only for multipart messages. It is the text
|
137
138
|
# that occurs just before the first part of the message, and is
|
138
139
|
# generally nil or simple English text describing the nature of
|
139
140
|
# the message.
|
140
|
-
|
141
|
+
attr_accessor :preamble
|
141
142
|
|
142
143
|
# Returns the entire message in a single string. This uses the
|
143
144
|
# RMail::Serialize class.
|
data/lib/rmail/parser.rb
CHANGED
@@ -81,11 +81,11 @@ module RMail
|
|
81
81
|
end
|
82
82
|
end
|
83
83
|
chunk
|
84
|
-
when
|
84
|
+
when Integer
|
85
85
|
read_chunk(size)
|
86
86
|
else
|
87
87
|
raise ArgumentError,
|
88
|
-
"Read size (#{size.inspect}) must be
|
88
|
+
"Read size (#{size.inspect}) must be an Integer or nil."
|
89
89
|
end
|
90
90
|
end
|
91
91
|
|
@@ -102,7 +102,7 @@ module RMail
|
|
102
102
|
# convenient to call from derived classes when super() isn't
|
103
103
|
# easy to use.
|
104
104
|
def standard_read_chunk(size)
|
105
|
-
unless size.is_a?(
|
105
|
+
unless size.is_a?(Integer) && size > 0
|
106
106
|
raise ArgumentError,
|
107
107
|
"Read size (#{size.inspect}) must be greater than 0."
|
108
108
|
end
|
@@ -132,11 +132,11 @@ module RMail
|
|
132
132
|
|
133
133
|
# Set the chunk size of this reader in bytes. This is useful
|
134
134
|
# mainly for testing, though perhaps some operations could be
|
135
|
-
# optimized by tweaking this value. The chunk size must be
|
136
|
-
#
|
135
|
+
# optimized by tweaking this value. The chunk size must be an
|
136
|
+
# Integer greater than 0.
|
137
137
|
def chunk_size=(size)
|
138
|
-
unless size.is_a?(
|
139
|
-
raise ArgumentError, "chunk size must be
|
138
|
+
unless size.is_a?(Integer)
|
139
|
+
raise ArgumentError, "chunk size must be an Integer"
|
140
140
|
end
|
141
141
|
unless size >= 1
|
142
142
|
raise ArgumentError, "invalid size #{size.inspect} given"
|
data/lib/rmail/serialize.rb
CHANGED
@@ -74,7 +74,7 @@ module RMail
|
|
74
74
|
|
75
75
|
def serialize_low(message, depth = 0)
|
76
76
|
if message.multipart?
|
77
|
-
delimiters,
|
77
|
+
delimiters, _delimiters_boundary = message.get_delimiters
|
78
78
|
unless delimiters
|
79
79
|
boundary = "\n--" + message.header.param('Content-Type', 'boundary')
|
80
80
|
delimiters = Array.new(message.body.length + 1, boundary + "\n")
|
data/lib/rmail/version.rb
CHANGED
data/test/testaddress.rb
CHANGED
@@ -1129,13 +1129,13 @@ class TestRMailAddress < TestBase
|
|
1129
1129
|
assert_equal(nil, addr.domain)
|
1130
1130
|
assert_equal(nil, addr.local)
|
1131
1131
|
|
1132
|
-
|
1132
|
+
assert_raise(ArgumentError) {
|
1133
1133
|
RMail::Address.new(["bob"])
|
1134
1134
|
}
|
1135
|
-
|
1135
|
+
assert_raise(ArgumentError) {
|
1136
1136
|
RMail::Address.new(Object.new)
|
1137
1137
|
}
|
1138
|
-
|
1138
|
+
assert_raise(ArgumentError) {
|
1139
1139
|
RMail::Address.new(Hash.new)
|
1140
1140
|
}
|
1141
1141
|
end
|
data/test/testbase.rb
CHANGED
@@ -27,6 +27,26 @@
|
|
27
27
|
|
28
28
|
# Base for all the test cases, providing a default setup and teardown
|
29
29
|
|
30
|
+
if ENV["COVERAGE"] || ENV["TRAVIS"]
|
31
|
+
require "simplecov"
|
32
|
+
SimpleCov.start do
|
33
|
+
add_filter "/test/"
|
34
|
+
end
|
35
|
+
top = File.expand_path("../..", __FILE__)
|
36
|
+
# track all ruby files under lib
|
37
|
+
SimpleCov.track_files("#{top}/lib/**/*.rb")
|
38
|
+
|
39
|
+
# use coveralls for on-line code coverage reporting at Travis CI
|
40
|
+
if ENV["TRAVIS"]
|
41
|
+
require "coveralls"
|
42
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new [
|
43
|
+
SimpleCov::Formatter::HTMLFormatter,
|
44
|
+
Coveralls::SimpleCov::Formatter
|
45
|
+
]
|
46
|
+
end
|
47
|
+
SimpleCov.start
|
48
|
+
end
|
49
|
+
|
30
50
|
require 'test/unit'
|
31
51
|
require 'rbconfig.rb'
|
32
52
|
require 'tempfile'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rmail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Armstrong
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2020-07-08 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: |2
|
15
15
|
RMail is a lightweight mail library containing various utility classes and
|
@@ -123,7 +123,7 @@ metadata: {}
|
|
123
123
|
post_install_message:
|
124
124
|
rdoc_options:
|
125
125
|
- "--title"
|
126
|
-
- RubyMail Documentation (version 1.1.
|
126
|
+
- RubyMail Documentation (version 1.1.4)
|
127
127
|
- "--main"
|
128
128
|
- README
|
129
129
|
- "--exclude"
|
@@ -141,8 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
141
|
- !ruby/object:Gem::Version
|
142
142
|
version: '0'
|
143
143
|
requirements: []
|
144
|
-
|
145
|
-
rubygems_version: 2.5.2
|
144
|
+
rubygems_version: 3.1.2
|
146
145
|
signing_key:
|
147
146
|
specification_version: 4
|
148
147
|
summary: A MIME mail parsing and generation library.
|