atlas-api 0.1.2 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 264f073c8279fe548de6a31548faa209b1d1f39691971554e0f28eba95cfeb82
4
- data.tar.gz: 52a2c7b2ff7025fee9b2e5b1344edee1c6f4353d86b5485b994d3d5208747b11
3
+ metadata.gz: f981ff921e8fe428fad90b0ff78c341f00b8f628c893893829f1276665138eba
4
+ data.tar.gz: 64c45de8a715f095097245a2b3674c6a07bbe32275b32280fed557b3fd62456c
5
5
  SHA512:
6
- metadata.gz: 662f794c13fdb63559b4762f4a3745a90923256a69f3c958845cd1a1cca9947397f123cadea475530770d1a6e3003415beae3b1241a5fe4d69538e134289afd4
7
- data.tar.gz: 5619b823efd9e8e1b49b28cb5203a6bc3681fba39a1c92b70d1d5aa50939de65e7378bbe4cf8ab9703e581eccf918eb2e0d21c5b1f0afbae26db055ba7d53091
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
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ coverage
data/Gemfile CHANGED
@@ -1,5 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem "rake", "~> 13.0.1"
4
+ gem "simplecov"
4
5
 
5
6
  gemspec
data/Gemfile.lock CHANGED
@@ -1,40 +1,49 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- atlas-api (0.1.2)
5
- faraday (~> 0.15.4)
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.0)
12
- public_suffix (>= 2.0.2, < 5.0)
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
- faraday (0.15.4)
17
- multipart-post (>= 1.2, < 3)
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
- multipart-post (2.1.1)
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.11.0)
25
- rspec-core (~> 3.11.0)
26
- rspec-expectations (~> 3.11.0)
27
- rspec-mocks (~> 3.11.0)
28
- rspec-core (3.11.0)
29
- rspec-support (~> 3.11.0)
30
- rspec-expectations (3.11.0)
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.11.0)
33
- rspec-mocks (3.11.1)
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.11.0)
36
- rspec-support (3.11.0)
37
- webmock (3.14.0)
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 master
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 = ["Rune Skjoldborg Madsen"]
10
- gem.email = ["rune@runemadsen.com"]
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", "~> 0.15.4"
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"
@@ -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, URI.encode(path), options)
73
+ @last_response = response = agent.send(method, path, options)
78
74
  Hashie::Mash.new(JSON.parse(response.body))
79
75
  end
80
76
 
@@ -1,5 +1,5 @@
1
1
  module Atlas
2
2
  module Api
3
- VERSION = "0.1.2"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
@@ -8,7 +8,7 @@ describe Atlas::Api::Client do
8
8
 
9
9
  before(:each) do
10
10
  @token = "abcdefg"
11
- @endpoint = "http://www.runemadsen.com"
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://www.runemadsen.com/api"
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 => "master",
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 => "master",
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
@@ -1,2 +1,4 @@
1
+ require 'simplecov'
2
+ SimpleCov.start
1
3
  require 'atlas-api'
2
4
  require 'webmock/rspec'
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.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
- - Rune Skjoldborg Madsen
7
+ - O'Reilly Media Tools Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-26 00:00:00.000000000 Z
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: 0.15.4
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: 0.15.4
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
- - rune@runemadsen.com
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.1.2
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}"