sqwiggle-ruby 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/.gitignore +21 -0
- data/.rspec +2 -0
- data/.travis.yml +22 -0
- data/Gemfile +8 -0
- data/LICENSE +20 -0
- data/LICENSE.txt +22 -0
- data/README.md +31 -0
- data/Rakefile +1 -0
- data/lib/sqwiggle/client.rb +47 -0
- data/lib/sqwiggle/error_handler.rb +12 -0
- data/lib/sqwiggle/errors/authentication_error.rb +6 -0
- data/lib/sqwiggle/errors/authorization_error.rb +5 -0
- data/lib/sqwiggle/errors/bad_request_error.rb +6 -0
- data/lib/sqwiggle/errors/not_found_error.rb +5 -0
- data/lib/sqwiggle/errors/payment_required_error.rb +5 -0
- data/lib/sqwiggle/errors/server_error.rb +5 -0
- data/lib/sqwiggle/invite.rb +6 -0
- data/lib/sqwiggle/message.rb +13 -0
- data/lib/sqwiggle/resource.rb +39 -0
- data/lib/sqwiggle/service.rb +19 -0
- data/lib/sqwiggle/user.rb +6 -0
- data/lib/sqwiggle/version.rb +3 -0
- data/lib/sqwiggle-ruby.rb +28 -0
- data/spec/client_spec.rb +40 -0
- data/spec/errors_spec.rb +102 -0
- data/spec/message_spec.rb +22 -0
- data/spec/resource_behaviour.rb +6 -0
- data/spec/resource_spec.rb +29 -0
- data/spec/spec_helper.rb +4 -0
- data/spec/sqwiggle_spec.rb +14 -0
- data/spec/user_spec.rb +6 -0
- data/sqwiggle-ruby.gemspec +26 -0
- metadata +140 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 01fdd1607b0180d92e3f9ca6c1f9dfe1e3445154
|
4
|
+
data.tar.gz: 3dbf59ea942e0c1dc08939f41cda5074e41b7085
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3a2072b170981a7a5e09af1f4997fd9ca8a8a1c7ccf847838169390e98d808aec4b4978b712ab2e30d6b9cf5e3e8315af8c78621fe8a2e5342eb5536d8cc18c3
|
7
|
+
data.tar.gz: 2a2ffc8b4474f777804ac47aec0ab17b6c706ade7dcdf4620066abbe9be268a51c1b5b5b2633267d6fcf114b56ef2d8ff108e1bf77d4642020935513d341273b
|
data/.gitignore
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
coverage
|
8
|
+
doc/
|
9
|
+
coverage
|
10
|
+
InstalledFiles
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
# YARD artifacts
|
19
|
+
.yardoc
|
20
|
+
_yardoc
|
21
|
+
doc/
|
data/.rspec
ADDED
data/.travis.yml
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
bundler_args: --without development
|
2
|
+
language: ruby
|
3
|
+
rvm:
|
4
|
+
- 1.9.2
|
5
|
+
- 1.9.3
|
6
|
+
- 2.0.0
|
7
|
+
- rbx
|
8
|
+
- ruby-head
|
9
|
+
matrix:
|
10
|
+
include:
|
11
|
+
- rvm: jruby-19mode
|
12
|
+
env: JRUBY_OPTS="$JRUBY_OPTS --debug"
|
13
|
+
- rvm: jruby-20mode
|
14
|
+
env: JRUBY_OPTS="$JRUBY_OPTS --debug"
|
15
|
+
- rvm: jruby-head
|
16
|
+
env: JRUBY_OPTS="$JRUBY_OPTS --debug"
|
17
|
+
allow_failures:
|
18
|
+
- rvm: jruby-head
|
19
|
+
- rvm: rbx
|
20
|
+
- rvm: ruby-head
|
21
|
+
fast_finish: true
|
22
|
+
script: bundle exec rspec
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2013 Sqwiggle
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
7
|
+
the Software without restriction, including without limitation the rights to
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
10
|
+
subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Luke Roberts
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# Sqwiggle::Ruby
|
2
|
+
|
3
|
+
![Build Status](https://api.travis-ci.org/sqwiggle/sqwiggle-ruby.png)
|
4
|
+
|
5
|
+
A Ruby gem for the Sqwiggle API.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
gem 'sqwiggle-ruby'
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install sqwiggle-ruby
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
TODO: Write usage instructions here
|
24
|
+
|
25
|
+
## Contributing
|
26
|
+
|
27
|
+
1. Fork it
|
28
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
29
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
30
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
31
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module Sqwiggle
|
2
|
+
class Client
|
3
|
+
class NoTokenError < StandardError;end;
|
4
|
+
|
5
|
+
attr_accessor :token
|
6
|
+
attr_writer :url #for testing purposes
|
7
|
+
|
8
|
+
def initialize(token=nil)
|
9
|
+
unless @token = token || Sqwiggle.token
|
10
|
+
raise NoTokenError
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def ==(val)
|
15
|
+
self.class == val.class && val.token == token
|
16
|
+
end
|
17
|
+
|
18
|
+
def get(endpoint, params={})
|
19
|
+
connection.get endpoint, params
|
20
|
+
end
|
21
|
+
|
22
|
+
def messages
|
23
|
+
Service.new Message, self
|
24
|
+
end
|
25
|
+
|
26
|
+
def users
|
27
|
+
Service.new User, self
|
28
|
+
end
|
29
|
+
|
30
|
+
private
|
31
|
+
|
32
|
+
def url
|
33
|
+
@url || 'https://api.sqwiggle.com/'
|
34
|
+
end
|
35
|
+
|
36
|
+
def connection
|
37
|
+
@connection ||= Faraday.new(url:url) do |f|
|
38
|
+
f.request :url_encoded # form-encode POST params
|
39
|
+
f.response :logger # log requests to STDOUT
|
40
|
+
f.adapter Faraday.default_adapter # make requests with Net::HTTP
|
41
|
+
f.basic_auth token, 'X'
|
42
|
+
f.use ErrorHandler
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Sqwiggle
|
2
|
+
class ErrorHandler < Faraday::Response::Middleware
|
3
|
+
def on_complete(env)
|
4
|
+
raise Errors::BadRequestError if env[:status] == 400
|
5
|
+
raise Errors::AuthenticationError if env[:status] == 401
|
6
|
+
raise Errors::PaymentRequiredError if env[:status] == 402
|
7
|
+
raise Errors::AuthorizationError if env[:status] == 403
|
8
|
+
raise Errors::NotFoundError if env[:status] == 404
|
9
|
+
raise Errors::ServerError if env[:status] == 500
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module Sqwiggle
|
2
|
+
class Resource
|
3
|
+
|
4
|
+
include Virtus.model
|
5
|
+
|
6
|
+
attribute :client, Client, default: :default_client
|
7
|
+
attribute :id, Integer
|
8
|
+
|
9
|
+
def default_client
|
10
|
+
Client.new
|
11
|
+
end
|
12
|
+
|
13
|
+
class << self
|
14
|
+
|
15
|
+
attr_accessor :endpoint
|
16
|
+
|
17
|
+
def all(client=Client.new)
|
18
|
+
[].tap do |result|
|
19
|
+
JSON.parse(client.get(self.endpoint).body).each do |item|
|
20
|
+
result << self.new(item)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def find(id, client=Client.new)
|
26
|
+
self.new(JSON.parse(client.get("#{endpoint}/#{id}").body))
|
27
|
+
end
|
28
|
+
|
29
|
+
def endpoint
|
30
|
+
@endpoint || default_endpoint
|
31
|
+
end
|
32
|
+
|
33
|
+
def default_endpoint
|
34
|
+
"/#{self.to_s.downcase.split('::').last}s"
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Sqwiggle
|
2
|
+
class Service
|
3
|
+
|
4
|
+
attr_reader :klass, :client
|
5
|
+
|
6
|
+
def initialize(klass, client)
|
7
|
+
@klass, @client = klass, client
|
8
|
+
end
|
9
|
+
|
10
|
+
def all
|
11
|
+
klass.all client
|
12
|
+
end
|
13
|
+
|
14
|
+
def find(id)
|
15
|
+
klass.find id, client
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'faraday'
|
2
|
+
require 'json'
|
3
|
+
require 'virtus'
|
4
|
+
|
5
|
+
require "sqwiggle/version"
|
6
|
+
|
7
|
+
require "sqwiggle/error_handler"
|
8
|
+
require "sqwiggle/service"
|
9
|
+
require "sqwiggle/client"
|
10
|
+
require "sqwiggle/resource"
|
11
|
+
|
12
|
+
require "sqwiggle/errors/authentication_error"
|
13
|
+
require "sqwiggle/errors/authorization_error"
|
14
|
+
require "sqwiggle/errors/bad_request_error"
|
15
|
+
require "sqwiggle/errors/not_found_error"
|
16
|
+
require "sqwiggle/errors/payment_required_error"
|
17
|
+
require "sqwiggle/errors/server_error"
|
18
|
+
|
19
|
+
require "sqwiggle/invite"
|
20
|
+
require "sqwiggle/message"
|
21
|
+
require "sqwiggle/user"
|
22
|
+
|
23
|
+
module Sqwiggle
|
24
|
+
class << self
|
25
|
+
attr_accessor :token
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
data/spec/client_spec.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Sqwiggle::Client do
|
4
|
+
|
5
|
+
|
6
|
+
describe ".new" do
|
7
|
+
before do
|
8
|
+
Sqwiggle.token = nil
|
9
|
+
end
|
10
|
+
context "with a globally specified token" do
|
11
|
+
before do
|
12
|
+
Sqwiggle.token = 'global_token'
|
13
|
+
end
|
14
|
+
context "without specifying a token in the initializer" do
|
15
|
+
subject { Sqwiggle::Client.new }
|
16
|
+
its(:token) { should be == 'global_token' }
|
17
|
+
end
|
18
|
+
context "with specifying a token in the initializer" do
|
19
|
+
subject { Sqwiggle::Client.new 'local_token' }
|
20
|
+
its(:token) { should be == 'local_token' }
|
21
|
+
end
|
22
|
+
end
|
23
|
+
context "without a globally specified token" do
|
24
|
+
it "Raises an error" do
|
25
|
+
expect { Sqwiggle::Client.new }.to raise_error(Sqwiggle::Client::NoTokenError)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe "#get" do
|
31
|
+
subject { Sqwiggle::Client.new 'local_token' }
|
32
|
+
let(:endpoint) { '/users/1' }
|
33
|
+
|
34
|
+
it "delegates to Faraday" do
|
35
|
+
Faraday::Connection.any_instance.should_receive(:get).with(endpoint, {})
|
36
|
+
subject.get endpoint
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
data/spec/errors_spec.rb
ADDED
@@ -0,0 +1,102 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "api error handling" do
|
4
|
+
|
5
|
+
context "400" do
|
6
|
+
before do
|
7
|
+
Sqwiggle.token = 'token'
|
8
|
+
|
9
|
+
stub_request(:get, "https://token:X@api.sqwiggle.com/messages").to_return({
|
10
|
+
:body => "[]",
|
11
|
+
:status => 400,
|
12
|
+
:headers => { 'Content-Length' => 3 }
|
13
|
+
})
|
14
|
+
end
|
15
|
+
|
16
|
+
it "raises an exception" do
|
17
|
+
expect{Sqwiggle::Message.all}.to raise_error(Sqwiggle::Errors::BadRequestError)
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
context "401" do
|
23
|
+
before do
|
24
|
+
Sqwiggle.token = 'token'
|
25
|
+
|
26
|
+
stub_request(:get, "https://token:X@api.sqwiggle.com/messages").to_return({
|
27
|
+
:body => "[]",
|
28
|
+
:status => 401,
|
29
|
+
:headers => { 'Content-Length' => 3 }
|
30
|
+
})
|
31
|
+
end
|
32
|
+
|
33
|
+
it "raises an exception" do
|
34
|
+
expect{Sqwiggle::Message.all}.to raise_error(Sqwiggle::Errors::AuthenticationError)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
context "402" do
|
39
|
+
before do
|
40
|
+
Sqwiggle.token = 'token'
|
41
|
+
|
42
|
+
stub_request(:get, "https://token:X@api.sqwiggle.com/messages").to_return({
|
43
|
+
:body => "[]",
|
44
|
+
:status => 402,
|
45
|
+
:headers => { 'Content-Length' => 3 }
|
46
|
+
})
|
47
|
+
end
|
48
|
+
|
49
|
+
it "raises an exception" do
|
50
|
+
expect{Sqwiggle::Message.all}.to raise_error(Sqwiggle::Errors::PaymentRequiredError)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
context "403" do
|
55
|
+
before do
|
56
|
+
Sqwiggle.token = 'token'
|
57
|
+
|
58
|
+
stub_request(:get, "https://token:X@api.sqwiggle.com/messages").to_return({
|
59
|
+
:body => "[]",
|
60
|
+
:status => 403,
|
61
|
+
:headers => { 'Content-Length' => 3 }
|
62
|
+
})
|
63
|
+
end
|
64
|
+
|
65
|
+
it "raises an exception" do
|
66
|
+
expect{Sqwiggle::Message.all}.to raise_error(Sqwiggle::Errors::AuthorizationError)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
context "404" do
|
71
|
+
before do
|
72
|
+
Sqwiggle.token = 'token'
|
73
|
+
|
74
|
+
stub_request(:get, "https://token:X@api.sqwiggle.com/messages").to_return({
|
75
|
+
:body => "[]",
|
76
|
+
:status => 404,
|
77
|
+
:headers => { 'Content-Length' => 3 }
|
78
|
+
})
|
79
|
+
end
|
80
|
+
|
81
|
+
it "raises an exception" do
|
82
|
+
expect{Sqwiggle::Message.all}.to raise_error(Sqwiggle::Errors::NotFoundError)
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
context "500" do
|
87
|
+
before do
|
88
|
+
Sqwiggle.token = 'token'
|
89
|
+
|
90
|
+
stub_request(:get, "https://token:X@api.sqwiggle.com/messages").to_return({
|
91
|
+
:body => "[]",
|
92
|
+
:status => 500,
|
93
|
+
:headers => { 'Content-Length' => 3 }
|
94
|
+
})
|
95
|
+
end
|
96
|
+
|
97
|
+
it "raises an exception" do
|
98
|
+
expect{Sqwiggle::Message.all}.to raise_error(Sqwiggle::Errors::ServerError)
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Sqwiggle::Message do
|
4
|
+
|
5
|
+
it_behaves_like "a resource"
|
6
|
+
|
7
|
+
before do
|
8
|
+
Sqwiggle.token = 'some_token'
|
9
|
+
end
|
10
|
+
|
11
|
+
describe "initialization" do
|
12
|
+
it "accepts a hash" do
|
13
|
+
m = Sqwiggle::Message.new({text:'some text'})
|
14
|
+
m.text.should be == 'some text'
|
15
|
+
end
|
16
|
+
|
17
|
+
it "ignores extraneous values hash" do
|
18
|
+
m = Sqwiggle::Message.new({text:'some text', extraneous:1})
|
19
|
+
m.text.should be == 'some text'
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Sqwiggle::Resource do
|
4
|
+
|
5
|
+
let(:client) { double('mock_client') }
|
6
|
+
let(:response) { double('faraday_response') }
|
7
|
+
|
8
|
+
before do
|
9
|
+
client.stub(:get).and_return(response)
|
10
|
+
Sqwiggle.token = 'some client'
|
11
|
+
end
|
12
|
+
|
13
|
+
describe ".all" do
|
14
|
+
it "calls the index endpoint" do
|
15
|
+
response.stub(:body).and_return("[{\"a\":1,\"b\":2}]")
|
16
|
+
client.should_receive(:get).with('/resources')
|
17
|
+
Sqwiggle::Resource.all(client)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
describe ".all" do
|
22
|
+
it "calls the index endpoint" do
|
23
|
+
response.stub(:body).and_return("{\"a\":1,\"b\":2}")
|
24
|
+
client.should_receive(:get).with('/resources/1')
|
25
|
+
Sqwiggle::Resource.find(1, client)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Sqwiggle do
|
4
|
+
specify { Sqwiggle }
|
5
|
+
specify { Sqwiggle::Client }
|
6
|
+
specify { Sqwiggle::Message }
|
7
|
+
|
8
|
+
describe ".token=" do
|
9
|
+
before do
|
10
|
+
Sqwiggle.token = 'token'
|
11
|
+
end
|
12
|
+
specify { Sqwiggle.token.should be == 'token' }
|
13
|
+
end
|
14
|
+
end
|
data/spec/user_spec.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'sqwiggle/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "sqwiggle-ruby"
|
8
|
+
spec.version = Sqwiggle::VERSION
|
9
|
+
spec.authors = ["Luke Roberts"]
|
10
|
+
spec.email = ["luke@sqwiggle.com"]
|
11
|
+
spec.description = %q{Ruby wrapper for the sqwiggle API}
|
12
|
+
spec.summary = %q{Ruby wrapper for the sqwiggle API}
|
13
|
+
spec.homepage = ""
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_dependency 'faraday'
|
22
|
+
spec.add_dependency 'virtus'
|
23
|
+
|
24
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
25
|
+
spec.add_development_dependency "rake"
|
26
|
+
end
|
metadata
ADDED
@@ -0,0 +1,140 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sqwiggle-ruby
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Luke Roberts
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-12-22 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: faraday
|
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: virtus
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
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: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.3'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.3'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
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
|
+
description: Ruby wrapper for the sqwiggle API
|
70
|
+
email:
|
71
|
+
- luke@sqwiggle.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- .gitignore
|
77
|
+
- .rspec
|
78
|
+
- .travis.yml
|
79
|
+
- Gemfile
|
80
|
+
- LICENSE
|
81
|
+
- LICENSE.txt
|
82
|
+
- README.md
|
83
|
+
- Rakefile
|
84
|
+
- lib/sqwiggle-ruby.rb
|
85
|
+
- lib/sqwiggle/client.rb
|
86
|
+
- lib/sqwiggle/error_handler.rb
|
87
|
+
- lib/sqwiggle/errors/authentication_error.rb
|
88
|
+
- lib/sqwiggle/errors/authorization_error.rb
|
89
|
+
- lib/sqwiggle/errors/bad_request_error.rb
|
90
|
+
- lib/sqwiggle/errors/not_found_error.rb
|
91
|
+
- lib/sqwiggle/errors/payment_required_error.rb
|
92
|
+
- lib/sqwiggle/errors/server_error.rb
|
93
|
+
- lib/sqwiggle/invite.rb
|
94
|
+
- lib/sqwiggle/message.rb
|
95
|
+
- lib/sqwiggle/resource.rb
|
96
|
+
- lib/sqwiggle/service.rb
|
97
|
+
- lib/sqwiggle/user.rb
|
98
|
+
- lib/sqwiggle/version.rb
|
99
|
+
- spec/client_spec.rb
|
100
|
+
- spec/errors_spec.rb
|
101
|
+
- spec/message_spec.rb
|
102
|
+
- spec/resource_behaviour.rb
|
103
|
+
- spec/resource_spec.rb
|
104
|
+
- spec/spec_helper.rb
|
105
|
+
- spec/sqwiggle_spec.rb
|
106
|
+
- spec/user_spec.rb
|
107
|
+
- sqwiggle-ruby.gemspec
|
108
|
+
homepage: ''
|
109
|
+
licenses:
|
110
|
+
- MIT
|
111
|
+
metadata: {}
|
112
|
+
post_install_message:
|
113
|
+
rdoc_options: []
|
114
|
+
require_paths:
|
115
|
+
- lib
|
116
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
117
|
+
requirements:
|
118
|
+
- - '>='
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: '0'
|
121
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
requirements: []
|
127
|
+
rubyforge_project:
|
128
|
+
rubygems_version: 2.0.3
|
129
|
+
signing_key:
|
130
|
+
specification_version: 4
|
131
|
+
summary: Ruby wrapper for the sqwiggle API
|
132
|
+
test_files:
|
133
|
+
- spec/client_spec.rb
|
134
|
+
- spec/errors_spec.rb
|
135
|
+
- spec/message_spec.rb
|
136
|
+
- spec/resource_behaviour.rb
|
137
|
+
- spec/resource_spec.rb
|
138
|
+
- spec/spec_helper.rb
|
139
|
+
- spec/sqwiggle_spec.rb
|
140
|
+
- spec/user_spec.rb
|