nokotime-ruby-client 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +20 -0
- data/.rspec +3 -0
- data/.rubocop.yml +21 -0
- data/.travis.yml +7 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +155 -0
- data/LICENSE.txt +21 -0
- data/README.md +43 -0
- data/Rakefile +9 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/nokotime.rb +40 -0
- data/lib/nokotime/authentication.rb +28 -0
- data/lib/nokotime/client/entries.rb +41 -0
- data/lib/nokotime/client/project_groups.rb +33 -0
- data/lib/nokotime/client/projects.rb +41 -0
- data/lib/nokotime/client/tags.rb +33 -0
- data/lib/nokotime/client/users.rb +41 -0
- data/lib/nokotime/configuration.rb +44 -0
- data/lib/nokotime/connection.rb +87 -0
- data/lib/nokotime/errors/configuration.rb +5 -0
- data/lib/nokotime/errors/connection.rb +7 -0
- data/lib/nokotime/errors/invalid_params.rb +5 -0
- data/lib/nokotime/paginator.rb +67 -0
- data/lib/nokotime/request/multiple_pages.rb +50 -0
- data/lib/nokotime/request/single_page.rb +71 -0
- data/lib/nokotime/validator/entry_schema.rb +74 -0
- data/lib/nokotime/validator/project_group_schema.rb +28 -0
- data/lib/nokotime/validator/project_schema.rb +49 -0
- data/lib/nokotime/validator/restricted_hash.rb +11 -0
- data/lib/nokotime/validator/tag_schema.rb +28 -0
- data/lib/nokotime/validator/user_schema.rb +41 -0
- data/lib/nokotime/validator/validation.yml +14 -0
- data/lib/nokotime/version.rb +3 -0
- data/nokotime-ruby-client.gemspec +45 -0
- metadata +304 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e33463f209ce0bbe60240cdb479fddf0b8940559ba0ad7110ba10d49e00087e6
|
4
|
+
data.tar.gz: 7792e0f007cee052565c11a6b44febb9b3669e2535005f4ccfaf627ebfc0bb56
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ac578a7c59e439a698d8f6470ebfacef93c927c51346692bcd5d836ec2ace22d0130e5f96dc552c6a65a6460abf10ac11360f368e4909ef6e078cde3e4138a60
|
7
|
+
data.tar.gz: 26e74b0fc26f2ac721ab4c8e343b7cb763f6ae5a2f4b6ab0b86a4e8bf26ff1071d8b5c1d4e34f38c9ea05812da74bdb3aef05cd87ad6f33c253092de97c923d8
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
inherit_from: https://raw.githubusercontent.com/leanpanda-com/rubocop/master/rubocop-rspec.yml
|
2
|
+
|
3
|
+
AllCops:
|
4
|
+
TargetRubyVersion: 2.4
|
5
|
+
Exclude:
|
6
|
+
- "bin/**/*"
|
7
|
+
- ".bundle/**/*"
|
8
|
+
- "bundle/**/*"
|
9
|
+
|
10
|
+
Style/ClassAndModuleChildren:
|
11
|
+
EnforcedStyle: nested
|
12
|
+
Style/EmptyMethod:
|
13
|
+
EnforcedStyle: expanded
|
14
|
+
Style/ModuleFunction:
|
15
|
+
EnforcedStyle: module_function
|
16
|
+
|
17
|
+
Metrics/BlockLength:
|
18
|
+
Max: 35
|
19
|
+
|
20
|
+
RSpec/MultipleExpectations:
|
21
|
+
Max: 2
|
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at d.garofoli@cantierecreativo.net. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,155 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
nokotime-ruby-client (0.1.0)
|
5
|
+
dotenv
|
6
|
+
dry-validation
|
7
|
+
faraday (>= 0.15.2)
|
8
|
+
faraday_middleware (>= 0.12)
|
9
|
+
typhoeus
|
10
|
+
|
11
|
+
GEM
|
12
|
+
remote: https://rubygems.org/
|
13
|
+
specs:
|
14
|
+
addressable (2.6.0)
|
15
|
+
public_suffix (>= 2.0.2, < 4.0)
|
16
|
+
ansi (1.5.0)
|
17
|
+
ast (2.4.0)
|
18
|
+
byebug (11.0.1)
|
19
|
+
coderay (1.1.2)
|
20
|
+
concurrent-ruby (1.1.5)
|
21
|
+
coveralls (0.8.22)
|
22
|
+
json (>= 1.8, < 3)
|
23
|
+
simplecov (~> 0.16.1)
|
24
|
+
term-ansicolor (~> 1.3)
|
25
|
+
thor (~> 0.19.4)
|
26
|
+
tins (~> 1.6)
|
27
|
+
crack (0.4.3)
|
28
|
+
safe_yaml (~> 1.0.0)
|
29
|
+
diff-lcs (1.3)
|
30
|
+
docile (1.3.1)
|
31
|
+
dotenv (2.7.2)
|
32
|
+
dry-configurable (0.8.2)
|
33
|
+
concurrent-ruby (~> 1.0)
|
34
|
+
dry-core (~> 0.4, >= 0.4.7)
|
35
|
+
dry-container (0.7.0)
|
36
|
+
concurrent-ruby (~> 1.0)
|
37
|
+
dry-configurable (~> 0.1, >= 0.1.3)
|
38
|
+
dry-core (0.4.7)
|
39
|
+
concurrent-ruby (~> 1.0)
|
40
|
+
dry-equalizer (0.2.2)
|
41
|
+
dry-inflector (0.1.2)
|
42
|
+
dry-logic (0.6.0)
|
43
|
+
concurrent-ruby (~> 1.0)
|
44
|
+
dry-core (~> 0.2)
|
45
|
+
dry-equalizer (~> 0.2)
|
46
|
+
dry-types (0.14.1)
|
47
|
+
concurrent-ruby (~> 1.0)
|
48
|
+
dry-container (~> 0.3)
|
49
|
+
dry-core (~> 0.4, >= 0.4.4)
|
50
|
+
dry-equalizer (~> 0.2)
|
51
|
+
dry-inflector (~> 0.1, >= 0.1.2)
|
52
|
+
dry-logic (~> 0.5, >= 0.5)
|
53
|
+
dry-validation (0.13.1)
|
54
|
+
concurrent-ruby (~> 1.0)
|
55
|
+
dry-configurable (~> 0.1, >= 0.1.3)
|
56
|
+
dry-core (~> 0.2, >= 0.2.1)
|
57
|
+
dry-equalizer (~> 0.2)
|
58
|
+
dry-logic (~> 0.5, >= 0.5.0)
|
59
|
+
dry-types (~> 0.14.0)
|
60
|
+
ethon (0.12.0)
|
61
|
+
ffi (>= 1.3.0)
|
62
|
+
faraday (0.15.4)
|
63
|
+
multipart-post (>= 1.2, < 3)
|
64
|
+
faraday_middleware (0.13.1)
|
65
|
+
faraday (>= 0.7.4, < 1.0)
|
66
|
+
ffi (1.10.0)
|
67
|
+
hashdiff (0.3.8)
|
68
|
+
hirb (0.7.3)
|
69
|
+
jaro_winkler (1.5.2)
|
70
|
+
json (2.2.0)
|
71
|
+
method_source (0.9.2)
|
72
|
+
multipart-post (2.0.0)
|
73
|
+
parallel (1.17.0)
|
74
|
+
parser (2.6.2.0)
|
75
|
+
ast (~> 2.4.0)
|
76
|
+
pry (0.12.2)
|
77
|
+
coderay (~> 1.1.0)
|
78
|
+
method_source (~> 0.9.0)
|
79
|
+
pry-byebug (3.7.0)
|
80
|
+
byebug (~> 11.0)
|
81
|
+
pry (~> 0.10)
|
82
|
+
psych (3.1.0)
|
83
|
+
public_suffix (3.0.3)
|
84
|
+
rainbow (3.0.0)
|
85
|
+
rake (12.3.2)
|
86
|
+
rspec (3.8.0)
|
87
|
+
rspec-core (~> 3.8.0)
|
88
|
+
rspec-expectations (~> 3.8.0)
|
89
|
+
rspec-mocks (~> 3.8.0)
|
90
|
+
rspec-core (3.8.0)
|
91
|
+
rspec-support (~> 3.8.0)
|
92
|
+
rspec-expectations (3.8.2)
|
93
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
94
|
+
rspec-support (~> 3.8.0)
|
95
|
+
rspec-mocks (3.8.0)
|
96
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
97
|
+
rspec-support (~> 3.8.0)
|
98
|
+
rspec-support (3.8.0)
|
99
|
+
rubocop (0.67.1)
|
100
|
+
jaro_winkler (~> 1.5.1)
|
101
|
+
parallel (~> 1.10)
|
102
|
+
parser (>= 2.5, != 2.5.1.1)
|
103
|
+
psych (>= 3.1.0)
|
104
|
+
rainbow (>= 2.2.2, < 4.0)
|
105
|
+
ruby-progressbar (~> 1.7)
|
106
|
+
unicode-display_width (>= 1.4.0, < 1.6)
|
107
|
+
rubocop-performance (1.0.0)
|
108
|
+
rubocop (>= 0.58.0)
|
109
|
+
rubocop-rspec (1.32.0)
|
110
|
+
rubocop (>= 0.60.0)
|
111
|
+
ruby-progressbar (1.10.0)
|
112
|
+
safe_yaml (1.0.5)
|
113
|
+
simplecov (0.16.1)
|
114
|
+
docile (~> 1.1)
|
115
|
+
json (>= 1.8, < 3)
|
116
|
+
simplecov-html (~> 0.10.0)
|
117
|
+
simplecov-console (0.4.2)
|
118
|
+
ansi
|
119
|
+
hirb
|
120
|
+
simplecov
|
121
|
+
simplecov-html (0.10.2)
|
122
|
+
term-ansicolor (1.7.1)
|
123
|
+
tins (~> 1.0)
|
124
|
+
thor (0.19.4)
|
125
|
+
tins (1.20.2)
|
126
|
+
typhoeus (1.3.1)
|
127
|
+
ethon (>= 0.9.0)
|
128
|
+
unicode-display_width (1.5.0)
|
129
|
+
vcr (4.0.0)
|
130
|
+
webmock (3.5.1)
|
131
|
+
addressable (>= 2.3.6)
|
132
|
+
crack (>= 0.3.2)
|
133
|
+
hashdiff
|
134
|
+
|
135
|
+
PLATFORMS
|
136
|
+
ruby
|
137
|
+
|
138
|
+
DEPENDENCIES
|
139
|
+
bundler
|
140
|
+
coveralls
|
141
|
+
nokotime-ruby-client!
|
142
|
+
pry
|
143
|
+
pry-byebug
|
144
|
+
rake
|
145
|
+
rspec
|
146
|
+
rubocop
|
147
|
+
rubocop-performance
|
148
|
+
rubocop-rspec
|
149
|
+
simplecov
|
150
|
+
simplecov-console
|
151
|
+
vcr
|
152
|
+
webmock
|
153
|
+
|
154
|
+
BUNDLED WITH
|
155
|
+
2.0.1
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2019 Domenico Garofoli
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all 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,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
# Nokotime::Ruby::Client
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/nokotime/ruby/client`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'nokotime-ruby-client'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install nokotime-ruby-client
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/nokotime-ruby-client. 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
|
+
|
37
|
+
## License
|
38
|
+
|
39
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
40
|
+
|
41
|
+
## Code of Conduct
|
42
|
+
|
43
|
+
Everyone interacting in the Nokotime::Ruby::Client project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/nokotime-ruby-client/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "nokotime/ruby/client"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/lib/nokotime.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
require "dry-validation"
|
2
|
+
require "faraday"
|
3
|
+
require "faraday_middleware"
|
4
|
+
|
5
|
+
require "nokotime/errors/configuration"
|
6
|
+
require "nokotime/errors/connection"
|
7
|
+
require "nokotime/errors/invalid_params"
|
8
|
+
require "nokotime/authentication"
|
9
|
+
require "nokotime/configuration"
|
10
|
+
require "nokotime/connection"
|
11
|
+
require "nokotime/paginator"
|
12
|
+
require "nokotime/request/single_page"
|
13
|
+
require "nokotime/request/multiple_pages"
|
14
|
+
require "nokotime/validator/restricted_hash"
|
15
|
+
require "nokotime/validator/user_schema"
|
16
|
+
require "nokotime/validator/entry_schema"
|
17
|
+
require "nokotime/validator/project_schema"
|
18
|
+
require "nokotime/validator/project_group_schema"
|
19
|
+
require "nokotime/validator/tag_schema"
|
20
|
+
require "nokotime/client/users"
|
21
|
+
require "nokotime/client/entries"
|
22
|
+
require "nokotime/client/projects"
|
23
|
+
require "nokotime/client/project_groups"
|
24
|
+
require "nokotime/client/tags"
|
25
|
+
|
26
|
+
module Nokotime
|
27
|
+
module_function
|
28
|
+
|
29
|
+
def configure(&_block)
|
30
|
+
yield configuration
|
31
|
+
end
|
32
|
+
|
33
|
+
def configuration
|
34
|
+
@configuration || reset
|
35
|
+
end
|
36
|
+
|
37
|
+
def reset
|
38
|
+
@configuration = Configuration.new
|
39
|
+
end
|
40
|
+
end
|