faraday-panoptes 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/run_tests_CI.yml +17 -0
- data/Dockerfile +20 -0
- data/README.md +15 -3
- data/docker-compose.yml +11 -0
- data/faraday-panoptes.gemspec +5 -4
- data/lib/faraday/panoptes/version.rb +1 -1
- metadata +33 -19
- data/.travis.yml +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 077ad6c0c7d63af21648067c7e831ca6466883168bf8436b68cf83e9aa49a56c
|
4
|
+
data.tar.gz: ed0af98fc264667e80d0312719ef9c5add62179226437caa21e9f68d8f4dcb89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d37c4d84ff2d20861c080e252c4abede36aeb1bf3282e111bd34266f196a0491e092a90d094e14c1c54e976e4ed6b7de5d801f9a7e533de3262f69f60516af2f
|
7
|
+
data.tar.gz: 671fe25d112f6a5dc73b92150238f522a6727ea492808ac27858cef0e3c4ce6e256ef9260a6be77d0cff269673727f8c409d51dbc7fc188a517615db88d644bf
|
@@ -0,0 +1,17 @@
|
|
1
|
+
name: Zooni CI
|
2
|
+
on:
|
3
|
+
pull_request:
|
4
|
+
push: { branches: master }
|
5
|
+
jobs:
|
6
|
+
test:
|
7
|
+
name: Run Tests
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
steps:
|
10
|
+
- uses: actions/checkout@v2
|
11
|
+
- name: Setup Ruby
|
12
|
+
uses: ruby/setup-ruby@v1
|
13
|
+
with:
|
14
|
+
ruby-version: 2.7
|
15
|
+
bundler-cache: true
|
16
|
+
- name: Run tests
|
17
|
+
run: bundle exec rspec
|
data/Dockerfile
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
FROM ruby:2.7-slim
|
2
|
+
|
3
|
+
WORKDIR /app
|
4
|
+
|
5
|
+
RUN apt-get update && apt-get -y upgrade && \
|
6
|
+
apt-get install --no-install-recommends -y \
|
7
|
+
build-essential \
|
8
|
+
# git is required for installing gems
|
9
|
+
git && \
|
10
|
+
apt-get clean && rm -rf /var/lib/apt/lists/*
|
11
|
+
|
12
|
+
ADD ./Gemfile /app/
|
13
|
+
ADD ./faraday-panoptes.gemspec /app/
|
14
|
+
ADD ./ /app
|
15
|
+
|
16
|
+
# ensure we use a newer version of rubygems / bundler
|
17
|
+
RUN gem update --system
|
18
|
+
|
19
|
+
RUN bundle config --global jobs `cat /proc/cpuinfo | grep processor | wc -l | xargs -I % expr % - 1`
|
20
|
+
RUN bundle install
|
data/README.md
CHANGED
@@ -4,11 +4,11 @@ This gem gives you a set of middleware that lets you use the Zooniverse Panoptes
|
|
4
4
|
|
5
5
|
```ruby
|
6
6
|
api_client = Faraday.new(url: "https://panoptes.zooniverse.org") do |faraday|
|
7
|
-
faraday.adapter Faraday.default_adapter # WITHOUT THIS LINE NOTHING WILL HAPPEN
|
8
|
-
|
9
7
|
faraday.request :panoptes_client_credentials, url: 'https://panoptes.zooniverse.org', client_id: 'APPLICATION_ID', client_secret: 'APPLICATION_SECRET'
|
10
8
|
faraday.request :panoptes_api_v1
|
11
9
|
faraday.response :json
|
10
|
+
|
11
|
+
faraday.adapter Faraday.default_adapter # WITHOUT THIS LINE NOTHING WILL HAPPEN
|
12
12
|
end
|
13
13
|
|
14
14
|
response = api_client.get("/api/projects/1")
|
@@ -35,10 +35,22 @@ Or install it yourself as:
|
|
35
35
|
|
36
36
|
## Development
|
37
37
|
|
38
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `
|
38
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
39
39
|
|
40
40
|
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).
|
41
41
|
|
42
|
+
Use docker & compose to setup the dev env
|
43
|
+
|
44
|
+
```shell
|
45
|
+
$ docker-compose build
|
46
|
+
```
|
47
|
+
|
48
|
+
Run a bash shell inside the new container
|
49
|
+
|
50
|
+
```shell
|
51
|
+
$ docker-compose run --service-ports --rm faraday-panoptes bash
|
52
|
+
```
|
53
|
+
|
42
54
|
## Contributing
|
43
55
|
|
44
56
|
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/faraday-panoptes. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
data/docker-compose.yml
ADDED
data/faraday-panoptes.gemspec
CHANGED
@@ -19,14 +19,15 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
spec.add_dependency 'faraday', '~> 0
|
23
|
-
spec.add_dependency 'faraday_middleware', '~> 0
|
22
|
+
spec.add_dependency 'faraday', '~> 1.0'
|
23
|
+
spec.add_dependency 'faraday_middleware', '~> 1.0'
|
24
24
|
|
25
|
-
spec.add_development_dependency "bundler", "~>
|
25
|
+
spec.add_development_dependency "bundler", "~> 2.2"
|
26
26
|
spec.add_development_dependency "openssl"
|
27
27
|
spec.add_development_dependency "pry"
|
28
|
-
spec.add_development_dependency "rake"
|
28
|
+
spec.add_development_dependency "rake"
|
29
29
|
spec.add_development_dependency "rspec"
|
30
30
|
spec.add_development_dependency "vcr"
|
31
31
|
spec.add_development_dependency "webmock"
|
32
|
+
spec.add_development_dependency "jwt"
|
32
33
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: faraday-panoptes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marten Veldthuis
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -16,42 +16,42 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0
|
19
|
+
version: '1.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: '1.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: faraday_middleware
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0
|
33
|
+
version: '1.0'
|
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
|
-
version: '0
|
40
|
+
version: '1.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '2.2'
|
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
|
-
version: '
|
54
|
+
version: '2.2'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: openssl
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,16 +84,16 @@ dependencies:
|
|
84
84
|
name: rake
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
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
|
-
version: '
|
96
|
+
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rspec
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -136,6 +136,20 @@ dependencies:
|
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: jwt
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
139
153
|
description: Provides middleware to set the correct request headers, and handle authentication
|
140
154
|
for Zooniverse's Panoptes API.
|
141
155
|
email:
|
@@ -144,17 +158,19 @@ executables: []
|
|
144
158
|
extensions: []
|
145
159
|
extra_rdoc_files: []
|
146
160
|
files:
|
161
|
+
- ".github/workflows/run_tests_CI.yml"
|
147
162
|
- ".gitignore"
|
148
163
|
- ".rspec"
|
149
|
-
- ".travis.yml"
|
150
164
|
- CHANGELOG.md
|
151
165
|
- CODE_OF_CONDUCT.md
|
166
|
+
- Dockerfile
|
152
167
|
- Gemfile
|
153
168
|
- LICENSE.txt
|
154
169
|
- README.md
|
155
170
|
- Rakefile
|
156
171
|
- bin/console
|
157
172
|
- bin/setup
|
173
|
+
- docker-compose.yml
|
158
174
|
- faraday-panoptes.gemspec
|
159
175
|
- lib/faraday/panoptes.rb
|
160
176
|
- lib/faraday/panoptes/access_token_authentication.rb
|
@@ -165,7 +181,7 @@ homepage: https://github.com/zooniverse/faraday-panoptes
|
|
165
181
|
licenses:
|
166
182
|
- MIT
|
167
183
|
metadata: {}
|
168
|
-
post_install_message:
|
184
|
+
post_install_message:
|
169
185
|
rdoc_options: []
|
170
186
|
require_paths:
|
171
187
|
- lib
|
@@ -180,10 +196,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
180
196
|
- !ruby/object:Gem::Version
|
181
197
|
version: '0'
|
182
198
|
requirements: []
|
183
|
-
|
184
|
-
|
185
|
-
signing_key:
|
199
|
+
rubygems_version: 3.1.4
|
200
|
+
signing_key:
|
186
201
|
specification_version: 4
|
187
202
|
summary: Faraday middleware for talking to the Panoptes API
|
188
203
|
test_files: []
|
189
|
-
has_rdoc:
|
data/.travis.yml
DELETED