emailyak 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +4 -9
- data/emailyak.gemspec +1 -1
- data/lib/emailyak/version.rb +1 -1
- data/lib/emailyak.rb +6 -10
- metadata +48 -67
data/Gemfile.lock
CHANGED
@@ -1,25 +1,20 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
emailyak (0.0.
|
5
|
-
|
4
|
+
emailyak (0.0.2)
|
5
|
+
json_pure
|
6
6
|
rest-client
|
7
|
-
yajl-ruby (>= 0.8.3)
|
8
7
|
|
9
8
|
GEM
|
10
9
|
remote: http://rubygems.org/
|
11
10
|
specs:
|
12
|
-
|
13
|
-
mime-types (1.
|
11
|
+
json_pure (1.7.5)
|
12
|
+
mime-types (1.19)
|
14
13
|
rest-client (1.6.7)
|
15
14
|
mime-types (>= 1.16)
|
16
|
-
yajl-ruby (0.8.3)
|
17
15
|
|
18
16
|
PLATFORMS
|
19
17
|
ruby
|
20
18
|
|
21
19
|
DEPENDENCIES
|
22
20
|
emailyak!
|
23
|
-
json
|
24
|
-
rest-client
|
25
|
-
yajl-ruby (>= 0.8.3)
|
data/emailyak.gemspec
CHANGED
@@ -19,5 +19,5 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
20
|
s.require_paths = ["lib"]
|
21
21
|
s.add_dependency(%q<rest-client>, [">= 0"])
|
22
|
-
s.add_dependency('
|
22
|
+
s.add_dependency('json_pure', '>= 0')
|
23
23
|
end
|
data/lib/emailyak/version.rb
CHANGED
data/lib/emailyak.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'cgi'
|
2
2
|
require 'set'
|
3
3
|
|
4
|
-
require 'rubygems'
|
5
|
-
require '
|
4
|
+
require 'rubygems'
|
5
|
+
require 'json/pure'
|
6
6
|
require 'openssl'
|
7
7
|
require 'rest_client'
|
8
8
|
|
@@ -94,8 +94,8 @@ module EmailYak
|
|
94
94
|
end
|
95
95
|
|
96
96
|
module Address
|
97
|
-
def self.register(
|
98
|
-
EmailYak.request(:post, 'register/address/', nil,
|
97
|
+
def self.register(address, callback_url, push=true)
|
98
|
+
EmailYak.request(:post, 'register/address/', nil, {"PushEmail" => push, "Address" => address, "CallbackURL" => callback_url})
|
99
99
|
end
|
100
100
|
end
|
101
101
|
|
@@ -134,11 +134,8 @@ module EmailYak
|
|
134
134
|
headers = { :params => params }.merge(headers)
|
135
135
|
payload = nil
|
136
136
|
else
|
137
|
-
|
138
|
-
|
139
137
|
headers = {:content_type => 'application/json'}
|
140
|
-
payload =
|
141
|
-
puts payload
|
138
|
+
payload = JSON.encode(params)
|
142
139
|
end
|
143
140
|
opts = {
|
144
141
|
:method => method,
|
@@ -149,7 +146,6 @@ module EmailYak
|
|
149
146
|
:payload => payload,
|
150
147
|
:timeout => 80
|
151
148
|
}.merge(ssl_opts)
|
152
|
-
# puts params.inspect
|
153
149
|
begin
|
154
150
|
response = execute_request(opts)
|
155
151
|
rescue SocketError => e
|
@@ -176,7 +172,7 @@ module EmailYak
|
|
176
172
|
rbody = response.body
|
177
173
|
rcode = response.code
|
178
174
|
begin
|
179
|
-
resp =
|
175
|
+
resp = JSON::Pure::Parser.parse(rbody)
|
180
176
|
rescue
|
181
177
|
raise APIError.new("Invalid response object from API: #{rbody.inspect} (HTTP response code was #{rcode})")
|
182
178
|
end
|
metadata
CHANGED
@@ -1,65 +1,57 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: emailyak
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 2
|
10
|
-
version: 0.0.2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.3
|
5
|
+
prerelease:
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Scott Ballantyne
|
14
9
|
- Greg Brockman
|
15
10
|
autorequire:
|
16
11
|
bindir: bin
|
17
12
|
cert_chain: []
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
dependencies:
|
22
|
-
- !ruby/object:Gem::Dependency
|
13
|
+
date: 2012-10-04 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
23
16
|
name: rest-client
|
24
|
-
|
25
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
26
18
|
none: false
|
27
|
-
requirements:
|
28
|
-
- -
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
|
31
|
-
segments:
|
32
|
-
- 0
|
33
|
-
version: "0"
|
19
|
+
requirements:
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '0'
|
34
23
|
type: :runtime
|
35
|
-
version_requirements: *id001
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: yajl-ruby
|
38
24
|
prerelease: false
|
39
|
-
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ! '>='
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: '0'
|
31
|
+
- !ruby/object:Gem::Dependency
|
32
|
+
name: json_pure
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
40
34
|
none: false
|
41
|
-
requirements:
|
42
|
-
- -
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
|
45
|
-
segments:
|
46
|
-
- 0
|
47
|
-
- 8
|
48
|
-
- 3
|
49
|
-
version: 0.8.3
|
35
|
+
requirements:
|
36
|
+
- - ! '>='
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0'
|
50
39
|
type: :runtime
|
51
|
-
|
40
|
+
prerelease: false
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ! '>='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
52
47
|
description: making several different emailyak projects into a gem description
|
53
|
-
email:
|
48
|
+
email:
|
54
49
|
- ussballantyne@gmail.com
|
55
50
|
- gdb@gregbrockman.com
|
56
51
|
executables: []
|
57
|
-
|
58
52
|
extensions: []
|
59
|
-
|
60
53
|
extra_rdoc_files: []
|
61
|
-
|
62
|
-
files:
|
54
|
+
files:
|
63
55
|
- .gitignore
|
64
56
|
- Gemfile
|
65
57
|
- Gemfile.lock
|
@@ -68,39 +60,28 @@ files:
|
|
68
60
|
- lib/data/ca-certificates.crt
|
69
61
|
- lib/emailyak.rb
|
70
62
|
- lib/emailyak/version.rb
|
71
|
-
|
72
|
-
homepage: ""
|
63
|
+
homepage: ''
|
73
64
|
licenses: []
|
74
|
-
|
75
65
|
post_install_message:
|
76
66
|
rdoc_options: []
|
77
|
-
|
78
|
-
require_paths:
|
67
|
+
require_paths:
|
79
68
|
- lib
|
80
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
81
70
|
none: false
|
82
|
-
requirements:
|
83
|
-
- -
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
|
86
|
-
|
87
|
-
- 0
|
88
|
-
version: "0"
|
89
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ! '>='
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
90
76
|
none: false
|
91
|
-
requirements:
|
92
|
-
- -
|
93
|
-
- !ruby/object:Gem::Version
|
94
|
-
|
95
|
-
segments:
|
96
|
-
- 0
|
97
|
-
version: "0"
|
77
|
+
requirements:
|
78
|
+
- - ! '>='
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '0'
|
98
81
|
requirements: []
|
99
|
-
|
100
82
|
rubyforge_project: emailyak
|
101
|
-
rubygems_version: 1.
|
83
|
+
rubygems_version: 1.8.21
|
102
84
|
signing_key:
|
103
85
|
specification_version: 3
|
104
86
|
summary: making several different emailyak projects into a gem
|
105
87
|
test_files: []
|
106
|
-
|