malone 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/malone.rb +15 -2
  3. data/malone.gemspec +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8b1ca8f31cc283952e8c8695856e8d23b786989f
4
- data.tar.gz: 590735c66084e4ac868cc84134bf8ada90e1658e
3
+ metadata.gz: f4b3229ea37426d098ec276c2dd39d4ae51c4d82
4
+ data.tar.gz: 431a420d9f22ff479644b25ea934a680b96db326
5
5
  SHA512:
6
- metadata.gz: 4e970f1a1cc960d86a770eefa0ebecaee36acff06b0bf84e1d58829fbf79b4db501e777016f8b78f68be5550626e4f611dee887183a3680042c2aa2c075f600b
7
- data.tar.gz: 88545a350e515bca0f72043aaa918ea09d77384e7b50f84ab375121373ff8877982c52e3f484cfd19820035526912b467d15016c8ec88a2be8ef2d9ced31f503
6
+ metadata.gz: 5d4f178cc9c09b5eaabbc99afb8450a7b7e8648dc0df33c2ad10adb6e4671f07b96ed597115b6d832de3b067ad2861a6ed4cc514d97a37edb910f20159cef028
7
+ data.tar.gz: 172b40dda19aebe92679fa3b961242dee49b66da5d33a056f79505130d595ba4f99e7fe9f57c092e22ccf876ca45e0dbf60d96305150ada58e996d1e7a311cb3
@@ -33,7 +33,12 @@ class Malone
33
33
  yield mail if block_given?
34
34
 
35
35
  smtp = Net::SMTP.new(config.host, config.port)
36
- smtp.enable_starttls_auto if config.tls
36
+
37
+ if config.force_tls
38
+ smtp.enable_starttls
39
+ elsif config.tls
40
+ smtp.enable_starttls_auto
41
+ end
37
42
 
38
43
  begin
39
44
  smtp.start(config.domain, config.user, config.password, config.auth)
@@ -67,7 +72,7 @@ class Malone
67
72
  attr_accessor :password
68
73
  attr_accessor :domain
69
74
  attr_accessor :tls
70
-
75
+ attr_accessor :force_tls
71
76
  attr :auth
72
77
 
73
78
  def initialize(options)
@@ -84,6 +89,14 @@ class Malone
84
89
  opts[:port] ||= uri.port.to_i
85
90
  opts[:user] ||= unescaped(uri.user)
86
91
  opts[:password] ||= unescaped(uri.password)
92
+
93
+ additional_opts = Hash[uri.query.to_s.split('&').map { |e| e.split('=')}]
94
+
95
+ if additional_opts.has_key?('force_tls')
96
+ @force_tls = true
97
+ elsif additional_opts.has_key?('tls')
98
+ @tls = true
99
+ end
87
100
  end
88
101
 
89
102
  opts.each do |key, val|
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'malone'
3
- s.version = "1.2.0"
3
+ s.version = "1.2.1"
4
4
  s.summary = %{The Mailman}
5
5
  s.description = %{Dead-simple Ruby mailing solution which always delivers.}
6
6
  s.date = "2011-01-10"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: malone
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cyril David
@@ -75,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
75
75
  version: '0'
76
76
  requirements: []
77
77
  rubyforge_project:
78
- rubygems_version: 2.4.5.1
78
+ rubygems_version: 2.5.2.3
79
79
  signing_key:
80
80
  specification_version: 4
81
81
  summary: The Mailman