teamsupport 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +3 -0
- data/lib/teamsupport/client.rb +16 -2
- data/lib/teamsupport/null_object.rb +0 -4
- data/lib/teamsupport/rest/request.rb +1 -2
- data/lib/teamsupport/version.rb +2 -2
- data/teamsupport.gemspec +4 -4
- metadata +24 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 48f0057ea45c1a3755d758162ee330322f543cc5
|
4
|
+
data.tar.gz: 88d5d5493ece8d2e05e526750242f3ab6545b60d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: daa3b76e1bf592e8130cbc9d6cd01006894b8f39f572159da5cf947946d461db3f063ac64b4888cbf125f0eca3460bf9a7633c7498dafaa4cb1847c6d6ce25c3
|
7
|
+
data.tar.gz: 8eec1767765bfd07a0cc60808c0c1354e59b146818ca42b91491b2ead9d7ba08cc7d983b807a5fef6236750122fbe25c11964a43b70fe3ae76a8fbacc3d47388
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,13 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
5
5
|
## Unreleased
|
6
6
|
- Backlog and Future Milestones are managed via [Github](https://github.com/jrbeilke/teamsupport/issues)
|
7
7
|
|
8
|
+
## 0.2.0 - 2016-11-07
|
9
|
+
### Added
|
10
|
+
- Add support for configuring URL used in API requests
|
11
|
+
|
12
|
+
### Changed
|
13
|
+
- Upgraded to use http v2 and removed support for Ruby 1.9
|
14
|
+
|
8
15
|
## 0.1.1 - 2016-09-22
|
9
16
|
### Fixed
|
10
17
|
- Fixed bad bundler dependency version in gemspec
|
data/README.md
CHANGED
@@ -51,8 +51,11 @@ You can pass configuration options as a block to `Teamsupport::REST::Client.new`
|
|
51
51
|
client = Teamsupport::REST::Client.new do |config|
|
52
52
|
config.api_key = "TEAMSUPPORT_ORGANIZATION_ID"
|
53
53
|
config.api_secret = "TEAMSUPPORT_API_TOKEN"
|
54
|
+
config.api_url = "TEAMSUPPORT_API_URL"
|
54
55
|
end
|
55
56
|
|
57
|
+
The API url is not required and will default to `https://app.teamsupport.com` if not defined in config.
|
58
|
+
|
56
59
|
## Usage Examples
|
57
60
|
After configuring a `client`, you can do the following things.
|
58
61
|
|
data/lib/teamsupport/client.rb
CHANGED
@@ -16,16 +16,17 @@ module Teamsupport
|
|
16
16
|
# @api public
|
17
17
|
attr_accessor :api_key, :api_secret
|
18
18
|
|
19
|
-
# Provide user_agent
|
19
|
+
# Provide api_url and user_agent methods for overriding default Client values
|
20
20
|
#
|
21
21
|
# @example
|
22
22
|
# teamsupport_client = Teamsupport::Client.new(api_key: 'AK', api_secret: 'AS')
|
23
|
+
# teamsupport_client.api_url = 'https://app.teamsupport.com'
|
23
24
|
# teamsupport_client.user_agent = 'MyTeamsupportClient/1.0.0'
|
24
25
|
#
|
25
26
|
# @return [String]
|
26
27
|
#
|
27
28
|
# @api public
|
28
|
-
attr_writer :user_agent
|
29
|
+
attr_writer :api_url, :user_agent
|
29
30
|
|
30
31
|
# Initializes a new Client object
|
31
32
|
#
|
@@ -41,6 +42,19 @@ module Teamsupport
|
|
41
42
|
yield(self) if block_given?
|
42
43
|
end
|
43
44
|
|
45
|
+
# Returns api_url string for the Client
|
46
|
+
#
|
47
|
+
# @example
|
48
|
+
# teamsupport_client = Teamsupport::Client.new(api_key: 'AK', api_secret: 'AS')
|
49
|
+
# teamsupport_client.api_url
|
50
|
+
#
|
51
|
+
# @return [String]
|
52
|
+
#
|
53
|
+
# @api public
|
54
|
+
def api_url
|
55
|
+
@api_url ||= 'https://app.teamsupport.com'
|
56
|
+
end
|
57
|
+
|
44
58
|
# Returns user agent string for the Client
|
45
59
|
#
|
46
60
|
# @example
|
@@ -9,7 +9,6 @@ require 'teamsupport/headers'
|
|
9
9
|
module Teamsupport
|
10
10
|
module REST
|
11
11
|
class Request
|
12
|
-
BASE_URL = 'https://app.teamsupport.com'.freeze
|
13
12
|
attr_accessor :client, :headers, :options, :path, :request_method, :uri
|
14
13
|
alias verb request_method
|
15
14
|
|
@@ -25,7 +24,7 @@ module Teamsupport
|
|
25
24
|
# @api private
|
26
25
|
def initialize(client, request_method, path, options = {})
|
27
26
|
@client = client
|
28
|
-
@uri = Addressable::URI.parse(path.start_with?('http') ? path :
|
27
|
+
@uri = Addressable::URI.parse(path.start_with?('http') ? path : @client.api_url + path)
|
29
28
|
@request_method = request_method
|
30
29
|
@headers = Teamsupport::Headers.new(@client, @request_method, @uri, options).request_headers
|
31
30
|
@path = uri.path
|
data/lib/teamsupport/version.rb
CHANGED
data/teamsupport.gemspec
CHANGED
@@ -6,7 +6,7 @@ require 'teamsupport/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.add_dependency 'addressable', '~> 2.3'
|
8
8
|
spec.add_dependency 'equalizer', '~> 0.0.11'
|
9
|
-
spec.add_dependency 'http', '~>
|
9
|
+
spec.add_dependency 'http', '~> 2.0'
|
10
10
|
spec.add_dependency 'http-form_data', '~> 1.0'
|
11
11
|
spec.add_dependency 'naught', '~> 1.0'
|
12
12
|
spec.add_development_dependency 'bundler', '~> 1.0'
|
@@ -16,12 +16,12 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.authors = ['Jon Beilke']
|
17
17
|
spec.email = ['jrbeilke@gmail.com']
|
18
18
|
|
19
|
-
spec.summary =
|
20
|
-
spec.description = 'A
|
19
|
+
spec.summary = 'A Ruby interface to the Teamsupport API.'
|
20
|
+
spec.description = 'A simple library for communicating with the TeamSupport API. Currently supports Customers, Products, and Tickets, with plans to expand to full support of the API with a 1.0 release.'
|
21
21
|
spec.homepage = 'https://github.com/jrbeilke/teamsupport'
|
22
22
|
spec.licenses = %w(MIT)
|
23
23
|
|
24
24
|
spec.files = %w(.yardopts CHANGELOG.md CONTRIBUTING.md LICENSE.md README.md teamsupport.gemspec) + Dir['lib/**/*.rb']
|
25
25
|
spec.require_paths = %w(lib)
|
26
|
-
spec.required_ruby_version = '>=
|
26
|
+
spec.required_ruby_version = '>= 2.0.0'
|
27
27
|
end
|
metadata
CHANGED
@@ -1,107 +1,109 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: teamsupport
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Beilke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '2.3'
|
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
26
|
version: '2.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: equalizer
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 0.0.11
|
34
34
|
type: :runtime
|
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.0.11
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: http
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '2.0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '2.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: http-form_data
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '1.0'
|
62
62
|
type: :runtime
|
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: '1.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: naught
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ~>
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '1.0'
|
76
76
|
type: :runtime
|
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: '1.0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: bundler
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ~>
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '1.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: '1.0'
|
97
|
-
description: A
|
97
|
+
description: A simple library for communicating with the TeamSupport API. Currently
|
98
|
+
supports Customers, Products, and Tickets, with plans to expand to full support
|
99
|
+
of the API with a 1.0 release.
|
98
100
|
email:
|
99
101
|
- jrbeilke@gmail.com
|
100
102
|
executables: []
|
101
103
|
extensions: []
|
102
104
|
extra_rdoc_files: []
|
103
105
|
files:
|
104
|
-
-
|
106
|
+
- .yardopts
|
105
107
|
- CHANGELOG.md
|
106
108
|
- CONTRIBUTING.md
|
107
109
|
- LICENSE.md
|
@@ -140,12 +142,12 @@ require_paths:
|
|
140
142
|
- lib
|
141
143
|
required_ruby_version: !ruby/object:Gem::Requirement
|
142
144
|
requirements:
|
143
|
-
- -
|
145
|
+
- - '>='
|
144
146
|
- !ruby/object:Gem::Version
|
145
|
-
version:
|
147
|
+
version: 2.0.0
|
146
148
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
147
149
|
requirements:
|
148
|
-
- -
|
150
|
+
- - '>='
|
149
151
|
- !ruby/object:Gem::Version
|
150
152
|
version: '0'
|
151
153
|
requirements: []
|
@@ -153,6 +155,5 @@ rubyforge_project:
|
|
153
155
|
rubygems_version: 2.4.2
|
154
156
|
signing_key:
|
155
157
|
specification_version: 4
|
156
|
-
summary:
|
158
|
+
summary: A Ruby interface to the Teamsupport API.
|
157
159
|
test_files: []
|
158
|
-
has_rdoc:
|