tokyo_api 1.4.1 → 1.5.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
2
  SHA256:
3
- metadata.gz: 3b31314db88bda36022a686b1cf9e33bd95d870bbdfa3ca2fbefab8e0a36df72
4
- data.tar.gz: 98a5e4540b99f31cdbb6d9abc05f1bb14c21451dcfccd9592c182ffb96ab2c28
3
+ metadata.gz: 879c3eec6862437e9ab0804668b7cdc48d0194320af0dbc16d990bed2565d1c1
4
+ data.tar.gz: 6322d8e872f7cc5ae26708795c42809d50eab916766fa2035306836ee982c697
5
5
  SHA512:
6
- metadata.gz: 217d35539205c967954ecedcabe6bb52d9eba88405c36b877dffe828dec937e24c4cefccbf97fcdccb3ef00bcca73ab6e8cef53f5c683955b594ff25e7ead7ee
7
- data.tar.gz: 4ff16723f4dc8d5ccfcf8e1c2e96f65f7071c60959fbee53a183806985757f975e9f4fcf4c1b02c12166396866ef31615c63810f4f3efc2c58474e830d32e7ab
6
+ metadata.gz: 1505f232ce2c5e21c1446e39b891b36358536351ef0884ebdea5171c0ec21a0a68bf6b19fe04acc72689f79e3c2fca86421de80cf106f122ce4c1a2d65ecf834
7
+ data.tar.gz: 8814d7b820864e694e3e3de69c7ea24542479aa389db00e10cc4da1ab28f3bd100120f4a5339d8ac7f93f279a6dbde72e8c97f5201101700ec72783b8ea44c35
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  source "http://rubygems.org"
2
2
 
3
- gem 'vertebrae', '~> 0.5.0'
3
+ gem 'vertebrae', '~> 0.5.1'
4
4
 
5
5
  # Add dependencies to develop your gem here.
6
6
  # Include everything needed to run rake, tests, features, etc.
data/README.md CHANGED
@@ -7,7 +7,7 @@ A ruby gem for communicating with ControlShift's Tokyo API.
7
7
  ## Usage
8
8
 
9
9
  ```ruby
10
- ta = TokyoApi.new(host: 'localhost:9000', username: 'tokyo', password: 'Passw0rd!', scheme: 'http')
10
+ ta = TokyoApi.new(host: 'localhost:9000', username: 'tokyo', password: 'Passw0rd!', scheme: 'http', timeout: 5)
11
11
  ta.organisation.expire('foo.com')
12
12
  ```
13
13
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.4.1
1
+ 1.5.0
@@ -26,11 +26,17 @@ module TokyoApi
26
26
 
27
27
 
28
28
  def default_options
29
- {
29
+ opts = {
30
30
  user_agent: 'TokyoApi Gem',
31
31
  prefix: '',
32
32
  content_type: 'application/json'
33
33
  }
34
+
35
+ if initialisation_options.has_key?(:timeout)
36
+ opts[:connection_options] = {request: {timeout: initialisation_options[:timeout]}}
37
+ end
38
+
39
+ opts
34
40
  end
35
41
 
36
42
  def request(method, path, params, options) # :nodoc:
data/spec/client_spec.rb CHANGED
@@ -1,16 +1,26 @@
1
1
  require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
2
 
3
3
  describe TokyoApi::Client do
4
-
5
- describe "instantiated" do
4
+ describe 'initialisation' do
6
5
  subject { described_class.new(options) }
7
6
 
8
- context 'process_basic_auth' do
9
- let(:options) { { :basic_auth => 'login:password' } }
10
- let(:config) { subject.connection.configuration }
11
- specify { expect(config.username).to eq 'login' }
12
- specify { expect(config.password).to eq 'password' }
7
+ context 'with a basic_auth string parameter' do
8
+ let(:options) { {basic_auth: 'login:password'} }
9
+
10
+ it 'should set username/password on the configuration' do
11
+ config = subject.connection.configuration
12
+ expect(config.username).to eq 'login'
13
+ expect(config.password).to eq 'password'
14
+ end
13
15
  end
14
16
 
17
+ context 'with a timeout' do
18
+ let(:options) { {timeout: 5} }
19
+
20
+ it 'should set the timeout on the faraday options' do
21
+ config = subject.connection.configuration
22
+ expect(config.faraday_options[:request][:timeout]).to eq 5
23
+ end
24
+ end
15
25
  end
16
- end
26
+ end
data/tokyo_api.gemspec CHANGED
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: tokyo_api 1.4.1 ruby lib
5
+ # stub: tokyo_api 1.5.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "tokyo_api".freeze
9
- s.version = "1.4.1"
9
+ s.version = "1.5.0"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["Nathan Woodhull".freeze]
14
- s.date = "2019-05-23"
14
+ s.date = "2020-03-16"
15
15
  s.description = "Tokyo is a CRM middleware, this gem helps apps talk to it.".freeze
16
16
  s.email = "nathan@controlshiftlabs.com".freeze
17
17
  s.extra_rdoc_files = [
@@ -58,21 +58,21 @@ Gem::Specification.new do |s|
58
58
  ]
59
59
  s.homepage = "http://github.com/controlshift/tokyo_api".freeze
60
60
  s.licenses = ["MIT".freeze]
61
- s.rubygems_version = "2.7.7".freeze
61
+ s.rubygems_version = "3.0.8".freeze
62
62
  s.summary = "Ruby API Wrapper for Tokyo CRM service".freeze
63
63
 
64
64
  if s.respond_to? :specification_version then
65
65
  s.specification_version = 4
66
66
 
67
67
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
68
- s.add_runtime_dependency(%q<vertebrae>.freeze, ["~> 0.5.0"])
68
+ s.add_runtime_dependency(%q<vertebrae>.freeze, ["~> 0.5.1"])
69
69
  s.add_development_dependency(%q<rspec>.freeze, [">= 0"])
70
70
  s.add_development_dependency(%q<webmock>.freeze, [">= 0"])
71
71
  s.add_development_dependency(%q<byebug>.freeze, [">= 0"])
72
72
  s.add_development_dependency(%q<bundler>.freeze, [">= 0"])
73
73
  s.add_development_dependency(%q<juwelier>.freeze, [">= 0"])
74
74
  else
75
- s.add_dependency(%q<vertebrae>.freeze, ["~> 0.5.0"])
75
+ s.add_dependency(%q<vertebrae>.freeze, ["~> 0.5.1"])
76
76
  s.add_dependency(%q<rspec>.freeze, [">= 0"])
77
77
  s.add_dependency(%q<webmock>.freeze, [">= 0"])
78
78
  s.add_dependency(%q<byebug>.freeze, [">= 0"])
@@ -80,7 +80,7 @@ Gem::Specification.new do |s|
80
80
  s.add_dependency(%q<juwelier>.freeze, [">= 0"])
81
81
  end
82
82
  else
83
- s.add_dependency(%q<vertebrae>.freeze, ["~> 0.5.0"])
83
+ s.add_dependency(%q<vertebrae>.freeze, ["~> 0.5.1"])
84
84
  s.add_dependency(%q<rspec>.freeze, [">= 0"])
85
85
  s.add_dependency(%q<webmock>.freeze, [">= 0"])
86
86
  s.add_dependency(%q<byebug>.freeze, [">= 0"])
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tokyo_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Woodhull
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-23 00:00:00.000000000 Z
11
+ date: 2020-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: vertebrae
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.5.0
19
+ version: 0.5.1
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.5.0
26
+ version: 0.5.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -157,8 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
157
157
  - !ruby/object:Gem::Version
158
158
  version: '0'
159
159
  requirements: []
160
- rubyforge_project:
161
- rubygems_version: 2.7.7
160
+ rubygems_version: 3.0.8
162
161
  signing_key:
163
162
  specification_version: 4
164
163
  summary: Ruby API Wrapper for Tokyo CRM service