berkshelf-api-client 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +7 -2
- data/Gemfile +2 -1
- data/README.md +1 -0
- data/berkshelf-api-client.gemspec +1 -0
- data/lib/berkshelf/api_client.rb +5 -0
- data/lib/berkshelf/api_client/chef_server_connection.rb +27 -0
- data/lib/berkshelf/api_client/version.rb +1 -1
- metadata +18 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8992859c8aa1ae4d0d8174264ae072931a94f86
|
4
|
+
data.tar.gz: 2cfd32279d56f45e3c5972caed3f7ab07656c5f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7421c99b70ac8d98f93939ff018067ddf0fe937f40b6519ac8405d3bc23897d4ef88855a61eff9b85dc2ab9236ee24f8e70d3909b834e8754e07ffd27ce7b88d
|
7
|
+
data.tar.gz: 835d85c3c2fe4dd9a0288023ef75423db5256fddc498e9841bfe9e8094fc08639c214f7c208b112723e415e275975a34b14b94d89c1e91dcc4aca6ce29dfb4f5
|
data/.travis.yml
CHANGED
@@ -1,8 +1,13 @@
|
|
1
|
+
sudo: false
|
1
2
|
language: ruby
|
2
3
|
rvm:
|
3
4
|
- 2.0.0
|
4
5
|
- 2.1
|
5
6
|
- 2.2
|
6
|
-
|
7
|
-
|
7
|
+
cache: bundler
|
8
|
+
addons:
|
9
|
+
apt:
|
10
|
+
packages:
|
11
|
+
- libarchive12
|
12
|
+
- libarchive-dev
|
8
13
|
script: bundle exec rake spec
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -29,6 +29,7 @@ Gem::Specification.new do |spec|
|
|
29
29
|
|
30
30
|
spec.add_dependency "faraday", "~> 0.9.1"
|
31
31
|
spec.add_dependency "httpclient", "~> 2.7.0"
|
32
|
+
spec.add_dependency "ridley", "~> 4.5"
|
32
33
|
|
33
34
|
spec.add_development_dependency "bundler", "~> 1.3"
|
34
35
|
spec.add_development_dependency "rake"
|
data/lib/berkshelf/api_client.rb
CHANGED
@@ -9,11 +9,16 @@ module Berkshelf
|
|
9
9
|
require_relative 'api_client/errors'
|
10
10
|
require_relative 'api_client/remote_cookbook'
|
11
11
|
require_relative 'api_client/connection'
|
12
|
+
require_relative 'api_client/chef_server_connection'
|
12
13
|
|
13
14
|
class << self
|
14
15
|
def new(*args)
|
15
16
|
Connection.new(*args)
|
16
17
|
end
|
18
|
+
|
19
|
+
def chef_server(*args)
|
20
|
+
ChefServerConnection.new(*args)
|
21
|
+
end
|
17
22
|
end
|
18
23
|
end
|
19
24
|
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
|
2
|
+
module Berkshelf::APIClient
|
3
|
+
require_relative 'errors'
|
4
|
+
|
5
|
+
class ChefServerConnection
|
6
|
+
attr_reader :client
|
7
|
+
|
8
|
+
def initialize(*args)
|
9
|
+
@client = Ridley.new(*args)
|
10
|
+
@url = args[0][:server_url]
|
11
|
+
end
|
12
|
+
|
13
|
+
def universe
|
14
|
+
response = client.universe
|
15
|
+
|
16
|
+
[].tap do |cookbooks|
|
17
|
+
response.each do |name, versions|
|
18
|
+
versions.each { |version, attributes|
|
19
|
+
attributes[:location_path] = @url
|
20
|
+
cookbooks << RemoteCookbook.new(name, version, attributes) }
|
21
|
+
end
|
22
|
+
end
|
23
|
+
rescue Ridley::Errors::HTTPNotFound
|
24
|
+
raise ServiceNotFound, "service not found at: #{url}"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: berkshelf-api-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamie Winsor
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-
|
13
|
+
date: 2016-03-08 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: faraday
|
@@ -40,6 +40,20 @@ dependencies:
|
|
40
40
|
- - "~>"
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: 2.7.0
|
43
|
+
- !ruby/object:Gem::Dependency
|
44
|
+
name: ridley
|
45
|
+
requirement: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - "~>"
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '4.5'
|
50
|
+
type: :runtime
|
51
|
+
prerelease: false
|
52
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - "~>"
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '4.5'
|
43
57
|
- !ruby/object:Gem::Dependency
|
44
58
|
name: bundler
|
45
59
|
requirement: !ruby/object:Gem::Requirement
|
@@ -143,6 +157,7 @@ files:
|
|
143
157
|
- berkshelf-api-client.gemspec
|
144
158
|
- lib/berkshelf/api-client.rb
|
145
159
|
- lib/berkshelf/api_client.rb
|
160
|
+
- lib/berkshelf/api_client/chef_server_connection.rb
|
146
161
|
- lib/berkshelf/api_client/connection.rb
|
147
162
|
- lib/berkshelf/api_client/errors.rb
|
148
163
|
- lib/berkshelf/api_client/remote_cookbook.rb
|
@@ -171,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
171
186
|
version: '0'
|
172
187
|
requirements: []
|
173
188
|
rubyforge_project:
|
174
|
-
rubygems_version: 2.5.
|
189
|
+
rubygems_version: 2.4.5.1
|
175
190
|
signing_key:
|
176
191
|
specification_version: 4
|
177
192
|
summary: API Client for communicating with a Berkshelf API server
|