exactly 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/exactly.gemspec CHANGED
@@ -15,4 +15,5 @@ Gem::Specification.new do |gem|
15
15
  gem.require_paths = ["lib"]
16
16
  gem.version = Exactly::VERSION
17
17
  gem.add_dependency "savon", ">= 0.9.5"
18
+ gem.add_development_dependency "rake"
18
19
  end
@@ -1,4 +1,16 @@
1
1
  module Exactly
2
+ class TriggeredSendFailed < StandardError
3
+ attr_reader :response
4
+ def initialize(response)
5
+ @response = response
6
+ super(message)
7
+ end
8
+
9
+ def message
10
+ @response.to_hash[:create_response][:results][:status_message]
11
+ end
12
+ end
13
+
2
14
  class Client
3
15
  def initialize(username, password)
4
16
  client.wsse.credentials username, password
@@ -53,7 +65,7 @@ module Exactly
53
65
 
54
66
  def triggered_send(customer_key, attributes)
55
67
  attributes_without_email = attributes.reject{|k,v| k == :email}
56
- client.request "CreateRequest", :xmlns => "http://exacttarget.com/wsdl/partnerAPI" do
68
+ response = client.request "CreateRequest", :xmlns => "http://exacttarget.com/wsdl/partnerAPI" do
57
69
  http.headers['SOAPAction'] = 'Create'
58
70
  soap.body = {
59
71
  "Objects" => {
@@ -71,6 +83,9 @@ module Exactly
71
83
  :attributes! => { "Objects" => { "xsi:type" => "TriggeredSend" }}
72
84
  }
73
85
  end
86
+ if response.to_hash[:create_response][:overall_status] != 'OK'
87
+ raise Exactly::TriggeredSendFailed.new(response)
88
+ end
74
89
  end
75
90
  end
76
91
  end
@@ -1,3 +1,3 @@
1
1
  module Exactly
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,39 +1,58 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: exactly
3
- version: !ruby/object:Gem::Version
4
- version: 0.0.2
5
- prerelease:
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 3
9
+ version: 0.0.3
6
10
  platform: ruby
7
- authors:
11
+ authors:
8
12
  - Jacob Atzen
9
13
  autorequire:
10
14
  bindir: bin
11
15
  cert_chain: []
12
- date: 2012-07-26 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: savon
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: 0.9.5
16
+
17
+ date: 2012-12-07 00:00:00 +01:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
22
21
  type: :runtime
23
- prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
22
+ version_requirements: &id001 !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ segments:
27
+ - 0
28
+ - 9
29
+ - 5
29
30
  version: 0.9.5
31
+ name: savon
32
+ requirement: *id001
33
+ prerelease: false
34
+ - !ruby/object:Gem::Dependency
35
+ type: :development
36
+ version_requirements: &id002 !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ segments:
41
+ - 0
42
+ version: "0"
43
+ name: rake
44
+ requirement: *id002
45
+ prerelease: false
30
46
  description: ExactTarget SOAP API client
31
- email:
47
+ email:
32
48
  - jacob@incremental.dk
33
49
  executables: []
50
+
34
51
  extensions: []
52
+
35
53
  extra_rdoc_files: []
36
- files:
54
+
55
+ files:
37
56
  - .gitignore
38
57
  - Gemfile
39
58
  - LICENSE
@@ -43,28 +62,35 @@ files:
43
62
  - lib/exactly.rb
44
63
  - lib/exactly/client.rb
45
64
  - lib/exactly/version.rb
65
+ has_rdoc: true
46
66
  homepage: http://github.com/lokalebasen/exactly
47
67
  licenses: []
68
+
48
69
  post_install_message:
49
70
  rdoc_options: []
50
- require_paths:
71
+
72
+ require_paths:
51
73
  - lib
52
- required_ruby_version: !ruby/object:Gem::Requirement
53
- none: false
54
- requirements:
55
- - - ! '>='
56
- - !ruby/object:Gem::Version
57
- version: '0'
58
- required_rubygems_version: !ruby/object:Gem::Requirement
59
- none: false
60
- requirements:
61
- - - ! '>='
62
- - !ruby/object:Gem::Version
63
- version: '0'
74
+ required_ruby_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ segments:
79
+ - 0
80
+ version: "0"
81
+ required_rubygems_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ segments:
86
+ - 0
87
+ version: "0"
64
88
  requirements: []
89
+
65
90
  rubyforge_project:
66
- rubygems_version: 1.8.24
91
+ rubygems_version: 1.3.6
67
92
  signing_key:
68
93
  specification_version: 3
69
94
  summary: Making it easier to interact with ExactTargets SOAP API
70
95
  test_files: []
96
+