sendhub 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,9 +8,12 @@ require 'json'
8
8
  module Sendhub
9
9
  end
10
10
 
11
- if ENV['RAILS_ENV']
12
- require 'action_mailer'
13
- require 'sendhub/rails'
11
+ if defined? Rails
12
+ if Rails.version =~ /^2./
13
+ require 'sendhub/rails2'
14
+ elsif Rails.version =~ /^3./
15
+ require 'sendhub/rails3'
16
+ end
14
17
  end
15
18
 
16
19
  require 'sendhub/http'
@@ -1,7 +1,7 @@
1
1
  module Sendhub
2
2
  class Client
3
3
 
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.5'
5
5
 
6
6
  def initialize(config=nil)
7
7
  config[:host] ||= 'api.sendhub.net'
File without changes
@@ -0,0 +1,22 @@
1
+ module Sendhub
2
+ class Rails
3
+ def initialize(options)
4
+ @client = Sendhub::Client.new(
5
+ :api_key => options[:api_key],
6
+ :secret_key => options[:secret_key]
7
+ )
8
+ end
9
+
10
+ def deliver!(message)
11
+ res = @client.send_email(
12
+ :from => message.from,
13
+ :to => message.to,
14
+ :subject => message.subject,
15
+ :body => message.body,
16
+ :content_type => message.content_type
17
+ )
18
+ end
19
+ end
20
+ end
21
+
22
+ ActionMailer::Base.add_delivery_method :sendhub, Sendhub::Rails
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sendhub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ hash: 17
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 5
10
+ version: 0.1.5
5
11
  platform: ruby
6
12
  authors:
7
13
  - Richard Taylor
@@ -9,19 +15,25 @@ autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2010-08-21 00:00:00 +01:00
18
+ date: 2010-09-04 00:00:00 +01:00
13
19
  default_executable:
14
20
  dependencies:
15
21
  - !ruby/object:Gem::Dependency
16
22
  name: json
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
20
26
  requirements:
21
27
  - - ">="
22
28
  - !ruby/object:Gem::Version
29
+ hash: 1
30
+ segments:
31
+ - 1
32
+ - 1
33
+ - 9
23
34
  version: 1.1.9
24
- version:
35
+ type: :runtime
36
+ version_requirements: *id001
25
37
  description: sendhub is a Ruby client library for SendHub.net.
26
38
  email: moomerman@gmail.com
27
39
  executables: []
@@ -36,7 +48,8 @@ files:
36
48
  - lib/sendhub.rb
37
49
  - lib/sendhub/client.rb
38
50
  - lib/sendhub/http.rb
39
- - lib/sendhub/rails.rb
51
+ - lib/sendhub/rails2.rb
52
+ - lib/sendhub/rails3.rb
40
53
  - lib/sendhub/response.rb
41
54
  has_rdoc: true
42
55
  homepage: http://sendhub.net/
@@ -49,21 +62,27 @@ rdoc_options:
49
62
  require_paths:
50
63
  - lib
51
64
  required_ruby_version: !ruby/object:Gem::Requirement
65
+ none: false
52
66
  requirements:
53
67
  - - ">="
54
68
  - !ruby/object:Gem::Version
69
+ hash: 3
70
+ segments:
71
+ - 0
55
72
  version: "0"
56
- version:
57
73
  required_rubygems_version: !ruby/object:Gem::Requirement
74
+ none: false
58
75
  requirements:
59
76
  - - ">="
60
77
  - !ruby/object:Gem::Version
78
+ hash: 3
79
+ segments:
80
+ - 0
61
81
  version: "0"
62
- version:
63
82
  requirements: []
64
83
 
65
84
  rubyforge_project: sendhub
66
- rubygems_version: 1.3.5
85
+ rubygems_version: 1.3.7
67
86
  signing_key:
68
87
  specification_version: 2
69
88
  summary: sendhub is a Ruby client library for SendHub.net.