purpose-platform-queued-client 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rspec +1 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +3 -0
- data/Gemfile +16 -0
- data/Gemfile.lock +120 -0
- data/LICENSE +20 -0
- data/README.md +17 -0
- data/Rakefile +39 -0
- data/VERSION +1 -0
- data/lib/purpose-platform-queued-client.rb +16 -0
- data/lib/purpose-platform-queued-client/action.rb +32 -0
- data/lib/purpose-platform-queued-client/base.rb +7 -0
- data/lib/purpose-platform-queued-client/client.rb +68 -0
- data/lib/purpose-platform-queued-client/unsubscribe.rb +7 -0
- data/purpose-platform-queued-client.gemspec +79 -0
- data/spec/client_spec.rb +16 -0
- data/spec/spec_helper.rb +46 -0
- metadata +176 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 9c8a6b6b0b727f32670e4b6d6ac8aa7643b8a4ae
|
4
|
+
data.tar.gz: bc5bdd7aaa19531c9f21c81896fef25e74103546
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 005f8995c3f2c48848e351b64825e4f2433d1fb82b50feb099c97369b9aaa365926702f44f6c74adb84f9a82e27b8aac0c341400e6f88209887c58c51ef238cc
|
7
|
+
data.tar.gz: 19cf506f1df638d7cc5d4aa931a7db8a3ced770ffb0496df17693e29592ae3df16e9ecb19670d4d3368129a8fdc74a9acbb7a98132770089a24cb197214c7b6e
|
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--colour
|
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
purpose-platform-queued-client
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.0.0-p645
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
# Add dependencies required to use your gem here.
|
3
|
+
gem 'vertebrae'
|
4
|
+
|
5
|
+
|
6
|
+
# Add dependencies to develop your gem here.
|
7
|
+
# Include everything needed to run rake, tests, features, etc.
|
8
|
+
group :development do
|
9
|
+
gem 'pry'
|
10
|
+
gem 'pry-byebug'
|
11
|
+
gem "webmock", ">=0"
|
12
|
+
gem "rspec", ">=0"
|
13
|
+
gem "shoulda", ">= 0"
|
14
|
+
gem "bundler", "~> 1.0"
|
15
|
+
gem "jeweler", "~> 2.0.1"
|
16
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,120 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
activesupport (4.2.3)
|
5
|
+
i18n (~> 0.7)
|
6
|
+
json (~> 1.7, >= 1.7.7)
|
7
|
+
minitest (~> 5.1)
|
8
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
9
|
+
tzinfo (~> 1.1)
|
10
|
+
addressable (2.3.8)
|
11
|
+
builder (3.2.2)
|
12
|
+
byebug (5.0.0)
|
13
|
+
columnize (= 0.9.0)
|
14
|
+
coderay (1.1.0)
|
15
|
+
columnize (0.9.0)
|
16
|
+
crack (0.4.2)
|
17
|
+
safe_yaml (~> 1.0.0)
|
18
|
+
descendants_tracker (0.0.4)
|
19
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
20
|
+
diff-lcs (1.2.5)
|
21
|
+
faraday (0.9.1)
|
22
|
+
multipart-post (>= 1.2, < 3)
|
23
|
+
faraday_middleware (0.10.0)
|
24
|
+
faraday (>= 0.7.4, < 0.10)
|
25
|
+
git (1.2.9.1)
|
26
|
+
github_api (0.12.3)
|
27
|
+
addressable (~> 2.3)
|
28
|
+
descendants_tracker (~> 0.0.4)
|
29
|
+
faraday (~> 0.8, < 0.10)
|
30
|
+
hashie (>= 3.3)
|
31
|
+
multi_json (>= 1.7.5, < 2.0)
|
32
|
+
nokogiri (~> 1.6.3)
|
33
|
+
oauth2
|
34
|
+
hashie (3.4.2)
|
35
|
+
highline (1.7.2)
|
36
|
+
i18n (0.7.0)
|
37
|
+
jeweler (2.0.1)
|
38
|
+
builder
|
39
|
+
bundler (>= 1.0)
|
40
|
+
git (>= 1.2.5)
|
41
|
+
github_api
|
42
|
+
highline (>= 1.6.15)
|
43
|
+
nokogiri (>= 1.5.10)
|
44
|
+
rake
|
45
|
+
rdoc
|
46
|
+
json (1.8.3)
|
47
|
+
jwt (1.5.1)
|
48
|
+
method_source (0.8.2)
|
49
|
+
mini_portile (0.6.2)
|
50
|
+
minitest (5.7.0)
|
51
|
+
multi_json (1.11.2)
|
52
|
+
multi_xml (0.5.5)
|
53
|
+
multipart-post (2.0.0)
|
54
|
+
nokogiri (1.6.6.2)
|
55
|
+
mini_portile (~> 0.6.0)
|
56
|
+
oauth2 (1.0.0)
|
57
|
+
faraday (>= 0.8, < 0.10)
|
58
|
+
jwt (~> 1.0)
|
59
|
+
multi_json (~> 1.3)
|
60
|
+
multi_xml (~> 0.5)
|
61
|
+
rack (~> 1.2)
|
62
|
+
pry (0.10.1)
|
63
|
+
coderay (~> 1.1.0)
|
64
|
+
method_source (~> 0.8.1)
|
65
|
+
slop (~> 3.4)
|
66
|
+
pry-byebug (3.2.0)
|
67
|
+
byebug (~> 5.0)
|
68
|
+
pry (~> 0.10)
|
69
|
+
rack (1.6.4)
|
70
|
+
rake (10.4.2)
|
71
|
+
rdoc (4.2.0)
|
72
|
+
json (~> 1.4)
|
73
|
+
rspec (3.3.0)
|
74
|
+
rspec-core (~> 3.3.0)
|
75
|
+
rspec-expectations (~> 3.3.0)
|
76
|
+
rspec-mocks (~> 3.3.0)
|
77
|
+
rspec-core (3.3.2)
|
78
|
+
rspec-support (~> 3.3.0)
|
79
|
+
rspec-expectations (3.3.1)
|
80
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
81
|
+
rspec-support (~> 3.3.0)
|
82
|
+
rspec-mocks (3.3.2)
|
83
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
84
|
+
rspec-support (~> 3.3.0)
|
85
|
+
rspec-support (3.3.0)
|
86
|
+
safe_yaml (1.0.4)
|
87
|
+
shoulda (3.5.0)
|
88
|
+
shoulda-context (~> 1.0, >= 1.0.1)
|
89
|
+
shoulda-matchers (>= 1.4.1, < 3.0)
|
90
|
+
shoulda-context (1.2.1)
|
91
|
+
shoulda-matchers (2.8.0)
|
92
|
+
activesupport (>= 3.0.0)
|
93
|
+
slop (3.6.0)
|
94
|
+
thread_safe (0.3.5)
|
95
|
+
tzinfo (1.2.2)
|
96
|
+
thread_safe (~> 0.1)
|
97
|
+
vertebrae (0.2.11)
|
98
|
+
activesupport
|
99
|
+
faraday
|
100
|
+
faraday_middleware
|
101
|
+
hashie
|
102
|
+
webmock (1.21.0)
|
103
|
+
addressable (>= 2.3.6)
|
104
|
+
crack (>= 0.3.2)
|
105
|
+
|
106
|
+
PLATFORMS
|
107
|
+
ruby
|
108
|
+
|
109
|
+
DEPENDENCIES
|
110
|
+
bundler (~> 1.0)
|
111
|
+
jeweler (~> 2.0.1)
|
112
|
+
pry
|
113
|
+
pry-byebug
|
114
|
+
rspec
|
115
|
+
shoulda
|
116
|
+
vertebrae
|
117
|
+
webmock
|
118
|
+
|
119
|
+
BUNDLED WITH
|
120
|
+
1.10.6
|
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2015 ChangeSprout, Inc.
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
11
|
+
copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19
|
+
SOFTWARE.
|
20
|
+
|
data/README.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# purpose-platform-queued-client
|
2
|
+
|
3
|
+
Ruby interface for the queued API service fronting the Purpose Platform which Fight for the Future uses.
|
4
|
+
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
```ruby
|
8
|
+
pp = PurposePlatformQueuedClient.new(host: 'your.queued.purposeplatform.org')
|
9
|
+
pp.action.create(first_name: 'George', last_name: 'Washington', email: 'george@washington.com', org: 'foo')
|
10
|
+
pp.unsubscribe.create(email: 'foo@bar.com')
|
11
|
+
```
|
12
|
+
|
13
|
+
## Copyright
|
14
|
+
|
15
|
+
Copyright (c) 2015 ChangeSprout, Inc. See LICENSE for
|
16
|
+
further details.
|
17
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
# gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
|
17
|
+
gem.name = "purpose-platform-queued-client"
|
18
|
+
gem.homepage = "http://github.com/woodhull/purpose-platform-queued-client"
|
19
|
+
gem.license = "MIT"
|
20
|
+
gem.summary = %Q{FFTF/Purpose Platform API}
|
21
|
+
gem.description = %Q{Ruby interface for the queued API service fronting the Purpose Platform which Fight for the Future uses.}
|
22
|
+
gem.email = "nathan@controlshiftlabs.com"
|
23
|
+
gem.authors = ["Nathan Woodhull"]
|
24
|
+
# dependencies defined in Gemfile
|
25
|
+
end
|
26
|
+
Jeweler::RubygemsDotOrgTasks.new
|
27
|
+
|
28
|
+
require 'rspec/core'
|
29
|
+
require 'rspec/core/rake_task'
|
30
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
31
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
32
|
+
end
|
33
|
+
|
34
|
+
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
35
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
36
|
+
spec.rcov = true
|
37
|
+
end
|
38
|
+
|
39
|
+
task :default => :spec
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.1
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'vertebrae'
|
2
|
+
require 'purpose-platform-queued-client/client'
|
3
|
+
require 'purpose-platform-queued-client/base'
|
4
|
+
require 'purpose-platform-queued-client/action'
|
5
|
+
require 'purpose-platform-queued-client/unsubscribe'
|
6
|
+
|
7
|
+
|
8
|
+
module PurposePlatformQueuedClient
|
9
|
+
extend Vertebrae::Base
|
10
|
+
|
11
|
+
class << self
|
12
|
+
def new(options = {}, &block)
|
13
|
+
PurposePlatformQueuedClient::Client.new(options, &block)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module PurposePlatformQueuedClient
|
2
|
+
class Action < Base
|
3
|
+
# guard: Bot prevention! You must pass a blank string for this field
|
4
|
+
# hp_enabled: Bot prevention! You must pass a checked checkbox for this field. Note the checkbox should be hidden from the user.
|
5
|
+
# hp_disabled: Bot prevention! You must not pass this field, or pass an unchecked checkbox, which should be hidden from the user.
|
6
|
+
# member[first_name]: (String) The first name (or full name) of the user. Since many forms don't collect last name as a separate field, you can put the whole thing in this one.
|
7
|
+
# member[last_name]: (String) Last name of user
|
8
|
+
# member[email]: (String) Email address
|
9
|
+
# member[street_address]: (String) Street address of user
|
10
|
+
# member[postcode]: (String) Zip / Post code of user
|
11
|
+
# member[country]: (String, limit 2 characters) Two character ISO code for country.
|
12
|
+
# tag: (String) The slug name (eg. "save-the-whales') for the campaign.
|
13
|
+
# org: (String) MUST BE "fftf"
|
14
|
+
|
15
|
+
def default_params
|
16
|
+
{
|
17
|
+
guard: '',
|
18
|
+
hp_enabled: '1',
|
19
|
+
hp_disabled: '0'
|
20
|
+
}
|
21
|
+
end
|
22
|
+
|
23
|
+
def base_path
|
24
|
+
'action'
|
25
|
+
end
|
26
|
+
|
27
|
+
def create(params)
|
28
|
+
params = params.merge(default_params)
|
29
|
+
super(params)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
module PurposePlatformQueuedClient
|
2
|
+
class Client < Vertebrae::API
|
3
|
+
def action
|
4
|
+
@action ||= PurposePlatformQueuedClient::Action.new(client: self)
|
5
|
+
end
|
6
|
+
|
7
|
+
def unsubscribe
|
8
|
+
@unsubscribe ||= PurposePlatformQueuedClient::Unsubscribe.new(client: self)
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def default_options
|
14
|
+
{
|
15
|
+
ssl: { verify: false },
|
16
|
+
user_agent: 'PurposePlatformQueuedClient',
|
17
|
+
prefix: '',
|
18
|
+
content_type: 'application/x-www-form-urlencoded'
|
19
|
+
}
|
20
|
+
end
|
21
|
+
|
22
|
+
def request(method, path, params, options) # :nodoc:
|
23
|
+
if !::Vertebrae::Request::METHODS.include?(method)
|
24
|
+
raise ArgumentError, "unknown http method: #{method}"
|
25
|
+
end
|
26
|
+
|
27
|
+
path = connection.configuration.prefix + '/' + path
|
28
|
+
|
29
|
+
::Vertebrae::Base.logger.debug "EXECUTED: #{method} - #{path} with #{params} and #{options}"
|
30
|
+
|
31
|
+
connection.connection.send(method) do |request|
|
32
|
+
|
33
|
+
case method.to_sym
|
34
|
+
when *(::Vertebrae::Request::METHODS - ::Vertebrae::Request::METHODS_WITH_BODIES)
|
35
|
+
request.url(path, params)
|
36
|
+
when *::Vertebrae::Request::METHODS_WITH_BODIES
|
37
|
+
request.path = path
|
38
|
+
request.body = params unless params.empty?
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
|
44
|
+
def extract_data_from_params(params) # :nodoc:
|
45
|
+
if params.has_key?('data') && params['data'].present?
|
46
|
+
return params['data']
|
47
|
+
else
|
48
|
+
return params
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def setup
|
53
|
+
connection.stack do |builder|
|
54
|
+
builder.use Faraday::Request::Multipart
|
55
|
+
builder.use Faraday::Request::UrlEncoded
|
56
|
+
|
57
|
+
builder.use Faraday::Response::Logger if ENV['DEBUG']
|
58
|
+
|
59
|
+
builder.use FaradayMiddleware::Mashify
|
60
|
+
builder.use FaradayMiddleware::ParseJson
|
61
|
+
|
62
|
+
builder.adapter connection.configuration.adapter
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
|
@@ -0,0 +1,79 @@
|
|
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
|
+
# stub: purpose-platform-queued-client 0.0.1 ruby lib
|
6
|
+
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.name = "purpose-platform-queued-client"
|
9
|
+
s.version = "0.0.1"
|
10
|
+
|
11
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib"]
|
13
|
+
s.authors = ["Nathan Woodhull"]
|
14
|
+
s.date = "2015-08-13"
|
15
|
+
s.description = "Ruby interface for the queued API service fronting the Purpose Platform which Fight for the Future uses."
|
16
|
+
s.email = "nathan@controlshiftlabs.com"
|
17
|
+
s.extra_rdoc_files = [
|
18
|
+
"LICENSE",
|
19
|
+
"README.md"
|
20
|
+
]
|
21
|
+
s.files = [
|
22
|
+
".rspec",
|
23
|
+
".ruby-gemset",
|
24
|
+
".ruby-version",
|
25
|
+
".travis.yml",
|
26
|
+
"Gemfile",
|
27
|
+
"Gemfile.lock",
|
28
|
+
"LICENSE",
|
29
|
+
"README.md",
|
30
|
+
"Rakefile",
|
31
|
+
"VERSION",
|
32
|
+
"lib/purpose-platform-queued-client.rb",
|
33
|
+
"lib/purpose-platform-queued-client/action.rb",
|
34
|
+
"lib/purpose-platform-queued-client/base.rb",
|
35
|
+
"lib/purpose-platform-queued-client/client.rb",
|
36
|
+
"lib/purpose-platform-queued-client/unsubscribe.rb",
|
37
|
+
"purpose-platform-queued-client.gemspec",
|
38
|
+
"spec/client_spec.rb",
|
39
|
+
"spec/spec_helper.rb"
|
40
|
+
]
|
41
|
+
s.homepage = "http://github.com/woodhull/purpose-platform-queued-client"
|
42
|
+
s.licenses = ["MIT"]
|
43
|
+
s.rubygems_version = "2.4.8"
|
44
|
+
s.summary = "FFTF/Purpose Platform API"
|
45
|
+
|
46
|
+
if s.respond_to? :specification_version then
|
47
|
+
s.specification_version = 4
|
48
|
+
|
49
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
50
|
+
s.add_runtime_dependency(%q<vertebrae>, [">= 0"])
|
51
|
+
s.add_development_dependency(%q<pry>, [">= 0"])
|
52
|
+
s.add_development_dependency(%q<pry-byebug>, [">= 0"])
|
53
|
+
s.add_development_dependency(%q<webmock>, [">= 0"])
|
54
|
+
s.add_development_dependency(%q<rspec>, [">= 0"])
|
55
|
+
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
56
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0"])
|
57
|
+
s.add_development_dependency(%q<jeweler>, ["~> 2.0.1"])
|
58
|
+
else
|
59
|
+
s.add_dependency(%q<vertebrae>, [">= 0"])
|
60
|
+
s.add_dependency(%q<pry>, [">= 0"])
|
61
|
+
s.add_dependency(%q<pry-byebug>, [">= 0"])
|
62
|
+
s.add_dependency(%q<webmock>, [">= 0"])
|
63
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
64
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
65
|
+
s.add_dependency(%q<bundler>, ["~> 1.0"])
|
66
|
+
s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
|
67
|
+
end
|
68
|
+
else
|
69
|
+
s.add_dependency(%q<vertebrae>, [">= 0"])
|
70
|
+
s.add_dependency(%q<pry>, [">= 0"])
|
71
|
+
s.add_dependency(%q<pry-byebug>, [">= 0"])
|
72
|
+
s.add_dependency(%q<webmock>, [">= 0"])
|
73
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
74
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
75
|
+
s.add_dependency(%q<bundler>, ["~> 1.0"])
|
76
|
+
s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
data/spec/client_spec.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
describe PurposePlatformQueuedClient::Client do
|
4
|
+
specify { expect(subject).to respond_to :action }
|
5
|
+
specify { expect(subject).to respond_to :unsubscribe }
|
6
|
+
|
7
|
+
describe "instantiated" do
|
8
|
+
subject { described_class.new(options) }
|
9
|
+
|
10
|
+
context 'process_basic_auth' do
|
11
|
+
let(:options) { { :host => 'foo.bar.com' } }
|
12
|
+
let(:config) { subject.connection.configuration }
|
13
|
+
specify { expect(config.host).to eq 'foo.bar.com' }
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
|
+
require 'rspec'
|
4
|
+
require 'purpose-platform-queued-client'
|
5
|
+
require 'webmock/rspec'
|
6
|
+
|
7
|
+
|
8
|
+
# Requires supporting files with custom matchers and macros, etc,
|
9
|
+
# in ./support/ and its subdirectories.
|
10
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
11
|
+
|
12
|
+
RSpec.configure do |config|
|
13
|
+
config.color = true
|
14
|
+
end
|
15
|
+
|
16
|
+
RSpec.configure do |config|
|
17
|
+
config.include WebMock::API
|
18
|
+
|
19
|
+
config.before(:each) do
|
20
|
+
WebMock.reset!
|
21
|
+
end
|
22
|
+
config.after(:each) do
|
23
|
+
WebMock.reset!
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def stub_get(path)
|
28
|
+
stub_pp_request(:get, path)
|
29
|
+
end
|
30
|
+
|
31
|
+
def stub_post(path)
|
32
|
+
stub_pp_request(:post, path)
|
33
|
+
end
|
34
|
+
|
35
|
+
def stub_pp_request(method, path)
|
36
|
+
prefix = PurposePlatformQueuedClient.new.connection.configuration.prefix.to_s
|
37
|
+
stub_request(method, "https://test.com" + prefix + path)
|
38
|
+
end
|
39
|
+
|
40
|
+
def fixture_path
|
41
|
+
File.expand_path("../fixtures", __FILE__)
|
42
|
+
end
|
43
|
+
|
44
|
+
def fixture(file)
|
45
|
+
File.new(File.join(fixture_path, '/', file))
|
46
|
+
end
|
metadata
ADDED
@@ -0,0 +1,176 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: purpose-platform-queued-client
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Nathan Woodhull
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-08-13 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: vertebrae
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: pry
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: pry-byebug
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: webmock
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: shoulda
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: bundler
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ~>
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '1.0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ~>
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '1.0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: jeweler
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ~>
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 2.0.1
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ~>
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 2.0.1
|
125
|
+
description: Ruby interface for the queued API service fronting the Purpose Platform
|
126
|
+
which Fight for the Future uses.
|
127
|
+
email: nathan@controlshiftlabs.com
|
128
|
+
executables: []
|
129
|
+
extensions: []
|
130
|
+
extra_rdoc_files:
|
131
|
+
- LICENSE
|
132
|
+
- README.md
|
133
|
+
files:
|
134
|
+
- .rspec
|
135
|
+
- .ruby-gemset
|
136
|
+
- .ruby-version
|
137
|
+
- .travis.yml
|
138
|
+
- Gemfile
|
139
|
+
- Gemfile.lock
|
140
|
+
- LICENSE
|
141
|
+
- README.md
|
142
|
+
- Rakefile
|
143
|
+
- VERSION
|
144
|
+
- lib/purpose-platform-queued-client.rb
|
145
|
+
- lib/purpose-platform-queued-client/action.rb
|
146
|
+
- lib/purpose-platform-queued-client/base.rb
|
147
|
+
- lib/purpose-platform-queued-client/client.rb
|
148
|
+
- lib/purpose-platform-queued-client/unsubscribe.rb
|
149
|
+
- purpose-platform-queued-client.gemspec
|
150
|
+
- spec/client_spec.rb
|
151
|
+
- spec/spec_helper.rb
|
152
|
+
homepage: http://github.com/woodhull/purpose-platform-queued-client
|
153
|
+
licenses:
|
154
|
+
- MIT
|
155
|
+
metadata: {}
|
156
|
+
post_install_message:
|
157
|
+
rdoc_options: []
|
158
|
+
require_paths:
|
159
|
+
- lib
|
160
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
161
|
+
requirements:
|
162
|
+
- - '>='
|
163
|
+
- !ruby/object:Gem::Version
|
164
|
+
version: '0'
|
165
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
166
|
+
requirements:
|
167
|
+
- - '>='
|
168
|
+
- !ruby/object:Gem::Version
|
169
|
+
version: '0'
|
170
|
+
requirements: []
|
171
|
+
rubyforge_project:
|
172
|
+
rubygems_version: 2.4.8
|
173
|
+
signing_key:
|
174
|
+
specification_version: 4
|
175
|
+
summary: FFTF/Purpose Platform API
|
176
|
+
test_files: []
|