jangomail-mailer 0.0.1 → 0.0.2

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.
@@ -55,15 +55,6 @@ module Jangomail
55
55
  raise ArgumentError.new('A sender (Return-Path, Sender or From) required to send a message')
56
56
  end
57
57
 
58
- option_str = settings[:options].inject([]) do |arr, option|
59
- val = case option[1]
60
- when TrueClass then 'True'
61
- when FalseClass then 'False'
62
- else option[1].to_s
63
- end
64
- arr << "#{option[0].to_s}=#{val}"
65
- end.join(',')
66
-
67
58
  {
68
59
  'Username' => settings[:user_name],
69
60
  'Password' => settings[:password],
@@ -73,8 +64,20 @@ module Jangomail
73
64
  'Subject' => mail.subject,
74
65
  'MessagePlain' => mail.multipart? ? mail.text_part.body.to_s : mail.body.to_s,
75
66
  'MessageHTML' => mail.multipart? ? mail.html_part.body.to_s : mail.body.to_s,
76
- 'Options' => option_str,
67
+ 'Options' => stringified_options,
77
68
  }.map{ |k, v| "#{CGI.escape(k)}=#{CGI.escape(v)}"}.join('&')
69
+
70
+ end
71
+
72
+ def stringified_options
73
+ settings[:options].map do |k, v|
74
+ val = case v
75
+ when TrueClass then 'True'
76
+ when FalseClass then 'False'
77
+ else v.to_s
78
+ end
79
+ "#{k.to_s}=#{val}"
80
+ end.join(',')
78
81
  end
79
82
  end
80
83
  end
@@ -1,3 +1,3 @@
1
1
  module Jangomail
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jangomail-mailer
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jason Rust