createsend 0.3.2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,22 +1,24 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- createsend (0.3.0)
4
+ createsend (1.0.0)
5
5
  hashie (~> 1.0)
6
- httparty (~> 0.7)
6
+ httparty (~> 0.8)
7
7
  json
8
8
 
9
9
  GEM
10
10
  remote: http://rubygems.org/
11
11
  specs:
12
- crack (0.1.8)
13
12
  fakeweb (1.3.0)
14
13
  hashie (1.0.0)
15
- httparty (0.7.4)
16
- crack (= 0.1.8)
14
+ httparty (0.8.0)
15
+ multi_json
16
+ multi_xml
17
17
  jnunemaker-matchy (0.4.0)
18
18
  json (1.5.1)
19
19
  mocha (0.9.12)
20
+ multi_json (0.0.5)
21
+ multi_xml (0.4.0)
20
22
  shoulda (2.11.3)
21
23
 
22
24
  PLATFORMS
@@ -25,9 +27,6 @@ PLATFORMS
25
27
  DEPENDENCIES
26
28
  createsend!
27
29
  fakeweb (~> 1.3)
28
- hashie (~> 1.0)
29
- httparty (~> 0.7)
30
30
  jnunemaker-matchy (~> 0.4)
31
- json
32
31
  mocha (~> 0.9)
33
32
  shoulda (~> 2.11)
data/createsend.gemspec CHANGED
@@ -10,10 +10,10 @@ Gem::Specification.new do |s|
10
10
  s.add_development_dependency('shoulda', '~> 2.11')
11
11
  s.add_runtime_dependency('json')
12
12
  s.add_runtime_dependency('hashie', '~> 1.0')
13
- s.add_runtime_dependency('httparty', '~> 0.7')
13
+ s.add_runtime_dependency('httparty', '~> 0.8')
14
14
  s.name = "createsend"
15
15
  s.author = "James Dennes"
16
- s.description = %q{A library which implements the complete functionality of v3 of the createsend API.}
16
+ s.description = %q{Implements the complete functionality of the createsend API.}
17
17
  s.email = ["jdennes@gmail.com"]
18
18
  s.executables = `git ls-files -- bin/*`.split("\n").map{|f| File.basename(f)}
19
19
  s.files = `git ls-files`.split("\n")
data/lib/createsend.rb CHANGED
@@ -57,6 +57,19 @@ module CreateSend
57
57
  class CreateSend
58
58
  include HTTParty
59
59
 
60
+ class Parser::DealWithCreateSendInvalidJson < HTTParty::Parser
61
+ # The createsend API returns an ID as a string when a 201 Created
62
+ # response is returned. Unfortunately this is invalid json.
63
+ def parse
64
+ begin
65
+ super
66
+ rescue MultiJson::DecodeError => e
67
+ body[1..-2] # Strip surrounding quotes and return as is.
68
+ end
69
+ end
70
+ end
71
+ parser Parser::DealWithCreateSendInvalidJson
72
+
60
73
  headers({
61
74
  'User-Agent' => "createsend-ruby-#{CreateSend::VERSION}",
62
75
  'Content-Type' => 'application/json; charset=utf-8',
@@ -1,3 +1,3 @@
1
1
  module CreateSend
2
- VERSION = "0.3.2" unless defined?(CreateSend::VERSION)
2
+ VERSION = "1.0.0" unless defined?(CreateSend::VERSION)
3
3
  end
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: createsend
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
5
- prerelease:
4
+ prerelease: false
6
5
  segments:
6
+ - 1
7
+ - 0
7
8
  - 0
8
- - 3
9
- - 2
10
- version: 0.3.2
9
+ version: 1.0.0
11
10
  platform: ruby
12
11
  authors:
13
12
  - James Dennes
@@ -15,114 +14,100 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2011-07-11 00:00:00 +10:00
17
+ date: 2011-09-26 00:00:00 +10:00
19
18
  default_executable:
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
21
+ prerelease: false
22
22
  type: :development
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- none: false
23
+ name: fakeweb
24
+ version_requirements: &id001 !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - ~>
27
27
  - !ruby/object:Gem::Version
28
- hash: 9
29
28
  segments:
30
29
  - 1
31
30
  - 3
32
31
  version: "1.3"
33
- version_requirements: *id001
34
- name: fakeweb
35
- prerelease: false
32
+ requirement: *id001
36
33
  - !ruby/object:Gem::Dependency
34
+ prerelease: false
37
35
  type: :development
38
- requirement: &id002 !ruby/object:Gem::Requirement
39
- none: false
36
+ name: jnunemaker-matchy
37
+ version_requirements: &id002 !ruby/object:Gem::Requirement
40
38
  requirements:
41
39
  - - ~>
42
40
  - !ruby/object:Gem::Version
43
- hash: 3
44
41
  segments:
45
42
  - 0
46
43
  - 4
47
44
  version: "0.4"
48
- version_requirements: *id002
49
- name: jnunemaker-matchy
50
- prerelease: false
45
+ requirement: *id002
51
46
  - !ruby/object:Gem::Dependency
47
+ prerelease: false
52
48
  type: :development
53
- requirement: &id003 !ruby/object:Gem::Requirement
54
- none: false
49
+ name: mocha
50
+ version_requirements: &id003 !ruby/object:Gem::Requirement
55
51
  requirements:
56
52
  - - ~>
57
53
  - !ruby/object:Gem::Version
58
- hash: 25
59
54
  segments:
60
55
  - 0
61
56
  - 9
62
57
  version: "0.9"
63
- version_requirements: *id003
64
- name: mocha
65
- prerelease: false
58
+ requirement: *id003
66
59
  - !ruby/object:Gem::Dependency
60
+ prerelease: false
67
61
  type: :development
68
- requirement: &id004 !ruby/object:Gem::Requirement
69
- none: false
62
+ name: shoulda
63
+ version_requirements: &id004 !ruby/object:Gem::Requirement
70
64
  requirements:
71
65
  - - ~>
72
66
  - !ruby/object:Gem::Version
73
- hash: 21
74
67
  segments:
75
68
  - 2
76
69
  - 11
77
70
  version: "2.11"
78
- version_requirements: *id004
79
- name: shoulda
80
- prerelease: false
71
+ requirement: *id004
81
72
  - !ruby/object:Gem::Dependency
73
+ prerelease: false
82
74
  type: :runtime
83
- requirement: &id005 !ruby/object:Gem::Requirement
84
- none: false
75
+ name: json
76
+ version_requirements: &id005 !ruby/object:Gem::Requirement
85
77
  requirements:
86
78
  - - ">="
87
79
  - !ruby/object:Gem::Version
88
- hash: 3
89
80
  segments:
90
81
  - 0
91
82
  version: "0"
92
- version_requirements: *id005
93
- name: json
94
- prerelease: false
83
+ requirement: *id005
95
84
  - !ruby/object:Gem::Dependency
85
+ prerelease: false
96
86
  type: :runtime
97
- requirement: &id006 !ruby/object:Gem::Requirement
98
- none: false
87
+ name: hashie
88
+ version_requirements: &id006 !ruby/object:Gem::Requirement
99
89
  requirements:
100
90
  - - ~>
101
91
  - !ruby/object:Gem::Version
102
- hash: 15
103
92
  segments:
104
93
  - 1
105
94
  - 0
106
95
  version: "1.0"
107
- version_requirements: *id006
108
- name: hashie
109
- prerelease: false
96
+ requirement: *id006
110
97
  - !ruby/object:Gem::Dependency
98
+ prerelease: false
111
99
  type: :runtime
112
- requirement: &id007 !ruby/object:Gem::Requirement
113
- none: false
100
+ name: httparty
101
+ version_requirements: &id007 !ruby/object:Gem::Requirement
114
102
  requirements:
115
103
  - - ~>
116
104
  - !ruby/object:Gem::Version
117
- hash: 5
118
105
  segments:
119
106
  - 0
120
- - 7
121
- version: "0.7"
122
- version_requirements: *id007
123
- name: httparty
124
- prerelease: false
125
- description: A library which implements the complete functionality of v3 of the createsend API.
107
+ - 8
108
+ version: "0.8"
109
+ requirement: *id007
110
+ description: Implements the complete functionality of the createsend API.
126
111
  email:
127
112
  - jdennes@gmail.com
128
113
  executables: []
@@ -209,20 +194,16 @@ rdoc_options: []
209
194
  require_paths:
210
195
  - lib
211
196
  required_ruby_version: !ruby/object:Gem::Requirement
212
- none: false
213
197
  requirements:
214
198
  - - ">="
215
199
  - !ruby/object:Gem::Version
216
- hash: 3
217
200
  segments:
218
201
  - 0
219
202
  version: "0"
220
203
  required_rubygems_version: !ruby/object:Gem::Requirement
221
- none: false
222
204
  requirements:
223
205
  - - ">="
224
206
  - !ruby/object:Gem::Version
225
- hash: 23
226
207
  segments:
227
208
  - 1
228
209
  - 3
@@ -231,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
231
212
  requirements: []
232
213
 
233
214
  rubyforge_project:
234
- rubygems_version: 1.4.2
215
+ rubygems_version: 1.3.6
235
216
  signing_key:
236
217
  specification_version: 3
237
218
  summary: A library which implements the complete functionality of v3 of the createsend API.