sessionm-resthome 0.8.1 → 0.8.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.rvmrc +1 -0
- data/Gemfile +9 -7
- data/Gemfile.lock +24 -13
- data/Rakefile +6 -8
- data/VERSION +1 -1
- data/examples/send_grid_web_service.rb +177 -0
- data/lib/active_support/instrumentation.rb +17 -0
- data/lib/resthome/httparty/async_connection_adapter.rb +55 -0
- data/lib/resthome/httparty/persistent_connection_adapter.rb +58 -0
- data/lib/resthome.rb +2 -2
- data/sessionm-resthome.gemspec +86 -0
- data/spec/helper.rb +0 -1
- metadata +101 -34
- data/resthome.gemspec +0 -86
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm 1.9.3-p327@resthome
|
data/Gemfile
CHANGED
@@ -2,15 +2,17 @@ source "http://rubygems.org"
|
|
2
2
|
# Add dependencies required to use your gem here.
|
3
3
|
# Example:
|
4
4
|
# gem "activesupport", ">= 2.3.5"
|
5
|
-
gem "httparty", ">= 0"
|
5
|
+
gem "httparty", ">= 0.11.0"
|
6
6
|
|
7
7
|
# Add dependencies to develop your gem here.
|
8
8
|
# Include everything needed to run rake, tests, features, etc.
|
9
9
|
group :development do
|
10
|
-
gem "
|
11
|
-
gem "jeweler", "~> 1.
|
12
|
-
gem "
|
13
|
-
gem "
|
14
|
-
gem "
|
15
|
-
gem
|
10
|
+
gem "rdoc", "~> 3.12"
|
11
|
+
gem "jeweler", "~> 1.8.4"
|
12
|
+
gem "rspec"
|
13
|
+
gem "rspec-core"
|
14
|
+
gem "rspec-mocks"
|
15
|
+
gem 'rspec-expectations'
|
16
|
+
gem 'json'
|
17
|
+
gem 'fakeweb'
|
16
18
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,28 +1,39 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
|
5
|
-
fakeweb (1.
|
4
|
+
diff-lcs (1.2.4)
|
5
|
+
fakeweb (1.3.0)
|
6
6
|
git (1.2.5)
|
7
|
-
httparty (0.
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
httparty (0.11.0)
|
8
|
+
multi_json (~> 1.0)
|
9
|
+
multi_xml (>= 0.5.2)
|
10
|
+
jeweler (1.8.4)
|
11
|
+
bundler (~> 1.0)
|
11
12
|
git (>= 1.2.5)
|
12
13
|
rake
|
13
|
-
|
14
|
-
|
15
|
-
|
14
|
+
rdoc
|
15
|
+
json (1.8.0)
|
16
|
+
multi_json (1.7.4)
|
17
|
+
multi_xml (0.5.3)
|
18
|
+
rake (10.0.4)
|
19
|
+
rdoc (3.12.2)
|
20
|
+
json (~> 1.4)
|
16
21
|
rspec (1.3.0)
|
22
|
+
rspec-core (2.13.1)
|
23
|
+
rspec-expectations (2.13.0)
|
24
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
25
|
+
rspec-mocks (2.13.1)
|
17
26
|
|
18
27
|
PLATFORMS
|
19
28
|
ruby
|
20
29
|
|
21
30
|
DEPENDENCIES
|
22
|
-
bundler (~> 1.0.0)
|
23
31
|
fakeweb
|
24
|
-
httparty
|
25
|
-
jeweler (~> 1.
|
32
|
+
httparty (>= 0.11.0)
|
33
|
+
jeweler (~> 1.8.4)
|
26
34
|
json
|
27
|
-
|
35
|
+
rdoc (~> 3.12)
|
28
36
|
rspec
|
37
|
+
rspec-core
|
38
|
+
rspec-expectations
|
39
|
+
rspec-mocks
|
data/Rakefile
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
1
3
|
require 'rubygems'
|
2
4
|
require 'bundler'
|
3
5
|
begin
|
@@ -12,23 +14,19 @@ require 'rake'
|
|
12
14
|
require 'jeweler'
|
13
15
|
Jeweler::Tasks.new do |gem|
|
14
16
|
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
15
|
-
gem.name = "resthome"
|
16
|
-
gem.homepage = "http://github.com/
|
17
|
+
gem.name = "sessionm-resthome"
|
18
|
+
gem.homepage = "http://github.com/sessionm/resthome"
|
17
19
|
gem.license = "MIT"
|
18
20
|
gem.summary = %Q{RESTful web services consumer}
|
19
21
|
gem.description = %Q{Simple wrapper class generator for consuming RESTful web services}
|
20
|
-
gem.email = "doug@
|
22
|
+
gem.email = "doug@sessionm.com"
|
21
23
|
gem.authors = ["Doug Youch"]
|
22
|
-
# Include your dependencies below. Runtime dependencies are required when using your gem,
|
23
|
-
# and development dependencies are only needed for development (ie running rake tasks, tests, etc)
|
24
|
-
# gem.add_runtime_dependency 'jabber4r', '> 0.1'
|
25
|
-
# gem.add_development_dependency 'rspec', '> 1.2.3'
|
26
24
|
end
|
27
25
|
Jeweler::RubygemsDotOrgTasks.new
|
28
26
|
|
29
27
|
task :default => :spec
|
30
28
|
|
31
|
-
require '
|
29
|
+
require 'rdoc/task'
|
32
30
|
Rake::RDocTask.new do |rdoc|
|
33
31
|
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
34
32
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.5
|
@@ -0,0 +1,177 @@
|
|
1
|
+
require 'resthome'
|
2
|
+
require 'json'
|
3
|
+
|
4
|
+
class SendGridWebService < RESTHome
|
5
|
+
base_uri 'https://sendgrid.com'
|
6
|
+
|
7
|
+
namespace '/api' do
|
8
|
+
# Profile
|
9
|
+
route :profile, '/profile.get.json', :method => :post, :no_body => true
|
10
|
+
route :set_profile, '/profile.set.json', :method => :post
|
11
|
+
route :set_password, '/password.set.json', :method => :post
|
12
|
+
route :set_username, '/profile.setUsername.json', :method => :post
|
13
|
+
route :set_contact_email, '/profile.setEmail.json', :method => :post
|
14
|
+
|
15
|
+
# Bounces
|
16
|
+
route :bounces, '/bounces.get.json', :method => :post, :no_body => true
|
17
|
+
# delete_bounce 'email' => 'email@to.delete'
|
18
|
+
route :delete_bounce, '/bounces.delete.json', :method => :post
|
19
|
+
|
20
|
+
# Unsubscribes
|
21
|
+
route :unsubscribes, '/unsubscribes.get.json', :method => :post, :no_body => true
|
22
|
+
# delete_unsubscribes 'email' => 'email@to.delete'
|
23
|
+
route :delete_unsubscribes, '/unsubscribes.delete.json', :method => :post
|
24
|
+
# add_unsubscribes 'email' => 'email@to.add'
|
25
|
+
route :add_unsubscribes, '/unsubscribes.add.json', :method => :post
|
26
|
+
|
27
|
+
# Spam Reports
|
28
|
+
route :spam_reports, '/spamreports.get.json', :method => :post, :no_body => true
|
29
|
+
# delete_spam_reports 'email' => 'email@to.delete'
|
30
|
+
route :delete_spam_reports, '/spamreports.delete.json', :method => :post
|
31
|
+
|
32
|
+
# Invalid Emails
|
33
|
+
route :invalid_emails, '/invalidemails.get.json', :method => :post, :no_body => true
|
34
|
+
# delete_invalid_emails 'email' => 'email@to.delete'
|
35
|
+
route :delete_invalid_emails, '/invalidemails.delete.json', :method => :post
|
36
|
+
|
37
|
+
# Statistics
|
38
|
+
route :stats, '/stats.get.json', :method => :post
|
39
|
+
|
40
|
+
# Event Notification Url
|
41
|
+
route :notification_url, '/eventposturl.get.json', :method => :post, :no_body => true
|
42
|
+
# set_notification_url 'url' => 'http://www.YourPostUrlHere.com'
|
43
|
+
route :set_notification_url, '/eventposturl.set.json', :method => :post
|
44
|
+
route :delete_notification_url, '/eventposturl.delete.json', :method => :post, :no_body => true
|
45
|
+
|
46
|
+
# Reseller: Users
|
47
|
+
route :users, '/user.profile.json', :method => :post
|
48
|
+
route :disable_user, '/user.disable.json', :method => :post
|
49
|
+
route :enable_user, '/user.enable.json', :method => :post
|
50
|
+
route :add_user, '/user.add.json', :method => :post
|
51
|
+
route :set_user_password, '/user.password.json', :method => :post
|
52
|
+
|
53
|
+
# Reseller: User Statistics
|
54
|
+
route :user_stats, '/user.stats.json', :method => :post
|
55
|
+
|
56
|
+
# Reseller: User Bounces
|
57
|
+
route :user_bounces, '/user.bounces.json', :method => :post
|
58
|
+
end
|
59
|
+
|
60
|
+
def initialize(username, password)
|
61
|
+
@username = username
|
62
|
+
@password = password
|
63
|
+
end
|
64
|
+
|
65
|
+
def parse_response!; end
|
66
|
+
|
67
|
+
def get_profile
|
68
|
+
data = self.profile
|
69
|
+
data = data[0] if data.is_a?(Array)
|
70
|
+
data
|
71
|
+
end
|
72
|
+
|
73
|
+
def edit_profile(body)
|
74
|
+
self.set_profile body
|
75
|
+
end
|
76
|
+
|
77
|
+
def reset_password(new_password)
|
78
|
+
data = self.set_password 'password' => new_password, 'confirm_password' => new_password
|
79
|
+
if data.is_a?(Hash) && data['message'] == 'success'
|
80
|
+
@password = new_password
|
81
|
+
end
|
82
|
+
data
|
83
|
+
end
|
84
|
+
|
85
|
+
def update_username(new_username)
|
86
|
+
data = self.set_username 'username' => new_username
|
87
|
+
if data.is_a?(Hash) && data['message'] == 'success'
|
88
|
+
@username = new_username
|
89
|
+
end
|
90
|
+
data
|
91
|
+
end
|
92
|
+
|
93
|
+
def update_contact_email(email)
|
94
|
+
self.set_contact_email 'email' => email
|
95
|
+
end
|
96
|
+
|
97
|
+
def get_bounces(date=1)
|
98
|
+
self.bounces :body => {'date' => date}
|
99
|
+
end
|
100
|
+
|
101
|
+
def get_unsubscribes(date=1)
|
102
|
+
self.unsubscribes :body => {'date' => date}
|
103
|
+
end
|
104
|
+
|
105
|
+
def get_spam_reports(date=1)
|
106
|
+
self.spam_reports :body => {'date' => date}
|
107
|
+
end
|
108
|
+
|
109
|
+
def get_invalid_emails(date=1)
|
110
|
+
self.invalid_emails :body => {'date' => date}
|
111
|
+
end
|
112
|
+
|
113
|
+
def get_stats_by_days(days=2, category=nil)
|
114
|
+
data = self.stats 'days' => days, 'category' => category
|
115
|
+
data = data[0] if data.is_a?(Array) && category && category.is_a?(String)
|
116
|
+
data
|
117
|
+
end
|
118
|
+
|
119
|
+
def get_stats_by_range(start_date, end_date, category=nil)
|
120
|
+
start_date = start_date.to_s('%Y-%m-%d') if start_date.is_a?(Time)
|
121
|
+
end_date = end_date.to_s('%Y-%m-%d') if end_date.is_a?(Time)
|
122
|
+
data = self.stats 'start_date' => start_date, 'end_date' => end_date, 'category' => category
|
123
|
+
data = data[0] if data.is_a?(Array) && category && category.is_a?(String)
|
124
|
+
data
|
125
|
+
end
|
126
|
+
|
127
|
+
def get_all_time_totals(category=nil)
|
128
|
+
data = self.stats 'aggregate' => 1, 'category' => category
|
129
|
+
data = data[0] if data.is_a?(Array) && category && category.is_a?(String)
|
130
|
+
data
|
131
|
+
end
|
132
|
+
|
133
|
+
def get_categories
|
134
|
+
self.stats 'list' => 'true'
|
135
|
+
end
|
136
|
+
|
137
|
+
def get_notification_url
|
138
|
+
data = self.notification_url
|
139
|
+
data = data[0] if data.is_a?(Array)
|
140
|
+
data
|
141
|
+
end
|
142
|
+
|
143
|
+
# Reseller methods
|
144
|
+
def get_users
|
145
|
+
self.users 'task' => 'get'
|
146
|
+
end
|
147
|
+
|
148
|
+
def get_user(username)
|
149
|
+
data = self.users 'task' => 'get', 'username' => username
|
150
|
+
data = data[0] if data.is_a?(Array)
|
151
|
+
data
|
152
|
+
end
|
153
|
+
|
154
|
+
def edit_user(username, fields={})
|
155
|
+
self.users fields.merge('task' => 'set', 'user' => username)
|
156
|
+
end
|
157
|
+
|
158
|
+
def reset_user_password(username, new_password)
|
159
|
+
self.set_user_password 'user' => username, 'password' => new_password, 'confirm_password' => new_password
|
160
|
+
end
|
161
|
+
|
162
|
+
def change_user_username(username, new_username)
|
163
|
+
self.users 'task' => 'setUsername', 'user' => username, 'username' => new_username
|
164
|
+
end
|
165
|
+
|
166
|
+
def change_user_email(username, email)
|
167
|
+
self.users 'task' => 'setEmail', 'user' => username, 'email' => email
|
168
|
+
end
|
169
|
+
|
170
|
+
def build_options!(options)
|
171
|
+
super
|
172
|
+
options[:body] ||= {}
|
173
|
+
options[:body]['api_user'] = @username
|
174
|
+
options[:body]['api_key'] = @password
|
175
|
+
options[:body].delete('category') if options[:body].has_key?('category') && options[:body]['category'].nil?
|
176
|
+
end
|
177
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class RESTHome
|
2
|
+
def request_with_instrumentation(method, path, options)
|
3
|
+
ActiveSupport::Notifications.instrument("request.resthome", :client => self.class.name, method: method, path: path) do
|
4
|
+
request_without_instrumentation(method, path, options)
|
5
|
+
end
|
6
|
+
end
|
7
|
+
|
8
|
+
alias_method_chain :request, :instrumentation
|
9
|
+
|
10
|
+
class LogSubscriber < ActiveSupport::LogSubscriber
|
11
|
+
def request(event)
|
12
|
+
info '%s (%.1fms) %s %s' % [event.payload[:client], event.duration, event.payload[:method].upcase, event.payload[:path]]
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
RESTHome::LogSubscriber.attach_to :resthome
|
@@ -0,0 +1,55 @@
|
|
1
|
+
class AsyncConnectionAdapter < HTTParty::ConnectionAdapter
|
2
|
+
|
3
|
+
# convert EventMachine::HttpClient to a Net::HTTPResponse
|
4
|
+
class AsyncHTTPResponse < Net::HTTPResponse
|
5
|
+
def initialize(client)
|
6
|
+
headers = client.response_header
|
7
|
+
super headers.http_version, headers.http_status, headers.http_reason
|
8
|
+
@body = client.response
|
9
|
+
@read = true
|
10
|
+
headers.each do |k, v|
|
11
|
+
self.add_field k, v
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
# add a request method to EventMachine::HttpConnection to simulate how Net::HTTP works
|
17
|
+
class AsyncHTTPConnection < EventMachine::HttpConnection
|
18
|
+
def request(raw_request)
|
19
|
+
case raw_request
|
20
|
+
when Net::HTTP::Get
|
21
|
+
AsyncHTTPResponse.new self.get
|
22
|
+
when Net::HTTP::Post
|
23
|
+
AsyncHTTPResponse.new self.post
|
24
|
+
when Net::HTTP::Put
|
25
|
+
AsyncHTTPResponse.new self.put
|
26
|
+
when Net::HTTP::Delete
|
27
|
+
AsyncHTTPResponse.new self.delete
|
28
|
+
when Net::HTTP::Head
|
29
|
+
AsyncHTTPResponse.new self.head
|
30
|
+
else
|
31
|
+
raise "unknown request type #{raw_request}"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def initialize(uri, options)
|
37
|
+
@uri = uri
|
38
|
+
@options = options
|
39
|
+
end
|
40
|
+
|
41
|
+
def connection
|
42
|
+
AsyncHTTPConnection.new.tap do |c|
|
43
|
+
c.connopts = HttpConnectionOptions.new(@uri, @options)
|
44
|
+
c.uri = @uri
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def self.call(uri, options)
|
49
|
+
if EM.reactor_running?
|
50
|
+
self.new(uri, options).connection
|
51
|
+
else
|
52
|
+
HTTParty::ConnectionAdapter.call uri, options
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
class PersistentConnectionAdapter < HTTParty::ConnectionAdapter
|
2
|
+
|
3
|
+
# basically just reconnect if you get an EOFError
|
4
|
+
class PersistentHTTP < Net::HTTP
|
5
|
+
def request_with_retry(req, body = nil, &block)
|
6
|
+
begin
|
7
|
+
request_without_retry req, body, &block
|
8
|
+
rescue EOFError => e # means the server closed the connection most likely
|
9
|
+
@socket.close if @socket and not @socket.closed?
|
10
|
+
connect
|
11
|
+
request_without_retry req, body, &block
|
12
|
+
end
|
13
|
+
end
|
14
|
+
alias request_without_retry request
|
15
|
+
alias request request_with_retry
|
16
|
+
end
|
17
|
+
|
18
|
+
# copied from HTTParty::ConnectionAdapter
|
19
|
+
def connection
|
20
|
+
PersistentHTTP.new(clean_host(uri.host), uri.port, options[:http_proxyaddr], options[:http_proxyport], options[:http_proxyuser], options[:http_proxypass]).tap do |http|
|
21
|
+
http.use_ssl = ssl_implied?(uri)
|
22
|
+
|
23
|
+
attach_ssl_certificates(http, options)
|
24
|
+
|
25
|
+
if options[:timeout] && (options[:timeout].is_a?(Integer) || options[:timeout].is_a?(Float))
|
26
|
+
http.open_timeout = options[:timeout]
|
27
|
+
http.read_timeout = options[:timeout]
|
28
|
+
end
|
29
|
+
|
30
|
+
if options[:debug_output]
|
31
|
+
http.set_debug_output(options[:debug_output])
|
32
|
+
end
|
33
|
+
|
34
|
+
if options[:ciphers]
|
35
|
+
http.ciphers = options[:ciphers]
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def self.start(uri, options)
|
41
|
+
@conn ||= new(uri, options).connection.tap { |c| c.start }
|
42
|
+
end
|
43
|
+
|
44
|
+
def self.close
|
45
|
+
if @conn
|
46
|
+
@conn.finish if @conn.started?
|
47
|
+
@conn = nil
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def self.conn
|
52
|
+
@conn
|
53
|
+
end
|
54
|
+
|
55
|
+
def self.call(uri, options)
|
56
|
+
self.start uri, options
|
57
|
+
end
|
58
|
+
end
|
data/lib/resthome.rb
CHANGED
@@ -300,7 +300,7 @@ class RESTHome
|
|
300
300
|
# Parse an array of Set-cookie headers
|
301
301
|
def save_cookies(data)
|
302
302
|
@cookies ||= {}
|
303
|
-
data.delete_if{ |c| c.
|
303
|
+
data.delete_if{ |c| c.nil? || c.empty? }.collect { |cookie| parts = cookie.split("\; "); parts[0] ? parts[0].split('=') : nil }.each do |c|
|
304
304
|
@cookies[c[0].strip] = c[1].strip if c && c[0] && c[1]
|
305
305
|
end
|
306
306
|
end
|
@@ -338,7 +338,7 @@ class RESTHome
|
|
338
338
|
end
|
339
339
|
|
340
340
|
def _handle_response_object(obj, opts={}) #:nodoc:
|
341
|
-
obj = obj[opts[:resource]]
|
341
|
+
obj = obj[opts[:resource]] if opts[:resource]
|
342
342
|
if opts[:return]
|
343
343
|
if opts[:return].is_a?(Class)
|
344
344
|
obj = opts[:return].new obj
|
@@ -0,0 +1,86 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "sessionm-resthome"
|
8
|
+
s.version = "0.8.5"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Doug Youch"]
|
12
|
+
s.date = "2013-05-31"
|
13
|
+
s.description = "Simple wrapper class generator for consuming RESTful web services"
|
14
|
+
s.email = "doug@sessionm.com"
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE.txt",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".rvmrc",
|
22
|
+
"Gemfile",
|
23
|
+
"Gemfile.lock",
|
24
|
+
"LICENSE.txt",
|
25
|
+
"README.rdoc",
|
26
|
+
"Rakefile",
|
27
|
+
"VERSION",
|
28
|
+
"examples/amazon_product_web_service.rb",
|
29
|
+
"examples/amazon_ses_service.rb",
|
30
|
+
"examples/chargify_web_service.rb",
|
31
|
+
"examples/last_fm_web_service.rb",
|
32
|
+
"examples/send_grid_web_service.rb",
|
33
|
+
"examples/twilio_web_service.rb",
|
34
|
+
"examples/wordpress_web_service.rb",
|
35
|
+
"lib/active_support/instrumentation.rb",
|
36
|
+
"lib/resthome.rb",
|
37
|
+
"lib/resthome/httparty/async_connection_adapter.rb",
|
38
|
+
"lib/resthome/httparty/persistent_connection_adapter.rb",
|
39
|
+
"sessionm-resthome.gemspec",
|
40
|
+
"spec/helper.rb",
|
41
|
+
"spec/lib/resthome_spec.rb",
|
42
|
+
"tasks/spec.rake"
|
43
|
+
]
|
44
|
+
s.homepage = "http://github.com/sessionm/resthome"
|
45
|
+
s.licenses = ["MIT"]
|
46
|
+
s.require_paths = ["lib"]
|
47
|
+
s.rubygems_version = "1.8.23"
|
48
|
+
s.summary = "RESTful web services consumer"
|
49
|
+
|
50
|
+
if s.respond_to? :specification_version then
|
51
|
+
s.specification_version = 3
|
52
|
+
|
53
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
54
|
+
s.add_runtime_dependency(%q<httparty>, [">= 0.11.0"])
|
55
|
+
s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
|
56
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.8.4"])
|
57
|
+
s.add_development_dependency(%q<rspec>, [">= 0"])
|
58
|
+
s.add_development_dependency(%q<rspec-core>, [">= 0"])
|
59
|
+
s.add_development_dependency(%q<rspec-mocks>, [">= 0"])
|
60
|
+
s.add_development_dependency(%q<rspec-expectations>, [">= 0"])
|
61
|
+
s.add_development_dependency(%q<json>, [">= 0"])
|
62
|
+
s.add_development_dependency(%q<fakeweb>, [">= 0"])
|
63
|
+
else
|
64
|
+
s.add_dependency(%q<httparty>, [">= 0.11.0"])
|
65
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
66
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
|
67
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
68
|
+
s.add_dependency(%q<rspec-core>, [">= 0"])
|
69
|
+
s.add_dependency(%q<rspec-mocks>, [">= 0"])
|
70
|
+
s.add_dependency(%q<rspec-expectations>, [">= 0"])
|
71
|
+
s.add_dependency(%q<json>, [">= 0"])
|
72
|
+
s.add_dependency(%q<fakeweb>, [">= 0"])
|
73
|
+
end
|
74
|
+
else
|
75
|
+
s.add_dependency(%q<httparty>, [">= 0.11.0"])
|
76
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
77
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
|
78
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
79
|
+
s.add_dependency(%q<rspec-core>, [">= 0"])
|
80
|
+
s.add_dependency(%q<rspec-mocks>, [">= 0"])
|
81
|
+
s.add_dependency(%q<rspec-expectations>, [">= 0"])
|
82
|
+
s.add_dependency(%q<json>, [">= 0"])
|
83
|
+
s.add_dependency(%q<fakeweb>, [">= 0"])
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
data/spec/helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sessionm-resthome
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,44 +9,59 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-05-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
21
|
+
version: 0.11.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.11.0
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
|
-
name:
|
27
|
-
requirement:
|
31
|
+
name: rdoc
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ~>
|
31
36
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
37
|
+
version: '3.12'
|
33
38
|
type: :development
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '3.12'
|
36
46
|
- !ruby/object:Gem::Dependency
|
37
47
|
name: jeweler
|
38
|
-
requirement:
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
39
49
|
none: false
|
40
50
|
requirements:
|
41
51
|
- - ~>
|
42
52
|
- !ruby/object:Gem::Version
|
43
|
-
version: 1.
|
53
|
+
version: 1.8.4
|
44
54
|
type: :development
|
45
55
|
prerelease: false
|
46
|
-
version_requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.8.4
|
47
62
|
- !ruby/object:Gem::Dependency
|
48
|
-
name:
|
49
|
-
requirement:
|
63
|
+
name: rspec
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
50
65
|
none: false
|
51
66
|
requirements:
|
52
67
|
- - ! '>='
|
@@ -54,10 +69,15 @@ dependencies:
|
|
54
69
|
version: '0'
|
55
70
|
type: :development
|
56
71
|
prerelease: false
|
57
|
-
version_requirements:
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
58
78
|
- !ruby/object:Gem::Dependency
|
59
|
-
name:
|
60
|
-
requirement:
|
79
|
+
name: rspec-core
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
61
81
|
none: false
|
62
82
|
requirements:
|
63
83
|
- - ! '>='
|
@@ -65,10 +85,47 @@ dependencies:
|
|
65
85
|
version: '0'
|
66
86
|
type: :development
|
67
87
|
prerelease: false
|
68
|
-
version_requirements:
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: rspec-mocks
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: rspec-expectations
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
69
126
|
- !ruby/object:Gem::Dependency
|
70
127
|
name: json
|
71
|
-
requirement:
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
72
129
|
none: false
|
73
130
|
requirements:
|
74
131
|
- - ! '>='
|
@@ -76,10 +133,15 @@ dependencies:
|
|
76
133
|
version: '0'
|
77
134
|
type: :development
|
78
135
|
prerelease: false
|
79
|
-
version_requirements:
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
80
142
|
- !ruby/object:Gem::Dependency
|
81
|
-
name:
|
82
|
-
requirement:
|
143
|
+
name: fakeweb
|
144
|
+
requirement: !ruby/object:Gem::Requirement
|
83
145
|
none: false
|
84
146
|
requirements:
|
85
147
|
- - ! '>='
|
@@ -87,7 +149,12 @@ dependencies:
|
|
87
149
|
version: '0'
|
88
150
|
type: :development
|
89
151
|
prerelease: false
|
90
|
-
version_requirements:
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
154
|
+
requirements:
|
155
|
+
- - ! '>='
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '0'
|
91
158
|
description: Simple wrapper class generator for consuming RESTful web services
|
92
159
|
email: doug@sessionm.com
|
93
160
|
executables: []
|
@@ -97,6 +164,7 @@ extra_rdoc_files:
|
|
97
164
|
- README.rdoc
|
98
165
|
files:
|
99
166
|
- .document
|
167
|
+
- .rvmrc
|
100
168
|
- Gemfile
|
101
169
|
- Gemfile.lock
|
102
170
|
- LICENSE.txt
|
@@ -107,10 +175,14 @@ files:
|
|
107
175
|
- examples/amazon_ses_service.rb
|
108
176
|
- examples/chargify_web_service.rb
|
109
177
|
- examples/last_fm_web_service.rb
|
178
|
+
- examples/send_grid_web_service.rb
|
110
179
|
- examples/twilio_web_service.rb
|
111
180
|
- examples/wordpress_web_service.rb
|
181
|
+
- lib/active_support/instrumentation.rb
|
112
182
|
- lib/resthome.rb
|
113
|
-
- resthome.
|
183
|
+
- lib/resthome/httparty/async_connection_adapter.rb
|
184
|
+
- lib/resthome/httparty/persistent_connection_adapter.rb
|
185
|
+
- sessionm-resthome.gemspec
|
114
186
|
- spec/helper.rb
|
115
187
|
- spec/lib/resthome_spec.rb
|
116
188
|
- tasks/spec.rake
|
@@ -127,6 +199,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
127
199
|
- - ! '>='
|
128
200
|
- !ruby/object:Gem::Version
|
129
201
|
version: '0'
|
202
|
+
segments:
|
203
|
+
- 0
|
204
|
+
hash: 3046830809858145187
|
130
205
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
206
|
none: false
|
132
207
|
requirements:
|
@@ -135,16 +210,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
210
|
version: '0'
|
136
211
|
requirements: []
|
137
212
|
rubyforge_project:
|
138
|
-
rubygems_version: 1.8.
|
213
|
+
rubygems_version: 1.8.23
|
139
214
|
signing_key:
|
140
215
|
specification_version: 3
|
141
216
|
summary: RESTful web services consumer
|
142
|
-
test_files:
|
143
|
-
- examples/amazon_product_web_service.rb
|
144
|
-
- examples/amazon_ses_service.rb
|
145
|
-
- examples/chargify_web_service.rb
|
146
|
-
- examples/last_fm_web_service.rb
|
147
|
-
- examples/twilio_web_service.rb
|
148
|
-
- examples/wordpress_web_service.rb
|
149
|
-
- spec/helper.rb
|
150
|
-
- spec/lib/resthome_spec.rb
|
217
|
+
test_files: []
|
data/resthome.gemspec
DELETED
@@ -1,86 +0,0 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
-
# -*- encoding: utf-8 -*-
|
5
|
-
|
6
|
-
Gem::Specification.new do |s|
|
7
|
-
s.name = %q{sessionm-resthome}
|
8
|
-
s.version = "0.8.1"
|
9
|
-
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["Doug Youch"]
|
12
|
-
s.date = %q{2011-03-09}
|
13
|
-
s.description = %q{Simple wrapper class generator for consuming RESTful web services}
|
14
|
-
s.email = %q{doug@sessionm.com}
|
15
|
-
s.extra_rdoc_files = [
|
16
|
-
"LICENSE.txt",
|
17
|
-
"README.rdoc"
|
18
|
-
]
|
19
|
-
s.files = [
|
20
|
-
".document",
|
21
|
-
"Gemfile",
|
22
|
-
"Gemfile.lock",
|
23
|
-
"LICENSE.txt",
|
24
|
-
"README.rdoc",
|
25
|
-
"Rakefile",
|
26
|
-
"VERSION",
|
27
|
-
"examples/amazon_product_web_service.rb",
|
28
|
-
"examples/amazon_ses_service.rb",
|
29
|
-
"examples/chargify_web_service.rb",
|
30
|
-
"examples/last_fm_web_service.rb",
|
31
|
-
"examples/twilio_web_service.rb",
|
32
|
-
"examples/wordpress_web_service.rb",
|
33
|
-
"lib/resthome.rb",
|
34
|
-
"resthome.gemspec",
|
35
|
-
"spec/helper.rb",
|
36
|
-
"spec/lib/resthome_spec.rb",
|
37
|
-
"tasks/spec.rake"
|
38
|
-
]
|
39
|
-
s.homepage = %q{http://github.com/sessionm/resthome}
|
40
|
-
s.licenses = ["MIT"]
|
41
|
-
s.require_paths = ["lib"]
|
42
|
-
s.rubygems_version = %q{1.3.7}
|
43
|
-
s.summary = %q{RESTful web services consumer}
|
44
|
-
s.test_files = [
|
45
|
-
"examples/amazon_product_web_service.rb",
|
46
|
-
"examples/amazon_ses_service.rb",
|
47
|
-
"examples/chargify_web_service.rb",
|
48
|
-
"examples/last_fm_web_service.rb",
|
49
|
-
"examples/twilio_web_service.rb",
|
50
|
-
"examples/wordpress_web_service.rb",
|
51
|
-
"spec/helper.rb",
|
52
|
-
"spec/lib/resthome_spec.rb"
|
53
|
-
]
|
54
|
-
|
55
|
-
if s.respond_to? :specification_version then
|
56
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
57
|
-
s.specification_version = 3
|
58
|
-
|
59
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
60
|
-
s.add_runtime_dependency(%q<httparty>, [">= 0"])
|
61
|
-
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
62
|
-
s.add_development_dependency(%q<jeweler>, ["~> 1.5.1"])
|
63
|
-
s.add_development_dependency(%q<rcov>, [">= 0"])
|
64
|
-
s.add_development_dependency(%q<fakeweb>, [">= 0"])
|
65
|
-
s.add_development_dependency(%q<json>, [">= 0"])
|
66
|
-
s.add_development_dependency(%q<rspec>, [">= 0"])
|
67
|
-
else
|
68
|
-
s.add_dependency(%q<httparty>, [">= 0"])
|
69
|
-
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
70
|
-
s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
|
71
|
-
s.add_dependency(%q<rcov>, [">= 0"])
|
72
|
-
s.add_dependency(%q<fakeweb>, [">= 0"])
|
73
|
-
s.add_dependency(%q<json>, [">= 0"])
|
74
|
-
s.add_dependency(%q<rspec>, [">= 0"])
|
75
|
-
end
|
76
|
-
else
|
77
|
-
s.add_dependency(%q<httparty>, [">= 0"])
|
78
|
-
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
79
|
-
s.add_dependency(%q<jeweler>, ["~> 1.5.1"])
|
80
|
-
s.add_dependency(%q<rcov>, [">= 0"])
|
81
|
-
s.add_dependency(%q<fakeweb>, [">= 0"])
|
82
|
-
s.add_dependency(%q<json>, [">= 0"])
|
83
|
-
s.add_dependency(%q<rspec>, [">= 0"])
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|