tijuana_client 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: bc3a5962b83c0b648a6200e10adadc0fa7ca6c4f
4
- data.tar.gz: d214c2d8cc8757018a9fced9347925ad7038bccc
2
+ SHA256:
3
+ metadata.gz: 65ff48d1275d54698d17e776f5d867d4dbde52e49948071aeac3d51478ba5726
4
+ data.tar.gz: 21365e03c8f171aea81770d7575e3907d15c8f6b70a5f11dfbc137ec45607358
5
5
  SHA512:
6
- metadata.gz: f265e78fa91700bb224830182847f78be7eb9eb8bfe9048641bad7cfb10743c9ea9dc63b58d56815ef76434b4c68bac7f529a5d1511202e9a49f8edf1b05b4b4
7
- data.tar.gz: 463809da9851e9c06acee006f0c155cd684cd0bca4e27e444a47b296f95b924fcc5141e3976356f5f7a17df6349e7375005ce76efc378c8166b0321f8e73f936
6
+ metadata.gz: c56e59412e15ec251e3109a799efd3789f3e7e08dacd2d2e08e550fad1962719ccfc078e1bb709f99a983a6f20bcb286fa2c6ae7b6680146b075e56ba8c8d5f0
7
+ data.tar.gz: 9654f21ba81f3f61e9df0dec004a97a49c335d11f46e72ab2278c3ff8d836c160acef67c70b4a04a4d34ef8a841a84ccb893cce5d59bb2657089fa74c3a2052e
data/.rubocop.yml ADDED
@@ -0,0 +1,26 @@
1
+ AllCops:
2
+ DisabledByDefault: true
3
+
4
+ Security:
5
+ Enabled: true
6
+
7
+ Bundler/DuplicatedGem:
8
+ Enabled: true
9
+ Bundler/InsecureProtocolSource:
10
+ Enabled: true
11
+ Layout/IndentationStyle:
12
+ Enabled: true
13
+ Layout/SpaceInsideRangeLiteral:
14
+ Enabled: true
15
+ Lint:
16
+ Enabled: true
17
+ Lint/RaiseException:
18
+ Enabled: true
19
+ Naming/AsciiIdentifiers:
20
+ Enabled: true
21
+ Naming/ClassAndModuleCamelCase:
22
+ Enabled: true
23
+ Naming/ConstantName:
24
+ Enabled: true
25
+ Naming/FileName:
26
+ Enabled: true
data/.ruby-gemset CHANGED
@@ -1 +1 @@
1
- tijuana_client
1
+ tijuana-client
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.0.0-p247
1
+ 2.6.6
data/.travis.yml ADDED
@@ -0,0 +1,9 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.6
4
+ cache: bundler
5
+ before_install:
6
+ - gem install bundler
7
+ script:
8
+ - bundle exec rspec
9
+ - bundle exec rubocop
data/Gemfile CHANGED
@@ -1,14 +1,17 @@
1
- source "http://rubygems.org"
1
+ # frozen_string_literal: true
2
2
 
3
- gem 'vertebrae'
3
+ source 'http://rubygems.org'
4
+
5
+ gem 'vertebrae', '> 0.6.0'
4
6
 
5
7
  # Add dependencies to develop your gem here.
6
8
  # Include everything needed to run rake, tests, features, etc.
7
9
  group :development do
8
- gem "rspec"
9
- gem 'webmock'
10
+ gem 'bundler'
11
+ gem 'juwelier', git: 'https://github.com/flajann2/juwelier.git'
10
12
  gem 'pry'
11
- gem 'pry-debugger'
12
- gem "bundler"
13
- gem "jeweler", "~> 1.8.4"
13
+ gem 'pry-byebug'
14
+ gem 'rspec'
15
+ gem 'rubocop'
16
+ gem 'webmock'
14
17
  end
data/README.md CHANGED
@@ -1,4 +1,6 @@
1
- tijuana_client_
1
+ tijuana_client
2
2
  =========================
3
3
 
4
+ [![Build Status](https://travis-ci.org/controlshift/tijuana_client.svg)](https://travis-ci.org/controlshift/tijuana_client)
5
+
4
6
  An exceptionally simple client for Getup's Tijuana
data/Rakefile CHANGED
@@ -1,29 +1,29 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require 'rubygems'
4
4
  require 'bundler'
5
5
  begin
6
6
  Bundler.setup(:default, :development)
7
7
  rescue Bundler::BundlerError => e
8
- $stderr.puts e.message
9
- $stderr.puts "Run `bundle install` to install missing gems"
8
+ warn e.message
9
+ warn 'Run `bundle install` to install missing gems'
10
10
  exit e.status_code
11
11
  end
12
12
  require 'rake'
13
13
 
14
- require 'jeweler'
15
- Jeweler::Tasks.new do |gem|
14
+ require 'juwelier'
15
+ Juwelier::Tasks.new do |gem|
16
16
  # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
- gem.name = "tijuana_client"
18
- gem.homepage = "http://github.com/controlshift/tijuana_client"
19
- gem.license = "MIT"
20
- gem.summary = %Q{API client for Tijuana}
21
- gem.description = %Q{An API client for the code that runs Getup.org.au}
22
- gem.email = "nathan@controlshiftlabs.com"
23
- gem.authors = ["Nathan Woodhull"]
17
+ gem.name = 'tijuana_client'
18
+ gem.homepage = 'http://github.com/controlshift/tijuana_client'
19
+ gem.license = 'MIT'
20
+ gem.summary = %(API client for Tijuana)
21
+ gem.description = %(An API client for the code that runs Getup.org.au)
22
+ gem.email = 'nathan@controlshiftlabs.com'
23
+ gem.authors = ['Nathan Woodhull']
24
24
  # dependencies defined in Gemfile
25
25
  end
26
- Jeweler::RubygemsDotOrgTasks.new
26
+ Juwelier::RubygemsDotOrgTasks.new
27
27
 
28
28
  require 'rspec/core'
29
29
  require 'rspec/core/rake_task'
@@ -36,11 +36,11 @@ RSpec::Core::RakeTask.new(:rcov) do |spec|
36
36
  spec.rcov = true
37
37
  end
38
38
 
39
- task :default => :spec
39
+ task default: :spec
40
40
 
41
41
  require 'rdoc/task'
42
42
  Rake::RDocTask.new do |rdoc|
43
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
43
+ version = File.exist?('VERSION') ? File.read('VERSION') : ''
44
44
 
45
45
  rdoc.rdoc_dir = 'rdoc'
46
46
  rdoc.title = "porpoise_external_actions #{version}"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.3.0
@@ -1,4 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'vertebrae'
4
+ require 'tijuana_client/error_middleware'
2
5
  require 'tijuana_client/base'
3
6
  require 'tijuana_client/user'
4
7
  require 'tijuana_client/client'
@@ -11,4 +14,4 @@ module TijuanaClient
11
14
  TijuanaClient::Client.new(options, &block)
12
15
  end
13
16
  end
14
- end
17
+ end
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module TijuanaClient
2
4
  class Base < Vertebrae::Model
3
5
  def normalized_base_path
4
6
  "api/#{base_path}/"
5
7
  end
6
8
  end
7
- end
9
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module TijuanaClient
2
4
  class Client < Vertebrae::API
3
5
  def user
@@ -19,23 +21,20 @@ module TijuanaClient
19
21
  end
20
22
 
21
23
  def request(method, path, params, options) # :nodoc:
22
- if !::Vertebrae::Request::METHODS.include?(method)
23
- raise ArgumentError, "unknown http method: #{method}"
24
- end
24
+ raise ArgumentError, "unknown http method: #{method}" unless ::Vertebrae::Request::METHODS.include?(method)
25
25
 
26
- path = connection.configuration.prefix + '/' + path
26
+ path = "#{connection.configuration.prefix}/#{path}"
27
27
 
28
28
  ::Vertebrae::Base.logger.debug "EXECUTED: #{method} - #{path} with #{params} and #{options}"
29
29
 
30
30
  connection.connection.send(method) do |request|
31
-
32
31
  case method.to_sym
33
- when *(::Vertebrae::Request::METHODS - ::Vertebrae::Request::METHODS_WITH_BODIES)
34
- request.body = params.delete('data') if params.has_key?('data')
35
- request.url(path, params)
36
- when *::Vertebrae::Request::METHODS_WITH_BODIES
37
- request.path = path
38
- request.body = extract_data_from_params(params) unless params.empty?
32
+ when *(::Vertebrae::Request::METHODS - ::Vertebrae::Request::METHODS_WITH_BODIES)
33
+ request.body = params.delete('data') if params.key?('data')
34
+ request.url(path, params)
35
+ when *::Vertebrae::Request::METHODS_WITH_BODIES
36
+ request.path = path
37
+ request.body = extract_data_from_params(params) unless params.empty?
39
38
  end
40
39
  end
41
40
  end
@@ -44,11 +43,14 @@ module TijuanaClient
44
43
  connection.stack do |builder|
45
44
  builder.use Faraday::Request::Multipart
46
45
  builder.use Faraday::Request::UrlEncoded
47
- builder.use Vertebrae::Request::BasicAuth, connection.configuration.authentication if connection.configuration.authenticated?
46
+ if connection.configuration.authenticated?
47
+ builder.use Faraday::Request::BasicAuthentication, connection.configuration.username,
48
+ connection.configuration.password
49
+ end
48
50
 
49
51
  builder.use Faraday::Response::Logger if ENV['DEBUG']
50
52
 
51
- builder.use Vertebrae::Response::RaiseError
53
+ builder.use TijuanaClient::ErrorMiddleware
52
54
  builder.adapter connection.configuration.adapter
53
55
  end
54
56
  end
@@ -56,11 +58,11 @@ module TijuanaClient
56
58
  private
57
59
 
58
60
  def extract_data_from_params(params)
59
- if params.has_key?('data') && params['data'].present?
60
- return "data=#{URI::encode(params['data'])}"
61
+ if params.key?('data') && params['data'].present?
62
+ { 'data' => params['data'] }
61
63
  else
62
- return params
64
+ params
63
65
  end
64
66
  end
65
67
  end
66
- end
68
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TijuanaClient
4
+ class ValidationError < StandardError; end
5
+ class EmailValidationError < StandardError; end
6
+
7
+ class ErrorMiddleware < Faraday::Response::RaiseError
8
+ def on_complete(env)
9
+ case env[:status]
10
+ when 400
11
+ if env.body.present?
12
+ response = JSON.parse(env.body)
13
+ if response['email']&.include?('is invalid')
14
+ raise TijuanaClient::EmailValidationError, response_values(env).to_s
15
+ else
16
+ raise TijuanaClient::ValidationError, response_values(env).to_s
17
+ end
18
+ else
19
+ raise TijuanaClient::ValidationError, response_values(env).to_s
20
+ end
21
+ when 400..600
22
+ raise Faraday::ClientError, response_values(env).to_s
23
+ end
24
+ end
25
+ end
26
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module TijuanaClient
2
4
  class User < Base
3
5
  def base_path
@@ -8,4 +10,4 @@ module TijuanaClient
8
10
  client.post_json_request(normalized_base_path, params)
9
11
  end
10
12
  end
11
- end
13
+ end
data/spec/client_spec.rb CHANGED
@@ -1,17 +1,18 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
1
+ # frozen_string_literal: true
2
+
3
+ require File.expand_path("#{File.dirname(__FILE__)}/spec_helper")
2
4
 
3
5
  describe TijuanaClient::Client do
4
- specify { subject.should respond_to :user }
6
+ specify { expect(subject).to respond_to :user }
5
7
 
6
- describe "instantiated" do
8
+ describe 'instantiated' do
7
9
  subject { described_class.new(options) }
8
10
 
9
11
  context 'process_basic_auth' do
10
- let(:options) { { :basic_auth => 'login:password' } }
11
- let(:config) { subject.connection.configuration }
12
- specify { config.username.should eq 'login' }
13
- specify { config.password.should eq 'password' }
12
+ let(:options) { { basic_auth: 'login:password' } }
13
+ let(:config) { subject.connection.configuration }
14
+ specify { expect(config.username).to eq 'login' }
15
+ specify { expect(config.password).to eq 'password' }
14
16
  end
15
-
16
17
  end
17
18
  end
data/spec/spec_helper.rb CHANGED
@@ -1,30 +1,28 @@
1
+ # frozen_string_literal: true
2
+
1
3
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
4
  $LOAD_PATH.unshift(File.dirname(__FILE__))
3
5
  require 'rspec'
4
6
  require 'tijuana_client'
5
7
  require 'webmock/rspec'
6
8
 
7
-
8
9
  # Requires supporting files with custom matchers and macros, etc,
9
10
  # in ./support/ and its subdirectories.
10
- Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
11
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].sort.each { |f| require f }
11
12
 
12
13
  RSpec.configure do |config|
13
- config.color_enabled = true
14
+ config.color = true
14
15
  end
15
16
 
16
-
17
17
  RSpec.configure do |config|
18
18
  config.include WebMock::API
19
19
 
20
-
21
20
  config.before(:each) do
22
21
  WebMock.reset!
23
22
  end
24
23
  config.after(:each) do
25
24
  WebMock.reset!
26
25
  end
27
-
28
26
  end
29
27
 
30
28
  def stub_get(path)
@@ -37,13 +35,11 @@ end
37
35
 
38
36
  def stub_tijuana_request(method, path)
39
37
  prefix = TijuanaClient.new.connection.configuration.prefix.to_s
40
- stub_request(method, "https://test.com" + prefix + path)
38
+ stub_request(method, "https://test.com#{prefix}#{path}")
41
39
  end
42
40
 
43
-
44
-
45
41
  def fixture_path
46
- File.expand_path("../fixtures", __FILE__)
42
+ File.expand_path('fixtures', __dir__)
47
43
  end
48
44
 
49
45
  def fixture(file)
data/spec/tijuana_spec.rb CHANGED
@@ -1,6 +1,8 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
1
+ # frozen_string_literal: true
2
+
3
+ require File.expand_path("#{File.dirname(__FILE__)}/spec_helper")
2
4
 
3
5
  describe TijuanaClient do
4
- specify { subject.should respond_to :user }
5
- specify { subject.new.should be_a(TijuanaClient::Client)}
6
+ specify { expect(subject).to respond_to :user }
7
+ specify { expect(subject.new).to be_a(TijuanaClient::Client) }
6
8
  end
data/spec/user_spec.rb CHANGED
@@ -1,34 +1,36 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
1
+ # frozen_string_literal: true
2
+
3
+ require File.expand_path("#{File.dirname(__FILE__)}/spec_helper")
2
4
 
3
5
  describe TijuanaClient::User do
4
6
  subject { TijuanaClient.new(host: 'test.com') }
5
7
 
6
8
  describe 'configuration' do
7
9
  it 'should propagate the host' do
8
- subject.user.client.connection.configuration.host.should == 'test.com'
10
+ expect(subject.user.client.connection.configuration.host).to eq('test.com')
9
11
  end
10
12
  end
11
13
 
12
14
  describe '.post_json_request' do
13
15
  let(:client) { TijuanaClient::Client.new }
14
- subject { TijuanaClient::User.new({client: client }) }
16
+ subject { TijuanaClient::User.new({ client: client }) }
15
17
  let(:path) { '/foo' }
16
- let(:params) { {first_name: 'Nathan'} }
18
+ let(:params) { { first_name: 'Nathan' } }
17
19
 
18
20
  it 'should jsonify params' do
19
- client.should_receive(:post_request).with('/foo', {'data' => JSON.generate({ first_name: 'Nathan'}) } )
20
- client.post_json_request(path, params)
21
+ expect(client).to receive(:post_request).with('/foo', { 'data' => JSON.generate({ first_name: 'Nathan' }) })
22
+ client.post_json_request(path, params)
21
23
  end
22
24
  end
23
25
 
24
26
  describe 'create' do
25
27
  let(:body) { '' }
26
- let(:request_body) { "data=#{ URI::encode(JSON.generate({ first_name: 'Nathan'}))}" }
28
+ let(:request_body) { { 'data' => JSON.generate({ first_name: 'Nathan' }) } }
27
29
  let(:request_path) { '/api/users/' }
28
30
 
29
31
  before(:each) do
30
- stub_post(request_path).with(body: request_body).to_return(:body => body, :status => status,
31
- :headers => { content_type: "application/json; charset=utf-8"})
32
+ stub_post(request_path).with(body: request_body).to_return(body: body, status: status,
33
+ headers: { content_type: 'application/json; charset=utf-8' })
32
34
  end
33
35
 
34
36
  describe 'success' do
@@ -42,37 +44,55 @@ describe TijuanaClient::User do
42
44
  describe 'an error' do
43
45
  let(:status) { 500 }
44
46
 
47
+ it 'should raise' do
48
+ expect { subject.user.create(first_name: 'Nathan') }.to raise_exception(StandardError)
49
+ end
50
+ end
51
+
52
+ describe 'generic validation error' do
53
+ let(:status) { 400 }
54
+ let(:body) { '{"foo":["is bar"]}' }
55
+
56
+ it 'should return nil' do
57
+ expect { subject.user.create(first_name: 'Nathan') }.to raise_exception(TijuanaClient::ValidationError)
58
+ end
59
+ end
60
+
61
+ describe 'email validation error' do
62
+ let(:status) { 400 }
63
+ let(:body) { '{"email":["is invalid"]}' }
64
+
45
65
  it 'should return nil' do
46
- lambda { subject.user.create(first_name: 'Nathan') }.should raise_exception
66
+ expect { subject.user.create(first_name: 'Nathan') }.to raise_exception(TijuanaClient::EmailValidationError)
47
67
  end
48
68
  end
49
69
  end
50
70
 
51
- describe "basic authentication" do
52
- subject { TijuanaClient.new(host: 'test.com', username: 'username', password: 'password')}
71
+ describe 'basic authentication' do
72
+ subject { TijuanaClient.new(host: 'test.com', username: 'username', password: 'password') }
53
73
 
54
- let(:body) { "" }
55
- let(:request_body) { "data=#{ URI::encode(JSON.generate({ first_name: 'Nathan'}))}" }
74
+ let(:body) { '' }
75
+ let(:request_body) { { 'data' => JSON.generate({ first_name: 'Nathan' }) } }
56
76
  let(:request_path) { '/api/users/' }
57
77
 
58
78
  before(:each) do
59
- stub_request(:post, "https://username:password@test.com#{request_path}").with(body: request_body).to_return(:body => body, :status => status,
60
- :headers => { content_type: "application/json; charset=utf-8"})
79
+ stub_request(:post, "https://test.com#{request_path}").with(basic_auth: %w[username password], body: request_body)
80
+ .to_return(body: body, status: status, headers: { content_type: 'application/json; charset=utf-8' })
61
81
  end
62
82
 
63
- describe "success" do
83
+ describe 'success' do
64
84
  let(:status) { 200 }
65
85
 
66
- it "should create a user" do
86
+ it 'should create a user' do
67
87
  subject.user.create(first_name: 'Nathan')
68
88
  end
69
89
  end
70
90
 
71
- describe "unauthorized" do
91
+ describe 'unauthorized' do
72
92
  let(:status) { 401 }
73
93
 
74
- it "should return nil" do
75
- lambda { subject.user.create(first_name: 'Nathan') }.should raise_exception
94
+ it 'should return nil' do
95
+ expect { subject.user.create(first_name: 'Nathan') }.to raise_exception(StandardError)
76
96
  end
77
97
  end
78
98
  end
@@ -1,27 +1,29 @@
1
- # Generated by jeweler
1
+ # Generated by juwelier
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
3
+ # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: tijuana_client 0.2.0 ruby lib
5
+ # stub: tijuana_client 0.3.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
- s.name = "tijuana_client"
9
- s.version = "0.2.0"
8
+ s.name = "tijuana_client".freeze
9
+ s.version = "0.3.0"
10
10
 
11
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
- s.authors = ["Nathan Woodhull"]
13
- s.date = "2014-02-28"
14
- s.description = "An API client for the code that runs Getup.org.au"
15
- s.email = "nathan@controlshiftlabs.com"
11
+ s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib".freeze]
13
+ s.authors = ["Nathan Woodhull".freeze]
14
+ s.date = "2021-03-23"
15
+ s.description = "An API client for the code that runs Getup.org.au".freeze
16
+ s.email = "nathan@controlshiftlabs.com".freeze
16
17
  s.extra_rdoc_files = [
17
18
  "LICENSE.txt",
18
19
  "README.md"
19
20
  ]
20
21
  s.files = [
22
+ ".rubocop.yml",
21
23
  ".ruby-gemset",
22
24
  ".ruby-version",
25
+ ".travis.yml",
23
26
  "Gemfile",
24
- "Gemfile.lock",
25
27
  "LICENSE.txt",
26
28
  "README.md",
27
29
  "Rakefile",
@@ -29,6 +31,7 @@ Gem::Specification.new do |s|
29
31
  "lib/tijuana_client.rb",
30
32
  "lib/tijuana_client/base.rb",
31
33
  "lib/tijuana_client/client.rb",
34
+ "lib/tijuana_client/error_middleware.rb",
32
35
  "lib/tijuana_client/user.rb",
33
36
  "spec/client_spec.rb",
34
37
  "spec/spec_helper.rb",
@@ -36,40 +39,42 @@ Gem::Specification.new do |s|
36
39
  "spec/user_spec.rb",
37
40
  "tijuana_client.gemspec"
38
41
  ]
39
- s.homepage = "http://github.com/controlshift/tijuana_client"
40
- s.licenses = ["MIT"]
41
- s.require_paths = ["lib"]
42
- s.rubygems_version = "2.1.10"
43
- s.summary = "API client for Tijuana"
42
+ s.homepage = "http://github.com/controlshift/tijuana_client".freeze
43
+ s.licenses = ["MIT".freeze]
44
+ s.rubygems_version = "3.0.8".freeze
45
+ s.summary = "API client for Tijuana".freeze
44
46
 
45
47
  if s.respond_to? :specification_version then
46
48
  s.specification_version = 4
47
49
 
48
50
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
49
- s.add_runtime_dependency(%q<vertebrae>, [">= 0"])
50
- s.add_development_dependency(%q<rspec>, [">= 0"])
51
- s.add_development_dependency(%q<webmock>, [">= 0"])
52
- s.add_development_dependency(%q<pry>, [">= 0"])
53
- s.add_development_dependency(%q<pry-debugger>, [">= 0"])
54
- s.add_development_dependency(%q<bundler>, [">= 0"])
55
- s.add_development_dependency(%q<jeweler>, ["~> 1.8.4"])
51
+ s.add_runtime_dependency(%q<vertebrae>.freeze, ["> 0.6.0"])
52
+ s.add_development_dependency(%q<bundler>.freeze, [">= 0"])
53
+ s.add_development_dependency(%q<juwelier>.freeze, [">= 0"])
54
+ s.add_development_dependency(%q<pry>.freeze, [">= 0"])
55
+ s.add_development_dependency(%q<pry-byebug>.freeze, [">= 0"])
56
+ s.add_development_dependency(%q<rspec>.freeze, [">= 0"])
57
+ s.add_development_dependency(%q<rubocop>.freeze, [">= 0"])
58
+ s.add_development_dependency(%q<webmock>.freeze, [">= 0"])
56
59
  else
57
- s.add_dependency(%q<vertebrae>, [">= 0"])
58
- s.add_dependency(%q<rspec>, [">= 0"])
59
- s.add_dependency(%q<webmock>, [">= 0"])
60
- s.add_dependency(%q<pry>, [">= 0"])
61
- s.add_dependency(%q<pry-debugger>, [">= 0"])
62
- s.add_dependency(%q<bundler>, [">= 0"])
63
- s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
60
+ s.add_dependency(%q<vertebrae>.freeze, ["> 0.6.0"])
61
+ s.add_dependency(%q<bundler>.freeze, [">= 0"])
62
+ s.add_dependency(%q<juwelier>.freeze, [">= 0"])
63
+ s.add_dependency(%q<pry>.freeze, [">= 0"])
64
+ s.add_dependency(%q<pry-byebug>.freeze, [">= 0"])
65
+ s.add_dependency(%q<rspec>.freeze, [">= 0"])
66
+ s.add_dependency(%q<rubocop>.freeze, [">= 0"])
67
+ s.add_dependency(%q<webmock>.freeze, [">= 0"])
64
68
  end
65
69
  else
66
- s.add_dependency(%q<vertebrae>, [">= 0"])
67
- s.add_dependency(%q<rspec>, [">= 0"])
68
- s.add_dependency(%q<webmock>, [">= 0"])
69
- s.add_dependency(%q<pry>, [">= 0"])
70
- s.add_dependency(%q<pry-debugger>, [">= 0"])
71
- s.add_dependency(%q<bundler>, [">= 0"])
72
- s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
70
+ s.add_dependency(%q<vertebrae>.freeze, ["> 0.6.0"])
71
+ s.add_dependency(%q<bundler>.freeze, [">= 0"])
72
+ s.add_dependency(%q<juwelier>.freeze, [">= 0"])
73
+ s.add_dependency(%q<pry>.freeze, [">= 0"])
74
+ s.add_dependency(%q<pry-byebug>.freeze, [">= 0"])
75
+ s.add_dependency(%q<rspec>.freeze, [">= 0"])
76
+ s.add_dependency(%q<rubocop>.freeze, [">= 0"])
77
+ s.add_dependency(%q<webmock>.freeze, [">= 0"])
73
78
  end
74
79
  end
75
80
 
metadata CHANGED
@@ -1,113 +1,127 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tijuana_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Woodhull
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-28 00:00:00.000000000 Z
11
+ date: 2021-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: vertebrae
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 0.6.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: 0.6.0
27
27
  - !ruby/object:Gem::Dependency
28
- name: rspec
28
+ name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: webmock
42
+ name: juwelier
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: pry
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: pry-debugger
70
+ name: pry-byebug
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: bundler
84
+ name: rspec
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: jeweler
98
+ name: rubocop
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ~>
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: 1.8.4
103
+ version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ~>
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: 1.8.4
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: webmock
113
+ requirement: !ruby/object:Gem::Requirement
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
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
111
125
  description: An API client for the code that runs Getup.org.au
112
126
  email: nathan@controlshiftlabs.com
113
127
  executables: []
@@ -116,10 +130,11 @@ extra_rdoc_files:
116
130
  - LICENSE.txt
117
131
  - README.md
118
132
  files:
119
- - .ruby-gemset
120
- - .ruby-version
133
+ - ".rubocop.yml"
134
+ - ".ruby-gemset"
135
+ - ".ruby-version"
136
+ - ".travis.yml"
121
137
  - Gemfile
122
- - Gemfile.lock
123
138
  - LICENSE.txt
124
139
  - README.md
125
140
  - Rakefile
@@ -127,6 +142,7 @@ files:
127
142
  - lib/tijuana_client.rb
128
143
  - lib/tijuana_client/base.rb
129
144
  - lib/tijuana_client/client.rb
145
+ - lib/tijuana_client/error_middleware.rb
130
146
  - lib/tijuana_client/user.rb
131
147
  - spec/client_spec.rb
132
148
  - spec/spec_helper.rb
@@ -137,24 +153,23 @@ homepage: http://github.com/controlshift/tijuana_client
137
153
  licenses:
138
154
  - MIT
139
155
  metadata: {}
140
- post_install_message:
156
+ post_install_message:
141
157
  rdoc_options: []
142
158
  require_paths:
143
159
  - lib
144
160
  required_ruby_version: !ruby/object:Gem::Requirement
145
161
  requirements:
146
- - - '>='
162
+ - - ">="
147
163
  - !ruby/object:Gem::Version
148
164
  version: '0'
149
165
  required_rubygems_version: !ruby/object:Gem::Requirement
150
166
  requirements:
151
- - - '>='
167
+ - - ">="
152
168
  - !ruby/object:Gem::Version
153
169
  version: '0'
154
170
  requirements: []
155
- rubyforge_project:
156
- rubygems_version: 2.1.10
157
- signing_key:
171
+ rubygems_version: 3.0.8
172
+ signing_key:
158
173
  specification_version: 4
159
174
  summary: API client for Tijuana
160
175
  test_files: []
data/Gemfile.lock DELETED
@@ -1,108 +0,0 @@
1
- GEM
2
- remote: http://rubygems.org/
3
- specs:
4
- activesupport (4.0.0)
5
- i18n (~> 0.6, >= 0.6.4)
6
- minitest (~> 4.2)
7
- multi_json (~> 1.3)
8
- thread_safe (~> 0.1)
9
- tzinfo (~> 0.3.37)
10
- addressable (2.3.5)
11
- atomic (1.1.10)
12
- builder (3.2.2)
13
- coderay (1.0.9)
14
- columnize (0.3.6)
15
- crack (0.4.0)
16
- safe_yaml (~> 0.9.0)
17
- debugger (1.6.1)
18
- columnize (>= 0.3.1)
19
- debugger-linecache (~> 1.2.0)
20
- debugger-ruby_core_source (~> 1.2.3)
21
- debugger-linecache (1.2.0)
22
- debugger-ruby_core_source (1.2.3)
23
- diff-lcs (1.2.4)
24
- faraday (0.8.8)
25
- multipart-post (~> 1.2.0)
26
- faraday_middleware (0.9.0)
27
- faraday (>= 0.7.4, < 0.9)
28
- git (1.2.5)
29
- github_api (0.10.1)
30
- addressable
31
- faraday (~> 0.8.1)
32
- hashie (>= 1.2)
33
- multi_json (~> 1.4)
34
- nokogiri (~> 1.5.2)
35
- oauth2
36
- hashie (2.0.5)
37
- highline (1.6.19)
38
- httpauth (0.2.0)
39
- i18n (0.6.4)
40
- jeweler (1.8.6)
41
- builder
42
- bundler (~> 1.0)
43
- git (>= 1.2.5)
44
- github_api (= 0.10.1)
45
- highline (>= 1.6.15)
46
- nokogiri (= 1.5.10)
47
- rake
48
- rdoc
49
- json (1.8.0)
50
- jwt (0.1.8)
51
- multi_json (>= 1.5)
52
- method_source (0.8.1)
53
- minitest (4.7.5)
54
- multi_json (1.7.7)
55
- multi_xml (0.5.4)
56
- multipart-post (1.2.0)
57
- nokogiri (1.5.10)
58
- oauth2 (0.9.2)
59
- faraday (~> 0.8)
60
- httpauth (~> 0.2)
61
- jwt (~> 0.1.4)
62
- multi_json (~> 1.0)
63
- multi_xml (~> 0.5)
64
- rack (~> 1.2)
65
- pry (0.9.12.2)
66
- coderay (~> 1.0.5)
67
- method_source (~> 0.8)
68
- slop (~> 3.4)
69
- pry-debugger (0.2.2)
70
- debugger (~> 1.3)
71
- pry (~> 0.9.10)
72
- rack (1.5.2)
73
- rake (10.1.0)
74
- rdoc (4.0.1)
75
- json (~> 1.4)
76
- rspec (2.14.1)
77
- rspec-core (~> 2.14.0)
78
- rspec-expectations (~> 2.14.0)
79
- rspec-mocks (~> 2.14.0)
80
- rspec-core (2.14.2)
81
- rspec-expectations (2.14.0)
82
- diff-lcs (>= 1.1.3, < 2.0)
83
- rspec-mocks (2.14.1)
84
- safe_yaml (0.9.4)
85
- slop (3.4.5)
86
- thread_safe (0.1.2)
87
- atomic
88
- tzinfo (0.3.37)
89
- vertebrae (0.2.0)
90
- activesupport
91
- faraday
92
- faraday_middleware
93
- hashie
94
- webmock (1.13.0)
95
- addressable (>= 2.2.7)
96
- crack (>= 0.3.2)
97
-
98
- PLATFORMS
99
- ruby
100
-
101
- DEPENDENCIES
102
- bundler
103
- jeweler (~> 1.8.4)
104
- pry
105
- pry-debugger
106
- rspec
107
- vertebrae
108
- webmock