ridley 0.8.3 → 0.8.5

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.
Files changed (44) hide show
  1. data/LICENSE +1 -1
  2. data/README.md +4 -1
  3. data/lib/ridley.rb +1 -1
  4. data/lib/ridley/bootstrapper.rb +1 -1
  5. data/lib/ridley/bootstrapper/context.rb +1 -1
  6. data/lib/ridley/chain_link.rb +1 -1
  7. data/lib/ridley/chef.rb +1 -1
  8. data/lib/ridley/chef/cookbook.rb +1 -1
  9. data/lib/ridley/chef/cookbook/metadata.rb +1 -1
  10. data/lib/ridley/chef/cookbook/syntax_check.rb +1 -1
  11. data/lib/ridley/chef/digester.rb +1 -1
  12. data/lib/ridley/client.rb +1 -1
  13. data/lib/ridley/connection.rb +1 -1
  14. data/lib/ridley/errors.rb +1 -1
  15. data/lib/ridley/log.rb +1 -1
  16. data/lib/ridley/logging.rb +1 -1
  17. data/lib/ridley/middleware.rb +1 -1
  18. data/lib/ridley/middleware/chef_auth.rb +1 -1
  19. data/lib/ridley/middleware/chef_response.rb +1 -1
  20. data/lib/ridley/middleware/parse_json.rb +1 -1
  21. data/lib/ridley/middleware/retry.rb +1 -1
  22. data/lib/ridley/mixin/checksum.rb +1 -1
  23. data/lib/ridley/mixin/shell_out.rb +1 -1
  24. data/lib/ridley/resource.rb +1 -1
  25. data/lib/ridley/resources/client_resource.rb +1 -1
  26. data/lib/ridley/resources/cookbook_resource.rb +7 -7
  27. data/lib/ridley/resources/data_bag_item_resource.rb +2 -2
  28. data/lib/ridley/resources/data_bag_resource.rb +2 -2
  29. data/lib/ridley/resources/encrypted_data_bag_item_resource.rb +1 -1
  30. data/lib/ridley/resources/environment_resource.rb +1 -1
  31. data/lib/ridley/resources/node_resource.rb +2 -1
  32. data/lib/ridley/resources/role_resource.rb +1 -1
  33. data/lib/ridley/resources/sandbox_resource.rb +1 -1
  34. data/lib/ridley/sandbox_uploader.rb +2 -2
  35. data/lib/ridley/ssh.rb +1 -1
  36. data/lib/ridley/ssh/response.rb +1 -1
  37. data/lib/ridley/ssh/response_set.rb +1 -1
  38. data/lib/ridley/ssh/worker.rb +1 -1
  39. data/lib/ridley/version.rb +1 -1
  40. data/ridley.gemspec +1 -1
  41. data/spec/fixtures/example_cookbook/metadata.rb +1 -1
  42. data/spec/unit/ridley/resources/cookbook_resource_spec.rb +3 -3
  43. data/spec/unit/ridley/sandbox_uploader_spec.rb +10 -6
  44. metadata +4 -4
data/LICENSE CHANGED
@@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work.
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright 2012, Jamie Winsor
189
+ Copyright 2012-2013, Riot Games
190
190
 
191
191
  Licensed under the Apache License, Version 2.0 (the "License");
192
192
  you may not use this file except in compliance with the License.
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  # Ridley
2
+ [![Gem Version](https://badge.fury.io/rb/ridley.png)](http://badge.fury.io/rb/ridley)
2
3
  [![Build Status](https://secure.travis-ci.org/reset/ridley.png?branch=master)](http://travis-ci.org/reset/ridley)
3
4
  [![Dependency Status](https://gemnasium.com/reset/ridley.png?travis)](https://gemnasium.com/reset/ridley)
4
5
  [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/reset/ridley)
@@ -349,4 +350,6 @@ And the same goes for setting an environment level override attribute
349
350
 
350
351
  # Authors and Contributors
351
352
 
352
- * Jamie Winsor (<jamie@vialstudios.com>)
353
+ * Jamie Winsor (<reset@riotgames.com>)
354
+
355
+ Thank you to all of our [Contributors](https://github.com/RiotGames/ridley/graphs/contributors), testers, and users.
data/lib/ridley.rb CHANGED
@@ -20,7 +20,7 @@ require 'ridley/errors'
20
20
 
21
21
  JSON.create_id = nil
22
22
 
23
- # @author Jamie Winsor <jamie@vialstudios.com>
23
+ # @author Jamie Winsor <reset@riotgames.com>
24
24
  module Ridley
25
25
  CHEF_VERSION = '11.4.0'.freeze
26
26
 
@@ -1,5 +1,5 @@
1
1
  module Ridley
2
- # @author Jamie Winsor <jamie@vialstudios.com>
2
+ # @author Jamie Winsor <reset@riotgames.com>
3
3
  class Bootstrapper
4
4
  autoload :Context, 'ridley/bootstrapper/context'
5
5
 
@@ -2,7 +2,7 @@ require 'erubis'
2
2
 
3
3
  module Ridley
4
4
  class Bootstrapper
5
- # @author Jamie Winsor <jamie@vialstudios.com>
5
+ # @author Jamie Winsor <reset@riotgames.com>
6
6
  class Context
7
7
  class << self
8
8
  def validate_options(options = {})
@@ -1,5 +1,5 @@
1
1
  module Ridley
2
- # @author Jamie Winsor <jamie@vialstudios.com>
2
+ # @author Jamie Winsor <reset@riotgames.com>
3
3
  # @api private
4
4
  class ChainLink
5
5
  attr_reader :parent
data/lib/ridley/chef.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Ridley
2
- # @author Jamie Winsor <jamie@vialstudios.com>
2
+ # @author Jamie Winsor <reset@riotgames.com>
3
3
  #
4
4
  # Classes and modules used for integrating with a Chef Server, the Chef community
5
5
  # site, and Chef Cookbooks
@@ -1,5 +1,5 @@
1
1
  module Ridley::Chef
2
- # @author Jamie Winsor <jamie@vialstudios.com>
2
+ # @author Jamie Winsor <reset@riotgames.com>
3
3
  class Cookbook
4
4
  autoload :Metadata, 'ridley/chef/cookbook/metadata'
5
5
  autoload :SyntaxCheck, 'ridley/chef/cookbook/syntax_check'
@@ -1,6 +1,6 @@
1
1
  module Ridley::Chef
2
2
  class Cookbook
3
- # @author Jamie Winsor <jamie@vialstudios.com>
3
+ # @author Jamie Winsor <reset@riotgames.com>
4
4
  #
5
5
  # Borrowed and modified from: {https://raw.github.com/opscode/chef/11.4.0/lib/chef/cookbook/metadata.rb}
6
6
  #
@@ -1,6 +1,6 @@
1
1
  module Ridley::Chef
2
2
  class Cookbook
3
- # @author Jamie Winsor <jamie@vialstudios.com>
3
+ # @author Jamie Winsor <reset@riotgames.com>
4
4
  #
5
5
  # Encapsulates the process of validating the ruby syntax of files in Chef
6
6
  # cookbooks.
@@ -1,7 +1,7 @@
1
1
  require 'digest'
2
2
 
3
3
  module Ridley::Chef
4
- # @author Jamie Winsor <jamie@vialstudios.com>
4
+ # @author Jamie Winsor <reset@riotgames.com>
5
5
  #
6
6
  # Borrowed and modified from: {https://github.com/opscode/chef/blob/11.4.0/lib/chef/digester.rb}
7
7
  class Digester
data/lib/ridley/client.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Ridley
2
- # @author Jamie Winsor <jamie@vialstudios.com>
2
+ # @author Jamie Winsor <reset@riotgames.com>
3
3
  #
4
4
  # @example
5
5
  # connection = Ridley::Client.new
@@ -3,7 +3,7 @@ require 'retryable'
3
3
  require 'tempfile'
4
4
 
5
5
  module Ridley
6
- # @author Jamie Winsor <jamie@vialstudios.com>
6
+ # @author Jamie Winsor <reset@riotgames.com>
7
7
  class Connection < Faraday::Connection
8
8
  include Celluloid
9
9
 
data/lib/ridley/errors.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Ridley
2
- # @author Jamie Winsor <jamie@vialstudios.com>
2
+ # @author Jamie Winsor <reset@riotgames.com>
3
3
  module Errors
4
4
  class RidleyError < StandardError; end
5
5
  class InternalError < RidleyError; end
data/lib/ridley/log.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'mixlib/log'
2
2
 
3
3
  module Ridley
4
- # @author Jamie Winsor <jamie@vialstudios.com>
4
+ # @author Jamie Winsor <reset@riotgames.com>
5
5
  class Log
6
6
  extend Mixlib::Log
7
7
 
@@ -1,7 +1,7 @@
1
1
  require 'logger'
2
2
 
3
3
  module Ridley
4
- # @author Jamie Winsor <jamie@vialstudios.com>
4
+ # @author Jamie Winsor <reset@riotgames.com>
5
5
  module Logging
6
6
  class << self
7
7
  # @return [Logger]
@@ -1,5 +1,5 @@
1
1
  module Ridley
2
- # @author Jamie Winsor <jamie@vialstudios.com>
2
+ # @author Jamie Winsor <reset@riotgames.com>
3
3
  module Middleware
4
4
  CONTENT_TYPE = 'content-type'.freeze
5
5
 
@@ -2,7 +2,7 @@ require 'mixlib/authentication/signedheaderauth'
2
2
 
3
3
  module Ridley
4
4
  module Middleware
5
- # @author Jamie Winsor <jamie@vialstudios.com>
5
+ # @author Jamie Winsor <reset@riotgames.com>
6
6
  class ChefAuth < Faraday::Middleware
7
7
  class << self
8
8
  include Mixlib::Authentication
@@ -1,6 +1,6 @@
1
1
  module Ridley
2
2
  module Middleware
3
- # @author Jamie Winsor <jamie@vialstudios.com>
3
+ # @author Jamie Winsor <reset@riotgames.com>
4
4
  class ChefResponse < Faraday::Response::Middleware
5
5
  class << self
6
6
  # Determines if a response from the Chef server was successful
@@ -1,6 +1,6 @@
1
1
  module Ridley
2
2
  module Middleware
3
- # @author Jamie Winsor <jamie@vialstudios.com>
3
+ # @author Jamie Winsor <reset@riotgames.com>
4
4
  class ParseJson < Faraday::Response::Middleware
5
5
  include Ridley::Logging
6
6
 
@@ -1,5 +1,5 @@
1
1
  module Ridley
2
- # @author Jamie Winsor <jamie@vialstudios.com>
2
+ # @author Jamie Winsor <reset@riotgames.com>
3
3
  #
4
4
  # Catches exceptions and retries each request a limited number of times.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  module Ridley::Mixin
2
- # @author Jamie Winsor <jamie@vialstudios.com>
2
+ # @author Jamie Winsor <reset@riotgames.com>
3
3
  #
4
4
  # Inspired by and dependency-free replacement for
5
5
  # {https://github.com/opscode/chef/blob/11.4.0/lib/chef/mixin/checksum.rb}
@@ -1,7 +1,7 @@
1
1
  require 'mixlib/shellout'
2
2
 
3
3
  module Ridley::Mixin
4
- # @author Jamie Winsor <jamie@vialstudios.com>
4
+ # @author Jamie Winsor <reset@riotgames.com>
5
5
  module ShellOut
6
6
  # @return [Mixlib::ShellOut]
7
7
  def shell_out(*command_args)
@@ -1,5 +1,5 @@
1
1
  module Ridley
2
- # @author Jamie Winsor <jamie@vialstudios.com>
2
+ # @author Jamie Winsor <reset@riotgames.com>
3
3
  class Resource
4
4
  class << self
5
5
  # @return [String, nil]
@@ -1,5 +1,5 @@
1
1
  module Ridley
2
- # @author Jamie Winsor <jamie@vialstudios.com>
2
+ # @author Jamie Winsor <reset@riotgames.com>
3
3
  class ClientResource < Ridley::Resource
4
4
  class << self
5
5
  # Retrieves a client from the remote connection matching the given chef_id
@@ -1,5 +1,5 @@
1
1
  module Ridley
2
- # @author Jamie Winsor <jamie@vialstudios.com>
2
+ # @author Jamie Winsor <reset@riotgames.com>
3
3
  class CookbookResource < Ridley::Resource
4
4
  class << self
5
5
  # List all of the cookbooks and their versions present on the remote
@@ -311,7 +311,7 @@ module Ridley
311
311
  manifest[filetype].each do |file|
312
312
  file_destination = File.join(destination, file[:path].gsub('/', File::SEPARATOR))
313
313
  FileUtils.mkdir_p(File.dirname(file_destination))
314
- download_file(filetype, file[:name], file_destination)
314
+ download_file(filetype, file[:path], file_destination)
315
315
  end
316
316
  end
317
317
 
@@ -334,14 +334,14 @@ module Ridley
334
334
  # these types are where the files are stored in your cookbook's structure. For example, a
335
335
  # recipe would be stored in the recipes directory while a root_file is stored at the root
336
336
  # of your cookbook
337
- # @param [String] name
338
- # name of the file to download
337
+ # @param [String] path
338
+ # path of the file to download
339
339
  # @param [String] destination
340
340
  # where to download the file to
341
341
  #
342
342
  # @return [nil]
343
- def download_file(filetype, name, destination)
344
- download_fun(filetype).call(name, destination)
343
+ def download_file(filetype, path, destination)
344
+ download_fun(filetype).call(path, destination)
345
345
  end
346
346
 
347
347
  # A hash containing keys for all of the different cookbook filetypes with values
@@ -400,7 +400,7 @@ module Ridley
400
400
 
401
401
  ->(target, destination) {
402
402
  files = collection.call # JW: always chaining .call.find results in a nil value. WHY?
403
- file = files.find { |f| f[:name] == target }
403
+ file = files.find { |f| f[:path] == target }
404
404
  return nil if file.nil?
405
405
 
406
406
  destination = File.expand_path(destination)
@@ -1,5 +1,5 @@
1
1
  module Ridley
2
- # @author Jamie Winsor <jamie@vialstudios.com>
2
+ # @author Jamie Winsor <reset@riotgames.com>
3
3
  class DataBagItemResource < Ridley::Resource
4
4
  class << self
5
5
  # @param [Ridley::Client] client
@@ -171,7 +171,7 @@ module Ridley
171
171
  def update
172
172
  raise Errors::InvalidResource.new(self.errors) unless valid?
173
173
 
174
- mass_assign(sself.class.update(client, data_bag, self)._attributes_)
174
+ mass_assign(self.class.update(client, data_bag, self)._attributes_)
175
175
  true
176
176
  end
177
177
 
@@ -2,7 +2,7 @@ require 'ridley/resources/data_bag_item_resource'
2
2
  require 'ridley/resources/encrypted_data_bag_item_resource'
3
3
 
4
4
  module Ridley
5
- # @author Jamie Winsor <jamie@vialstudios.com>
5
+ # @author Jamie Winsor <reset@riotgames.com>
6
6
  # @api private
7
7
  class DBIChainLink
8
8
  attr_reader :data_bag
@@ -30,7 +30,7 @@ module Ridley
30
30
  end
31
31
  end
32
32
 
33
- # @author Jamie Winsor <jamie@vialstudios.com>
33
+ # @author Jamie Winsor <reset@riotgames.com>
34
34
  class DataBagResource < Ridley::Resource
35
35
  class << self
36
36
  # @param [Ridley::Client] client
@@ -1,5 +1,5 @@
1
1
  module Ridley
2
- # @author Jamie Winsor <jamie@vialstudios.com>
2
+ # @author Jamie Winsor <reset@riotgames.com>
3
3
  class EncryptedDataBagItemResource
4
4
  class << self
5
5
  # Finds a data bag item and decrypts it.
@@ -1,5 +1,5 @@
1
1
  module Ridley
2
- # @author Jamie Winsor <jamie@vialstudios.com>
2
+ # @author Jamie Winsor <reset@riotgames.com>
3
3
  class EnvironmentResource < Ridley::Resource
4
4
  class << self
5
5
  # Delete all of the environments on the client. The '_default' environment
@@ -1,5 +1,5 @@
1
1
  module Ridley
2
- # @author Jamie Winsor <jamie@vialstudios.com>
2
+ # @author Jamie Winsor <reset@riotgames.com>
3
3
  class NodeResource < Ridley::Resource
4
4
  class << self
5
5
  # @overload bootstrap(client, nodes, options = {})
@@ -54,6 +54,7 @@ module Ridley
54
54
  # @param [Ridley::Client] client
55
55
  # @param [Ridley::NodeResource, String] target
56
56
  # node or identifier of the node to merge
57
+ #
57
58
  # @option options [Array] :run_list
58
59
  # run list items to merge
59
60
  # @option options [Hash] :attributes
@@ -1,5 +1,5 @@
1
1
  module Ridley
2
- # @author Jamie Winsor <jamie@vialstudios.com>
2
+ # @author Jamie Winsor <reset@riotgames.com>
3
3
  class RoleResource < Ridley::Resource
4
4
  set_chef_id "name"
5
5
  set_chef_type "role"
@@ -1,5 +1,5 @@
1
1
  module Ridley
2
- # @author Jamie Winsor <jamie@vialstudios.com>
2
+ # @author Jamie Winsor <reset@riotgames.com>
3
3
  class SandboxResource
4
4
  class << self
5
5
  # Create a new Sandbox on the client's Chef Server. A Sandbox requires an
@@ -1,5 +1,5 @@
1
1
  module Ridley
2
- # @author Jamie Winsor <jamie@vialstudios.com>
2
+ # @author Jamie Winsor <reset@riotgames.com>
3
3
  # @api private
4
4
  class SandboxUploader
5
5
  class << self
@@ -32,7 +32,7 @@ module Ridley
32
32
  File.open(path, 'rb') { |f| checksum_io(f, Digest::MD5.new) }
33
33
  end
34
34
 
35
- # Return a base64 encoded checksum of the contents of hte given file. This is the expected
35
+ # Return a base64 encoded checksum of the contents of the given file. This is the expected
36
36
  # format of sandbox checksums given to the Chef Server.
37
37
  #
38
38
  # @param [String] path
data/lib/ridley/ssh.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'net/ssh'
2
2
 
3
3
  module Ridley
4
- # @author Jamie Winsor <jamie@vialstudios.com>
4
+ # @author Jamie Winsor <reset@riotgames.com>
5
5
  class SSH
6
6
  autoload :Response, 'ridley/ssh/response'
7
7
  autoload :ResponseSet, 'ridley/ssh/response_set'
@@ -1,6 +1,6 @@
1
1
  module Ridley
2
2
  class SSH
3
- # @author Jamie Winsor <jamie@vialstudios.com>
3
+ # @author Jamie Winsor <reset@riotgames.com>
4
4
  class Response
5
5
  attr_reader :host
6
6
 
@@ -1,6 +1,6 @@
1
1
  module Ridley
2
2
  class SSH
3
- # @author Jamie Winsor <jamie@vialstudios.com>
3
+ # @author Jamie Winsor <reset@riotgames.com>
4
4
  class ResponseSet
5
5
  class << self
6
6
  # Merges the responses of the other ResponseSet with the target ResponseSet
@@ -1,6 +1,6 @@
1
1
  module Ridley
2
2
  class SSH
3
- # @author Jamie Winsor <jamie@vialstudios.com>
3
+ # @author Jamie Winsor <reset@riotgames.com>
4
4
  # @api private
5
5
  class Worker
6
6
  include Celluloid
@@ -1,3 +1,3 @@
1
1
  module Ridley
2
- VERSION = "0.8.3"
2
+ VERSION = "0.8.5"
3
3
  end
data/ridley.gemspec CHANGED
@@ -3,7 +3,7 @@ require File.expand_path('../lib/ridley/version', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.authors = ["Jamie Winsor"]
6
- s.email = ["jamie@vialstudios.com"]
6
+ s.email = ["reset@riotgames.com"]
7
7
  s.description = %q{A reliable Chef API client with a clean syntax}
8
8
  s.summary = s.description
9
9
  s.homepage = "https://github.com/reset/ridley"
@@ -1,6 +1,6 @@
1
1
  name "example_cookbook"
2
2
  maintainer "Jamie Winsor"
3
- maintainer_email "jamie@vialstudios.com"
3
+ maintainer_email "reset@riotgames.com"
4
4
  license "Apache 2.0"
5
5
  description "Installs/Configures example_cookbook"
6
6
  long_description IO.read(File.join(File.dirname(__FILE__), "README.md"))
@@ -203,8 +203,8 @@ describe Ridley::CookbookResource do
203
203
  }
204
204
  end
205
205
 
206
- subject.should_receive(:download_file).with(:recipes, "default.rb", anything)
207
- subject.should_receive(:download_file).with(:files, "README", anything)
206
+ subject.should_receive(:download_file).with(:recipes, "recipes/default.rb", anything)
207
+ subject.should_receive(:download_file).with(:files, "files/default/plugins/README", anything)
208
208
 
209
209
  subject.download
210
210
  end
@@ -214,7 +214,7 @@ describe Ridley::CookbookResource do
214
214
  let(:destination) { tmp_path.join('fake.file').to_s }
215
215
 
216
216
  before(:each) do
217
- subject.stub(:root_files) { [ { name: 'metadata.rb', url: "http://test.it/file" } ] }
217
+ subject.stub(:root_files) { [ { path: 'metadata.rb', url: "http://test.it/file" } ] }
218
218
  end
219
219
 
220
220
  it "downloads the file from the file's url" do
@@ -36,15 +36,19 @@ describe Ridley::SandboxUploader do
36
36
  end
37
37
 
38
38
  describe "::checksum" do
39
- it "returns a string" do
40
- subject.checksum(fixtures_path.join('reset.pem')).should be_a(String)
41
- end
39
+ subject { described_class.checksum(path) }
40
+
41
+ let(:path) { fixtures_path.join('reset.pem') }
42
+
43
+ it { should eq("a0608f1eb43ee4cca510bf95f8d209f7") }
42
44
  end
43
45
 
44
46
  describe "::checksum64" do
45
- it "returns a string" do
46
- subject.checksum64(fixtures_path.join('reset.pem')).should be_a(String)
47
- end
47
+ subject { described_class.checksum64(path) }
48
+
49
+ let(:path) { fixtures_path.join('reset.pem') }
50
+
51
+ it { should eq("oGCPHrQ+5MylEL+V+NIJ9w==") }
48
52
  end
49
53
  end
50
54
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ridley
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.8.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-07 00:00:00.000000000 Z
12
+ date: 2013-03-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
@@ -269,7 +269,7 @@ dependencies:
269
269
  version: '0'
270
270
  description: A reliable Chef API client with a clean syntax
271
271
  email:
272
- - jamie@vialstudios.com
272
+ - reset@riotgames.com
273
273
  executables: []
274
274
  extensions: []
275
275
  extra_rdoc_files: []
@@ -401,7 +401,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
401
401
  version: '0'
402
402
  segments:
403
403
  - 0
404
- hash: 3451325282232038197
404
+ hash: -383872580603782424
405
405
  requirements: []
406
406
  rubyforge_project:
407
407
  rubygems_version: 1.8.24