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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3d5341e52800bebff8becf9c9d70dd438201acdc
4
- data.tar.gz: 998cffb2dab5afbcf25100407513f415ab1a992a
3
+ metadata.gz: c8992859c8aa1ae4d0d8174264ae072931a94f86
4
+ data.tar.gz: 2cfd32279d56f45e3c5972caed3f7ab07656c5f6
5
5
  SHA512:
6
- metadata.gz: 1a9177acd3e2f61ea48164d1f9a2feb06d57a3f3ba2cd2051c5d74ff4def057e8f9dbcca2a87cbf65913dbdc29a7b48eea4dad86dc37eb313e869c215b923ddc
7
- data.tar.gz: a4af3f6a80f4995c102b044c7d98a246eef664dacaf8e4834e1928c1413dc9db0d3aef337a0e8e0d6661116e6f6b7555950bd0f7e94731b1e6f8228b55c6bcd1
6
+ metadata.gz: 7421c99b70ac8d98f93939ff018067ddf0fe937f40b6519ac8405d3bc23897d4ef88855a61eff9b85dc2ab9236ee24f8e70d3909b834e8754e07ffd27ce7b88d
7
+ data.tar.gz: 835d85c3c2fe4dd9a0288023ef75423db5256fddc498e9841bfe9e8094fc08639c214f7c208b112723e415e275975a34b14b94d89c1e91dcc4aca6ce29dfb4f5
@@ -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
- before_install:
7
- - sudo apt-get install -qq libarchive12 libarchive-dev
7
+ cache: bundler
8
+ addons:
9
+ apt:
10
+ packages:
11
+ - libarchive12
12
+ - libarchive-dev
8
13
  script: bundle exec rake spec
data/Gemfile CHANGED
@@ -31,5 +31,6 @@ group :guard do
31
31
  end
32
32
 
33
33
  group :test do
34
- gem "berkshelf-api", "~> 1.2"
34
+ gem "berkshelf-api", "~> 2.1"
35
+ gem "reel", "~> 0.6.0"
35
36
  end
data/README.md CHANGED
@@ -28,3 +28,4 @@ Or install it yourself as:
28
28
  3. Commit your changes (`git commit -am 'Add some feature'`)
29
29
  4. Push to the branch (`git push origin my-new-feature`)
30
30
  5. Create new Pull Request
31
+
@@ -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"
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Berkshelf
2
2
  module APIClient
3
- VERSION = "2.0.1"
3
+ VERSION = "2.0.2"
4
4
  end
5
5
  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.1
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-02-19 00:00:00.000000000 Z
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.2
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