trackunit 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 +4 -4
- data/.github/dependabot.yml +21 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +1 -1
- data/Gemfile +0 -6
- data/Gemfile.lock +68 -28
- data/README.md +20 -8
- data/lib/trackunit/resource.rb +3 -2
- data/lib/trackunit/version.rb +2 -2
- data/trackunit.gemspec +12 -2
- metadata +101 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f33f602be170215aff825deb96cbf22989a0c16de69eb19c4510e9b8ade72097
|
4
|
+
data.tar.gz: fe1071b5a9013b514226ea1ef262dc7016bbd5267a1fae5ae94ff1bb0f31a95a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f1cbfb9405059b61b5c1fdf7afd4c5ec7b8d3a34f33d0197a91afd9e998571e15373751e9795d24a25274cbfcc56f3f20bd6bc6ca55021db50b7fa23e99c251
|
7
|
+
data.tar.gz: 83198d16b5577752f285f921e0402f31f8fe607b29f081e9a26379bc2d0563989f4e853140cc5379b04340475f1d545a9680281b4a9fe460e6315936492a72de
|
@@ -0,0 +1,21 @@
|
|
1
|
+
version: 2
|
2
|
+
updates:
|
3
|
+
- package-ecosystem: bundler
|
4
|
+
directory: "/"
|
5
|
+
schedule:
|
6
|
+
interval: daily
|
7
|
+
open-pull-requests-limit: 10
|
8
|
+
ignore:
|
9
|
+
- dependency-name: webmock
|
10
|
+
versions:
|
11
|
+
- 3.11.1
|
12
|
+
- 3.11.2
|
13
|
+
- 3.11.3
|
14
|
+
- dependency-name: activesupport
|
15
|
+
versions:
|
16
|
+
- 6.1.1
|
17
|
+
- 6.1.2
|
18
|
+
- 6.1.2.1
|
19
|
+
- dependency-name: pry
|
20
|
+
versions:
|
21
|
+
- 0.14.0
|
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
trackunit
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby-2.6.2
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,46 +1,86 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
trackunit (0.
|
4
|
+
trackunit (0.3.0)
|
5
|
+
activesupport (~> 6.0)
|
6
|
+
httparty (>= 0.17.1, < 0.20.0)
|
5
7
|
|
6
8
|
GEM
|
7
9
|
remote: https://rubygems.org/
|
8
10
|
specs:
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
11
|
+
activesupport (6.1.4.1)
|
12
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
13
|
+
i18n (>= 1.6, < 2)
|
14
|
+
minitest (>= 5.1)
|
15
|
+
tzinfo (~> 2.0)
|
16
|
+
zeitwerk (~> 2.3)
|
17
|
+
addressable (2.8.0)
|
18
|
+
public_suffix (>= 2.0.2, < 5.0)
|
19
|
+
coderay (1.1.3)
|
20
|
+
concurrent-ruby (1.1.9)
|
21
|
+
crack (0.4.5)
|
22
|
+
rexml
|
23
|
+
diff-lcs (1.4.4)
|
24
|
+
docile (1.3.5)
|
25
|
+
hashdiff (1.0.1)
|
26
|
+
httparty (0.19.0)
|
27
|
+
mime-types (~> 3.0)
|
28
|
+
multi_xml (>= 0.5.2)
|
29
|
+
i18n (1.8.10)
|
30
|
+
concurrent-ruby (~> 1.0)
|
31
|
+
method_source (1.0.0)
|
32
|
+
mime-types (3.3.1)
|
33
|
+
mime-types-data (~> 3.2015)
|
34
|
+
mime-types-data (3.2021.0901)
|
35
|
+
minitest (5.14.4)
|
36
|
+
multi_xml (0.6.0)
|
37
|
+
pry (0.14.1)
|
38
|
+
coderay (~> 1.1)
|
39
|
+
method_source (~> 1.0)
|
40
|
+
pry-rails (0.3.9)
|
41
|
+
pry (>= 0.10.4)
|
42
|
+
public_suffix (4.0.6)
|
43
|
+
rake (13.0.6)
|
44
|
+
rexml (3.2.5)
|
45
|
+
rspec (3.10.0)
|
46
|
+
rspec-core (~> 3.10.0)
|
47
|
+
rspec-expectations (~> 3.10.0)
|
48
|
+
rspec-mocks (~> 3.10.0)
|
49
|
+
rspec-core (3.10.1)
|
50
|
+
rspec-support (~> 3.10.0)
|
51
|
+
rspec-expectations (3.10.1)
|
26
52
|
diff-lcs (>= 1.2.0, < 2.0)
|
27
|
-
rspec-support (~> 3.
|
28
|
-
rspec-mocks (3.
|
53
|
+
rspec-support (~> 3.10.0)
|
54
|
+
rspec-mocks (3.10.2)
|
29
55
|
diff-lcs (>= 1.2.0, < 2.0)
|
30
|
-
rspec-support (~> 3.
|
31
|
-
rspec-support (3.
|
32
|
-
|
56
|
+
rspec-support (~> 3.10.0)
|
57
|
+
rspec-support (3.10.2)
|
58
|
+
simplecov (0.21.2)
|
59
|
+
docile (~> 1.1)
|
60
|
+
simplecov-html (~> 0.11)
|
61
|
+
simplecov_json_formatter (~> 0.1)
|
62
|
+
simplecov-html (0.12.3)
|
63
|
+
simplecov_json_formatter (0.1.2)
|
64
|
+
tzinfo (2.0.4)
|
65
|
+
concurrent-ruby (~> 1.0)
|
66
|
+
webmock (3.14.0)
|
67
|
+
addressable (>= 2.8.0)
|
68
|
+
crack (>= 0.3.2)
|
69
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
70
|
+
zeitwerk (2.4.2)
|
33
71
|
|
34
72
|
PLATFORMS
|
35
73
|
ruby
|
36
74
|
|
37
75
|
DEPENDENCIES
|
38
76
|
bundler (~> 1.16)
|
39
|
-
pry (= 0.
|
40
|
-
pry-rails (= 0.3.
|
41
|
-
rake (~>
|
42
|
-
rspec
|
77
|
+
pry (= 0.14.1)
|
78
|
+
pry-rails (= 0.3.9)
|
79
|
+
rake (~> 13.0)
|
80
|
+
rspec (~> 3.0)
|
81
|
+
simplecov (= 0.21.2)
|
43
82
|
trackunit!
|
83
|
+
webmock (= 3.14.0)
|
44
84
|
|
45
85
|
BUNDLED WITH
|
46
|
-
1.
|
86
|
+
1.17.2
|
data/README.md
CHANGED
@@ -1,8 +1,12 @@
|
|
1
|
-
|
1
|
+
## TrackUnit Ruby
|
2
2
|
|
3
|
-
|
3
|
+
[![Build Status](https://travis-ci.com/HassanAkbar/trackunit.svg?branch=master)](https://travis-ci.com/HassanAkbar/trackunit) [![CodeFactor](https://www.codefactor.io/repository/github/hassanakbar/trackunit/badge)](https://www.codefactor.io/repository/github/hassanakbar/trackunit)
|
4
|
+
|
5
|
+
This library is designed to help ruby/rails based applications communicate with the publicly available REST API for Trackunit.
|
6
|
+
|
7
|
+
|
8
|
+
If you are unfamiliar with the Trackunit REST API, you should first read the documentation located at https://dev.trackunit.com/.
|
4
9
|
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
6
10
|
|
7
11
|
## Installation
|
8
12
|
|
@@ -14,15 +18,23 @@ gem 'trackunit'
|
|
14
18
|
|
15
19
|
And then execute:
|
16
20
|
|
17
|
-
$ bundle
|
21
|
+
$ bundle install
|
18
22
|
|
19
23
|
Or install it yourself as:
|
20
24
|
|
21
25
|
$ gem install trackunit
|
22
26
|
|
23
|
-
## Usage
|
27
|
+
## Basic Usage
|
28
|
+
```ruby
|
29
|
+
require 'rubygems'
|
30
|
+
require 'trackunit'
|
31
|
+
|
32
|
+
# Create client (used to communicate with the API).
|
33
|
+
client = TrackUnit::Client.new(YOUR_TRACKUNIT_TOKEN)
|
24
34
|
|
25
|
-
|
35
|
+
# Retrieve list of Units (note: all communication must be made through the client).
|
36
|
+
units = client.units
|
37
|
+
```
|
26
38
|
|
27
39
|
## Development
|
28
40
|
|
@@ -32,7 +44,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
44
|
|
33
45
|
## Contributing
|
34
46
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
47
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/HassanAkbar/trackunit. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
36
48
|
|
37
49
|
## License
|
38
50
|
|
@@ -40,4 +52,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
40
52
|
|
41
53
|
## Code of Conduct
|
42
54
|
|
43
|
-
Everyone interacting in the Trackunit project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
55
|
+
Everyone interacting in the Trackunit project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/HassanAkbar/trackunit/blob/master/CODE_OF_CONDUCT.md).
|
data/lib/trackunit/resource.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
module TrackUnit
|
2
2
|
class Resource < OpenStruct
|
3
3
|
def self.serialize_response(response)
|
4
|
-
raise TrackUnit::
|
5
|
-
raise TrackUnit::
|
4
|
+
raise TrackUnit::Error if response.blank?
|
5
|
+
raise TrackUnit::AuthorizationError.new(response.message) if response.code == 401
|
6
|
+
raise TrackUnit::Error.new(response.message) unless response.code == 200
|
6
7
|
|
7
8
|
serialized_data = []
|
8
9
|
response.deep_transform_keys(&:underscore)['list'].each do |unit|
|
data/lib/trackunit/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
module
|
2
|
-
VERSION = "0.
|
1
|
+
module TrackUnit
|
2
|
+
VERSION = "0.3.0"
|
3
3
|
end
|
data/trackunit.gemspec
CHANGED
@@ -5,7 +5,7 @@ require "trackunit/version"
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "trackunit"
|
8
|
-
spec.version =
|
8
|
+
spec.version = TrackUnit::VERSION
|
9
9
|
spec.authors = ["Hassan"]
|
10
10
|
spec.email = ["hassanakbar2@gmail.com"]
|
11
11
|
|
@@ -36,7 +36,17 @@ Gem::Specification.new do |spec|
|
|
36
36
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
37
37
|
spec.require_paths = ["lib"]
|
38
38
|
|
39
|
+
spec.add_dependency("activesupport", "~> 6.0")
|
40
|
+
spec.add_dependency("httparty", ">= 0.17.1", "< 0.20.0")
|
41
|
+
|
42
|
+
|
43
|
+
|
39
44
|
spec.add_development_dependency "bundler", "~> 1.16"
|
40
|
-
spec.add_development_dependency "rake", "~>
|
45
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
41
46
|
spec.add_development_dependency "rspec", "~> 3.0"
|
47
|
+
spec.add_development_dependency "pry", "=0.14.1"
|
48
|
+
spec.add_development_dependency "pry-rails", "=0.3.9"
|
49
|
+
spec.add_development_dependency "webmock", "=3.14.0"
|
50
|
+
spec.add_development_dependency 'simplecov', '0.21.2'
|
51
|
+
|
42
52
|
end
|
metadata
CHANGED
@@ -1,15 +1,49 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trackunit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hassan
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activesupport
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '6.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '6.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: httparty
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.17.1
|
34
|
+
- - "<"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: 0.20.0
|
37
|
+
type: :runtime
|
38
|
+
prerelease: false
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 0.17.1
|
44
|
+
- - "<"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 0.20.0
|
13
47
|
- !ruby/object:Gem::Dependency
|
14
48
|
name: bundler
|
15
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -30,14 +64,14 @@ dependencies:
|
|
30
64
|
requirements:
|
31
65
|
- - "~>"
|
32
66
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
67
|
+
version: '13.0'
|
34
68
|
type: :development
|
35
69
|
prerelease: false
|
36
70
|
version_requirements: !ruby/object:Gem::Requirement
|
37
71
|
requirements:
|
38
72
|
- - "~>"
|
39
73
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
74
|
+
version: '13.0'
|
41
75
|
- !ruby/object:Gem::Dependency
|
42
76
|
name: rspec
|
43
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,6 +86,62 @@ dependencies:
|
|
52
86
|
- - "~>"
|
53
87
|
- !ruby/object:Gem::Version
|
54
88
|
version: '3.0'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: pry
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - '='
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: 0.14.1
|
96
|
+
type: :development
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - '='
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 0.14.1
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: pry-rails
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - '='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 0.3.9
|
110
|
+
type: :development
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - '='
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: 0.3.9
|
117
|
+
- !ruby/object:Gem::Dependency
|
118
|
+
name: webmock
|
119
|
+
requirement: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - '='
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: 3.14.0
|
124
|
+
type: :development
|
125
|
+
prerelease: false
|
126
|
+
version_requirements: !ruby/object:Gem::Requirement
|
127
|
+
requirements:
|
128
|
+
- - '='
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: 3.14.0
|
131
|
+
- !ruby/object:Gem::Dependency
|
132
|
+
name: simplecov
|
133
|
+
requirement: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - '='
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: 0.21.2
|
138
|
+
type: :development
|
139
|
+
prerelease: false
|
140
|
+
version_requirements: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - '='
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: 0.21.2
|
55
145
|
description: TrackUnit REST API
|
56
146
|
email:
|
57
147
|
- hassanakbar2@gmail.com
|
@@ -59,8 +149,11 @@ executables: []
|
|
59
149
|
extensions: []
|
60
150
|
extra_rdoc_files: []
|
61
151
|
files:
|
152
|
+
- ".github/dependabot.yml"
|
62
153
|
- ".gitignore"
|
63
154
|
- ".rspec"
|
155
|
+
- ".ruby-gemset"
|
156
|
+
- ".ruby-version"
|
64
157
|
- ".travis.yml"
|
65
158
|
- CODE_OF_CONDUCT.md
|
66
159
|
- Gemfile
|
@@ -85,7 +178,7 @@ metadata:
|
|
85
178
|
homepage_uri: https://github.com/HassanAkbar/trackunit
|
86
179
|
source_code_uri: https://github.com/HassanAkbar/trackunit
|
87
180
|
changelog_uri: https://github.com/HassanAkbar/trackunit
|
88
|
-
post_install_message:
|
181
|
+
post_install_message:
|
89
182
|
rdoc_options: []
|
90
183
|
require_paths:
|
91
184
|
- lib
|
@@ -100,9 +193,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
193
|
- !ruby/object:Gem::Version
|
101
194
|
version: '0'
|
102
195
|
requirements: []
|
103
|
-
|
104
|
-
|
105
|
-
signing_key:
|
196
|
+
rubygems_version: 3.0.3
|
197
|
+
signing_key:
|
106
198
|
specification_version: 4
|
107
199
|
summary: REST API for Trackunit
|
108
200
|
test_files: []
|