aws-ses 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -0
- data/README.erb +1 -1
- data/README.rdoc +1 -1
- data/VERSION +1 -1
- data/aws-ses.gemspec +1 -1
- data/lib/aws/ses/extensions.rb +0 -105
- data/lib/aws/ses/version.rb +1 -1
- data/test/address_test.rb +1 -1
- data/test/base_test.rb +1 -1
- data/test/extensions_test.rb +1 -59
- data/test/info_test.rb +1 -1
- data/test/response_test.rb +2 -1
- data/test/send_email_test.rb +1 -1
- metadata +3 -3
data/CHANGELOG
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
0.4.1:
|
2
|
+
* Removed many unneeded monkeypatch extensions
|
3
|
+
* Tests ( and gem ) run in 1.9.2
|
4
|
+
|
1
5
|
0.4.0:
|
2
6
|
* This version may have some small incompatibilities due to adding support for MessageId. Check that the result still matches what you previously expected.
|
3
7
|
* Added MessageId support in responses
|
data/README.erb
CHANGED
data/README.rdoc
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.1
|
data/aws-ses.gemspec
CHANGED
data/lib/aws/ses/extensions.rb
CHANGED
@@ -1,75 +1,4 @@
|
|
1
1
|
#:stopdoc:
|
2
|
-
class String
|
3
|
-
if RUBY_VERSION <= '1.9'
|
4
|
-
def previous!
|
5
|
-
self[-1] -= 1
|
6
|
-
self
|
7
|
-
end
|
8
|
-
else
|
9
|
-
def previous!
|
10
|
-
self[-1] = (self[-1].ord - 1).chr
|
11
|
-
self
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
def previous
|
16
|
-
dup.previous!
|
17
|
-
end
|
18
|
-
|
19
|
-
def to_header
|
20
|
-
downcase.tr('_', '-')
|
21
|
-
end
|
22
|
-
|
23
|
-
# ActiveSupport adds an underscore method to String so let's just use that one if
|
24
|
-
# we find that the method is already defined
|
25
|
-
def underscore
|
26
|
-
gsub(/::/, '/').
|
27
|
-
gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
|
28
|
-
gsub(/([a-z\d])([A-Z])/,'\1_\2').
|
29
|
-
tr("-", "_").downcase
|
30
|
-
end unless public_method_defined? :underscore
|
31
|
-
|
32
|
-
if RUBY_VERSION >= '1.9'
|
33
|
-
def valid_utf8?
|
34
|
-
dup.force_encoding('UTF-8').valid_encoding?
|
35
|
-
end
|
36
|
-
else
|
37
|
-
def valid_utf8?
|
38
|
-
scan(Regexp.new('[^\x00-\xa0]', nil, 'u')) { |s| s.unpack('U') }
|
39
|
-
true
|
40
|
-
rescue ArgumentError
|
41
|
-
false
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
# All paths in in S3 have to be valid unicode so this takes care of
|
46
|
-
# cleaning up any strings that aren't valid utf-8 according to String#valid_utf8?
|
47
|
-
if RUBY_VERSION >= '1.9'
|
48
|
-
def remove_extended!
|
49
|
-
sanitized_string = ''
|
50
|
-
each_byte do |byte|
|
51
|
-
character = byte.chr
|
52
|
-
sanitized_string << character if character.ascii_only?
|
53
|
-
end
|
54
|
-
sanitized_string
|
55
|
-
end
|
56
|
-
else
|
57
|
-
def remove_extended!
|
58
|
-
gsub!(/[\x80-\xFF]/) { "%02X" % $&[0] }
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
def remove_extended
|
63
|
-
dup.remove_extended!
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
class Symbol
|
68
|
-
def to_header
|
69
|
-
to_s.to_header
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
2
|
module Kernel
|
74
3
|
def __method__(depth = 0)
|
75
4
|
caller[depth][/`([^']+)'/, 1]
|
@@ -91,20 +20,6 @@ module Kernel
|
|
91
20
|
end
|
92
21
|
instance_variable_set(storage, yield)
|
93
22
|
end
|
94
|
-
|
95
|
-
def require_library_or_gem(library, gem_name = nil)
|
96
|
-
if RUBY_VERSION >= '1.9'
|
97
|
-
gem(gem_name || library, '>=0')
|
98
|
-
end
|
99
|
-
require library
|
100
|
-
rescue LoadError => library_not_installed
|
101
|
-
begin
|
102
|
-
require 'rubygems'
|
103
|
-
require library
|
104
|
-
rescue LoadError
|
105
|
-
raise library_not_installed
|
106
|
-
end
|
107
|
-
end
|
108
23
|
end
|
109
24
|
|
110
25
|
class Module
|
@@ -119,26 +34,6 @@ class Module
|
|
119
34
|
end
|
120
35
|
EVAL
|
121
36
|
end
|
122
|
-
|
123
|
-
def constant(name, value)
|
124
|
-
unless const_defined?(name)
|
125
|
-
const_set(name, value)
|
126
|
-
module_eval(<<-EVAL, __FILE__, __LINE__)
|
127
|
-
def self.#{name.to_s.downcase}
|
128
|
-
#{name.to_s}
|
129
|
-
end
|
130
|
-
EVAL
|
131
|
-
end
|
132
|
-
end
|
133
37
|
end
|
134
38
|
|
135
|
-
|
136
|
-
class XmlGenerator < String #:nodoc:
|
137
|
-
attr_reader :xml
|
138
|
-
def initialize
|
139
|
-
@xml = Builder::XmlMarkup.new(:indent => 2, :target => self)
|
140
|
-
super()
|
141
|
-
build
|
142
|
-
end
|
143
|
-
end
|
144
39
|
#:startdoc:
|
data/lib/aws/ses/version.rb
CHANGED
data/test/address_test.rb
CHANGED
data/test/base_test.rb
CHANGED
data/test/extensions_test.rb
CHANGED
@@ -1,39 +1,4 @@
|
|
1
|
-
require File.
|
2
|
-
|
3
|
-
class StringExtensionsTest < Test::Unit::TestCase
|
4
|
-
def test_previous
|
5
|
-
expectations = {'abc' => 'abb', '123' => '122', '1' => '0'}
|
6
|
-
expectations.each do |before, after|
|
7
|
-
assert_equal after, before.previous
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
def test_to_header
|
12
|
-
transformations = {
|
13
|
-
'foo' => 'foo',
|
14
|
-
:foo => 'foo',
|
15
|
-
'foo-bar' => 'foo-bar',
|
16
|
-
'foo_bar' => 'foo-bar',
|
17
|
-
:foo_bar => 'foo-bar',
|
18
|
-
'Foo-Bar' => 'foo-bar',
|
19
|
-
'Foo_Bar' => 'foo-bar'
|
20
|
-
}
|
21
|
-
|
22
|
-
transformations.each do |before, after|
|
23
|
-
assert_equal after, before.to_header
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
def test_valid_utf8?
|
28
|
-
assert !"318597/620065/GTL_75\24300_A600_A610.zip".valid_utf8?
|
29
|
-
assert "318597/620065/GTL_75£00_A600_A610.zip".valid_utf8?
|
30
|
-
end
|
31
|
-
|
32
|
-
def test_remove_extended
|
33
|
-
assert "318597/620065/GTL_75\24300_A600_A610.zip".remove_extended.valid_utf8?
|
34
|
-
assert "318597/620065/GTL_75£00_A600_A610.zip".remove_extended.valid_utf8?
|
35
|
-
end
|
36
|
-
end
|
1
|
+
require File.expand_path('../helper', __FILE__)
|
37
2
|
|
38
3
|
class KerneltExtensionsTest < Test::Unit::TestCase
|
39
4
|
class Foo
|
@@ -135,29 +100,6 @@ class ModuleExtensionsTest < Test::Unit::TestCase
|
|
135
100
|
assert_equal new_cache, @instance.send(:instance_variable_get, :@quux)
|
136
101
|
end
|
137
102
|
|
138
|
-
def test_constant_setting
|
139
|
-
some_module = Module.new
|
140
|
-
assert !some_module.const_defined?(:FOO)
|
141
|
-
assert_nothing_raised do
|
142
|
-
some_module.constant :FOO, 'bar'
|
143
|
-
end
|
144
|
-
|
145
|
-
assert some_module.const_defined?(:FOO)
|
146
|
-
assert_nothing_raised do
|
147
|
-
some_module::FOO
|
148
|
-
some_module.foo
|
149
|
-
end
|
150
|
-
assert_equal 'bar', some_module::FOO
|
151
|
-
assert_equal 'bar', some_module.foo
|
152
|
-
|
153
|
-
assert_nothing_raised do
|
154
|
-
some_module.constant :FOO, 'baz'
|
155
|
-
end
|
156
|
-
|
157
|
-
assert_equal 'bar', some_module::FOO
|
158
|
-
assert_equal 'bar', some_module.foo
|
159
|
-
end
|
160
|
-
|
161
103
|
private
|
162
104
|
# For 1.9 compatibility
|
163
105
|
def instance_variables_of(object)
|
data/test/info_test.rb
CHANGED
data/test/response_test.rb
CHANGED
data/test/send_email_test.rb
CHANGED
metadata
CHANGED