sendhub 0.1.18 → 0.1.19

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1c9e086d25240c23d788d7841502cdf0af92c0f6
4
+ data.tar.gz: c7ae42a910b8fce4353d497c316e089fc788f2fb
5
+ SHA512:
6
+ metadata.gz: 050b06285d321fd82b7bfcc60b12b2365728b56b342a5cd5643e8b5a265f4bad6b4bc45a311097eb49eedb92f6313b62ee3ff3df12cf30fac3eab247668ed9ab
7
+ data.tar.gz: aeba6465286e444f3f73777919d8b9c849fc7dbc9256e4132a4c7c1de17918c0878f9588a9d9e8ed8d808193f7db93cbb083be4d2ef4a92d7341e1e256dfb2f0
@@ -1,7 +1,7 @@
1
1
  module Sendhub
2
2
  class Client
3
3
 
4
- VERSION = '0.1.17'
4
+ VERSION = '0.1.19'
5
5
 
6
6
  def initialize(config=nil)
7
7
  config[:host] ||= 'api.sendhub.net'
@@ -9,9 +9,9 @@ module Sendhub
9
9
  end
10
10
 
11
11
  def deliver!(message)
12
-
13
12
  body = message.body
14
13
  body = collect_parts(message) if message.multipart?
14
+ headers = collect_sendhub_headers(message)
15
15
 
16
16
  res = @client.send_email(
17
17
  :from => message.from,
@@ -20,7 +20,8 @@ module Sendhub
20
20
  :subject => message.subject,
21
21
  :body => body,
22
22
  :content_type => message.content_type,
23
- :content_transfer_encoding => message.content_transfer_encoding
23
+ :content_transfer_encoding => message.content_transfer_encoding,
24
+ :headers => headers
24
25
  )
25
26
 
26
27
  puts res.inspect
@@ -29,6 +30,10 @@ module Sendhub
29
30
  def collect_parts(message)
30
31
  message.parts.inject("\n\n\n") {|x, part| x << "--#{message.boundary}\n"; x << "#{part.to_s}\n\n"}
31
32
  end
33
+
34
+ def collect_sendhub_headers(message)
35
+ message.header.fields.find_all{|x| x.name =~ /X-SendHub/}.collect{|x| {x.name => x.value}}
36
+ end
32
37
  end
33
38
  end
34
39
 
metadata CHANGED
@@ -1,30 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sendhub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.18
5
- prerelease:
4
+ version: 0.1.19
6
5
  platform: ruby
7
6
  authors:
8
7
  - Richard Taylor
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-01-14 00:00:00.000000000 Z
11
+ date: 2013-05-23 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: json
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: 1.1.9
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: 1.1.9
30
27
  description: sendhub is a Ruby client library for SendHub.net.
@@ -45,6 +42,7 @@ files:
45
42
  - lib/sendhub/plugins/rails3.rb
46
43
  homepage: http://sendhub.net/
47
44
  licenses: []
45
+ metadata: {}
48
46
  post_install_message:
49
47
  rdoc_options:
50
48
  - --inline-source
@@ -52,20 +50,18 @@ rdoc_options:
52
50
  require_paths:
53
51
  - lib
54
52
  required_ruby_version: !ruby/object:Gem::Requirement
55
- none: false
56
53
  requirements:
57
- - - ! '>='
54
+ - - '>='
58
55
  - !ruby/object:Gem::Version
59
56
  version: '0'
60
57
  required_rubygems_version: !ruby/object:Gem::Requirement
61
- none: false
62
58
  requirements:
63
- - - ! '>='
59
+ - - '>='
64
60
  - !ruby/object:Gem::Version
65
61
  version: '0'
66
62
  requirements: []
67
63
  rubyforge_project: sendhub
68
- rubygems_version: 1.8.24
64
+ rubygems_version: 2.0.0
69
65
  signing_key:
70
66
  specification_version: 2
71
67
  summary: sendhub is a Ruby client library for SendHub.net.