atlas-api 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yaml +30 -0
- data/.gitignore +1 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +30 -20
- data/README.md +1 -1
- data/atlas-api.gemspec +3 -3
- data/lib/atlas-api/client.rb +1 -5
- data/lib/atlas-api/version.rb +1 -1
- data/spec/atlas-api/client_spec.rb +4 -4
- data/spec/spec_helper.rb +2 -0
- metadata +8 -8
- data/.travis.yml +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f981ff921e8fe428fad90b0ff78c341f00b8f628c893893829f1276665138eba
|
4
|
+
data.tar.gz: 64c45de8a715f095097245a2b3674c6a07bbe32275b32280fed557b3fd62456c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc564316d82706880f5e08ee617962fc2854558bdd02a761bf40f31be32b321be1d9fe63052bd2959b7157c5ff778a8e5441d4c1f853ad77eb441681de3b8136
|
7
|
+
data.tar.gz: d56eb0da4720dab41bdd51e9c1edaec996b9e6f8e6dc6244b530902a113be0aad907f55ac57ef5bec1951a3fc383f8b0fc38ed2431901818b57c232c86eae02d
|
@@ -0,0 +1,30 @@
|
|
1
|
+
|
2
|
+
name: CI
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- master
|
7
|
+
pull_request:
|
8
|
+
branches:
|
9
|
+
- master
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
tests:
|
13
|
+
name: Run test suite
|
14
|
+
runs-on: ubuntu-latest
|
15
|
+
|
16
|
+
strategy:
|
17
|
+
matrix:
|
18
|
+
ruby-version: ['3.2', '3.1', '3.0', '2.7']
|
19
|
+
|
20
|
+
steps:
|
21
|
+
- name: Check out code
|
22
|
+
uses: actions/checkout@v2
|
23
|
+
- name: Set up Ruby
|
24
|
+
uses: ruby/setup-ruby@v1
|
25
|
+
with:
|
26
|
+
ruby-version: ${{ matrix.ruby-version }}
|
27
|
+
- name: Install dependencies
|
28
|
+
run: bundle install
|
29
|
+
- name: Run tests
|
30
|
+
run: bundle exec rspec spec/atlas-api/client_spec.rb
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,40 +1,49 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
atlas-api (0.
|
5
|
-
faraday (~>
|
4
|
+
atlas-api (0.2.0)
|
5
|
+
faraday (~> 2.7.0)
|
6
6
|
hashie (~> 3.6.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
addressable (2.8.
|
12
|
-
public_suffix (>= 2.0.2, <
|
11
|
+
addressable (2.8.1)
|
12
|
+
public_suffix (>= 2.0.2, < 6.0)
|
13
13
|
crack (0.4.5)
|
14
14
|
rexml
|
15
15
|
diff-lcs (1.5.0)
|
16
|
-
|
17
|
-
|
16
|
+
docile (1.4.0)
|
17
|
+
faraday (2.7.0)
|
18
|
+
faraday-net_http (>= 2.0, < 3.1)
|
19
|
+
ruby2_keywords (>= 0.0.4)
|
20
|
+
faraday-net_http (3.0.2)
|
18
21
|
hashdiff (1.0.1)
|
19
22
|
hashie (3.6.0)
|
20
|
-
|
21
|
-
public_suffix (4.0.7)
|
23
|
+
public_suffix (5.0.0)
|
22
24
|
rake (13.0.6)
|
23
25
|
rexml (3.2.5)
|
24
|
-
rspec (3.
|
25
|
-
rspec-core (~> 3.
|
26
|
-
rspec-expectations (~> 3.
|
27
|
-
rspec-mocks (~> 3.
|
28
|
-
rspec-core (3.
|
29
|
-
rspec-support (~> 3.
|
30
|
-
rspec-expectations (3.
|
26
|
+
rspec (3.12.0)
|
27
|
+
rspec-core (~> 3.12.0)
|
28
|
+
rspec-expectations (~> 3.12.0)
|
29
|
+
rspec-mocks (~> 3.12.0)
|
30
|
+
rspec-core (3.12.0)
|
31
|
+
rspec-support (~> 3.12.0)
|
32
|
+
rspec-expectations (3.12.0)
|
31
33
|
diff-lcs (>= 1.2.0, < 2.0)
|
32
|
-
rspec-support (~> 3.
|
33
|
-
rspec-mocks (3.
|
34
|
+
rspec-support (~> 3.12.0)
|
35
|
+
rspec-mocks (3.12.0)
|
34
36
|
diff-lcs (>= 1.2.0, < 2.0)
|
35
|
-
rspec-support (~> 3.
|
36
|
-
rspec-support (3.
|
37
|
-
|
37
|
+
rspec-support (~> 3.12.0)
|
38
|
+
rspec-support (3.12.0)
|
39
|
+
ruby2_keywords (0.0.5)
|
40
|
+
simplecov (0.21.2)
|
41
|
+
docile (~> 1.1)
|
42
|
+
simplecov-html (~> 0.11)
|
43
|
+
simplecov_json_formatter (~> 0.1)
|
44
|
+
simplecov-html (0.12.3)
|
45
|
+
simplecov_json_formatter (0.1.4)
|
46
|
+
webmock (3.18.1)
|
38
47
|
addressable (>= 2.8.0)
|
39
48
|
crack (>= 0.3.2)
|
40
49
|
hashdiff (>= 0.4.0, < 2.0.0)
|
@@ -46,6 +55,7 @@ DEPENDENCIES
|
|
46
55
|
atlas-api!
|
47
56
|
rake (~> 13.0.1)
|
48
57
|
rspec
|
58
|
+
simplecov
|
49
59
|
webmock
|
50
60
|
|
51
61
|
BUNDLED WITH
|
data/README.md
CHANGED
@@ -21,5 +21,5 @@ $ atlas build ATLAS_TOKEN PROJECT FORMATS BRANCH
|
|
21
21
|
A real world example of this would look something like this:
|
22
22
|
|
23
23
|
```bash
|
24
|
-
$ atlas build abcdefg oreillymedia/atlas_book_skeleton pdf,epub,html
|
24
|
+
$ atlas build abcdefg oreillymedia/atlas_book_skeleton pdf,epub,html main
|
25
25
|
```
|
data/atlas-api.gemspec
CHANGED
@@ -6,8 +6,8 @@ require 'atlas-api/version'
|
|
6
6
|
Gem::Specification.new do |gem|
|
7
7
|
gem.name = "atlas-api"
|
8
8
|
gem.version = Atlas::Api::VERSION
|
9
|
-
gem.authors = ["
|
10
|
-
gem.email = ["
|
9
|
+
gem.authors = ["O'Reilly Media Tools Team"]
|
10
|
+
gem.email = ["toolsreq@oreilly.com"]
|
11
11
|
gem.description = "Gem to interact with the O'Reilly Media Atlas API"
|
12
12
|
gem.summary = "Gem to interact with the O'Reilly Media Atlas API"
|
13
13
|
gem.homepage = ""
|
@@ -17,7 +17,7 @@ Gem::Specification.new do |gem|
|
|
17
17
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
18
|
gem.require_paths = ["lib"]
|
19
19
|
|
20
|
-
gem.add_dependency "faraday", "~>
|
20
|
+
gem.add_dependency "faraday", "~> 2.7.0"
|
21
21
|
gem.add_dependency "hashie", "~> 3.6.0"
|
22
22
|
gem.add_development_dependency "rspec"
|
23
23
|
gem.add_development_dependency "webmock"
|
data/lib/atlas-api/client.rb
CHANGED
@@ -62,10 +62,6 @@ module Atlas
|
|
62
62
|
request :put, path, options
|
63
63
|
end
|
64
64
|
|
65
|
-
def delete(path, options = {})
|
66
|
-
request :delete, path, options
|
67
|
-
end
|
68
|
-
|
69
65
|
def agent
|
70
66
|
@agent ||= Faraday.new(url: @api_endpoint, params: { auth_token: @auth_token })
|
71
67
|
@agent
|
@@ -74,7 +70,7 @@ module Atlas
|
|
74
70
|
private
|
75
71
|
|
76
72
|
def request(method, path, options)
|
77
|
-
@last_response = response = agent.send(method,
|
73
|
+
@last_response = response = agent.send(method, path, options)
|
78
74
|
Hashie::Mash.new(JSON.parse(response.body))
|
79
75
|
end
|
80
76
|
|
data/lib/atlas-api/version.rb
CHANGED
@@ -8,7 +8,7 @@ describe Atlas::Api::Client do
|
|
8
8
|
|
9
9
|
before(:each) do
|
10
10
|
@token = "abcdefg"
|
11
|
-
@endpoint = "http://
|
11
|
+
@endpoint = "http://atlas.oreilly.com"
|
12
12
|
@body = { message: "Success!" }
|
13
13
|
@client = Atlas::Api::Client.new(
|
14
14
|
auth_token: @token,
|
@@ -32,7 +32,7 @@ describe Atlas::Api::Client do
|
|
32
32
|
end
|
33
33
|
|
34
34
|
it "should combine paths from endpoint and path" do
|
35
|
-
@endpoint = "http://
|
35
|
+
@endpoint = "http://atlas.oreilly.com/api"
|
36
36
|
client = Atlas::Api::Client.new(
|
37
37
|
auth_token: @token,
|
38
38
|
api_endpoint: @endpoint
|
@@ -54,7 +54,7 @@ describe Atlas::Api::Client do
|
|
54
54
|
query = {
|
55
55
|
:project => "atlasservers/basic-sample",
|
56
56
|
:formats => "pdf,html",
|
57
|
-
:branch => "
|
57
|
+
:branch => "main",
|
58
58
|
:pingback_url => "http://www.someurl.com"
|
59
59
|
}
|
60
60
|
|
@@ -115,7 +115,7 @@ describe Atlas::Api::Client do
|
|
115
115
|
query = {
|
116
116
|
:project => "atlasservers/basic-sample",
|
117
117
|
:formats => "pdf,html",
|
118
|
-
:branch => "
|
118
|
+
:branch => "main",
|
119
119
|
:pingback_url => "http://www.someurl.com"
|
120
120
|
}
|
121
121
|
stub = stub_request_with_token(:post, "builds", @body.to_json, query)
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: atlas-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- O'Reilly Media Tools Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.7.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:
|
26
|
+
version: 2.7.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: hashie
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -68,15 +68,15 @@ dependencies:
|
|
68
68
|
version: '0'
|
69
69
|
description: Gem to interact with the O'Reilly Media Atlas API
|
70
70
|
email:
|
71
|
-
-
|
71
|
+
- toolsreq@oreilly.com
|
72
72
|
executables:
|
73
73
|
- atlas
|
74
74
|
extensions: []
|
75
75
|
extra_rdoc_files: []
|
76
76
|
files:
|
77
|
+
- ".github/workflows/ci.yaml"
|
77
78
|
- ".gitignore"
|
78
79
|
- ".rspec"
|
79
|
-
- ".travis.yml"
|
80
80
|
- Gemfile
|
81
81
|
- Gemfile.lock
|
82
82
|
- LICENSE.txt
|
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
107
|
- !ruby/object:Gem::Version
|
108
108
|
version: '0'
|
109
109
|
requirements: []
|
110
|
-
rubygems_version: 3.
|
110
|
+
rubygems_version: 3.0.9
|
111
111
|
signing_key:
|
112
112
|
specification_version: 4
|
113
113
|
summary: Gem to interact with the O'Reilly Media Atlas API
|
data/.travis.yml
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
rvm:
|
3
|
-
- 1.9.3
|
4
|
-
- 2.0.0
|
5
|
-
notifications:
|
6
|
-
campfire:
|
7
|
-
rooms:
|
8
|
-
- secure: "nay0jqTm7naZ7JKI6q9uG9Au4DfnRP94q1uaiJ+YW9jdV2ygzaB7GmI7fILo7uwCuoy0QIN8KQ/3PhdVeDoSweULs5PaoC7qlO+IX8scBcDMzsykY9JuTiO9cuSQeV0OFwKrStgTsX5a8lt7ryCd+zQXaHdo+FO6mnjy44YXoyI="
|
9
|
-
template:
|
10
|
-
- ":construction_worker: %{repository} (%{commit}) : %{message} %{foo} "
|
11
|
-
- "Build details: %{build_url}"
|