berkshelf 0.5.0.rc3 → 0.5.0.rc4

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
16
16
  s.version = Berkshelf::VERSION
17
17
  s.required_ruby_version = ">= 1.9.1"
18
18
 
19
- s.add_runtime_dependency 'ridley', '>= 0.0.4'
19
+ s.add_runtime_dependency 'ridley', '>= 0.0.5'
20
20
  s.add_runtime_dependency 'solve', '~> 0.2.1'
21
21
  s.add_runtime_dependency 'chef', '~> 10.12.0'
22
22
  s.add_runtime_dependency 'minitar'
@@ -379,6 +379,7 @@ module Berkshelf
379
379
  # @option options [URI, String, Hash] :proxy
380
380
  # URI, String, or Hash of HTTP proxy options
381
381
  def upload(options = {})
382
+ options[:organization] ||= ChefAPILocation.extract_organization(Chef::Config[:chef_server_url])
382
383
  uploader = Uploader.new(options)
383
384
  solution = resolve(options)
384
385
 
@@ -120,7 +120,6 @@ module Berkshelf
120
120
  server_url: Chef::Config[:chef_server_url],
121
121
  client_name: Chef::Config[:node_name],
122
122
  client_key: Chef::Config[:client_key],
123
- organization: ChefAPILocation.extract_organization(Chef::Config[:chef_server_url]),
124
123
  ssl: {
125
124
  verify: options[:ssl_verify]
126
125
  }
@@ -12,13 +12,12 @@ module Berkshelf
12
12
  @app = app
13
13
  @node_name = env[:global_config].berkshelf.node_name
14
14
  @client_key = env[:global_config].berkshelf.client_key
15
- @ssl_verify = env[:global_config].berkshelf.client_key
15
+ @ssl_verify = env[:global_config].berkshelf.ssl_verify
16
16
  @berksfile = Berksfile.from_file(env[:global_config].berkshelf.berksfile_path)
17
17
  end
18
18
 
19
19
  def call(env)
20
20
  if Berkshelf::Vagrant.chef_client?(env[:global_config])
21
- p env[:global_config].berkshelf
22
21
  upload(env)
23
22
  end
24
23
 
@@ -2,70 +2,60 @@ module Berkshelf
2
2
  module Vagrant
3
3
  # @author Jamie Winsor <jamie@vialstudios.com>
4
4
  # @author Andrew Garson <andrew.garson@gmail.com>
5
- #
6
- # @note according to <http://vagrantup.com/v1/docs/extending/configuration.html> instance
7
- # variables should not be instantiated with default values in the initializer of a Config file.
8
- # Instead explicit getters which set and return the default value should be used.
9
5
  class Config < ::Vagrant::Config::Base
10
6
  # @return [String]
11
7
  # path to a knife configuration file
12
- def config_path
13
- @config_path ||= Berkshelf::DEFAULT_CONFIG
14
- end
15
-
16
- # @param [String] value
17
- def config_path=(value)
18
- @config_path = File.expand_path(value)
19
- end
8
+ attr_reader :config_path
20
9
 
21
10
  # @return [String]
22
11
  # path to the Berksfile to use with Vagrant
23
- def berksfile_path
24
- @berksfile_path ||= File.join(Dir.pwd, Berkshelf::DEFAULT_FILENAME)
25
- end
26
-
27
- # @param [String] value
28
- def berksfile_path=(value)
29
- @berksfile_path = File.expand_path(value)
30
- end
12
+ attr_reader :berksfile_path
31
13
 
32
14
  # @return [String]
33
15
  # A path to a client key on disk to use with the Chef Client provisioner to
34
16
  # upload cookbooks installed by Berkshelf.
35
17
  attr_reader :client_key
36
18
 
37
- # @param [String] value
38
- def client_key=(value)
39
- @client_key = File.expand_path(value)
40
- end
41
-
42
19
  # @return [String]
43
20
  # A client name (node_name) to use with the Chef Client provisioner to upload
44
21
  # cookbooks installed by Berkshelf.
45
22
  attr_accessor :node_name
46
23
 
24
+ # @return [Array<Symbol>]
25
+ # only cookbooks in these groups will be installed and copied to
26
+ # Vagrant's shelf
27
+ attr_accessor :only
28
+
47
29
  # @return [Array<Symbol>]
48
30
  # cookbooks in all other groups except for these will be installed
49
31
  # and copied to Vagrant's shelf
50
- def except
51
- @except ||= Array.new
32
+ attr_accessor :except
33
+ attr_accessor :ssl_verify
34
+
35
+ def initialize
36
+ @berksfile_path = File.join(Dir.pwd, Berkshelf::DEFAULT_FILENAME)
37
+ @config_path = Berkshelf::DEFAULT_CONFIG
38
+ @node_name = nil
39
+ @client_key = nil
40
+ @except = Array.new
41
+ @only = Array.new
42
+ @ssl_verify = true
52
43
  end
53
- attr_writer :except
54
44
 
55
- # @return [Array<Symbol>]
56
- # only cookbooks in these groups will be installed and copied to
57
- # Vagrant's shelf
58
- def only
59
- @only ||= Array.new
45
+ # @param [String] value
46
+ def berksfile_path=(value)
47
+ @berksfile_path = File.expand_path(value)
60
48
  end
61
- attr_writer :only
62
49
 
63
- # @return [Boolean]
64
- # should connections to a Chef API use SSL verification
65
- def ssl_verify
66
- @ssl_verify ||= true
50
+ # @param [String] value
51
+ def config_path=(value)
52
+ @config_path = File.expand_path(value)
53
+ end
54
+
55
+ # @param [String] value
56
+ def client_key=(value)
57
+ @client_key = File.expand_path(value)
67
58
  end
68
- attr_writer :ssl_verify
69
59
 
70
60
  def validate(env, errors)
71
61
  if !except.empty? && !only.empty?
@@ -1,3 +1,3 @@
1
1
  module Berkshelf
2
- VERSION = "0.5.0.rc3"
2
+ VERSION = "0.5.0.rc4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: berkshelf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0.rc3
4
+ version: 0.5.0.rc4
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2012-09-21 00:00:00.000000000 Z
15
+ date: 2012-09-22 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: ridley
@@ -21,7 +21,7 @@ dependencies:
21
21
  requirements:
22
22
  - - ! '>='
23
23
  - !ruby/object:Gem::Version
24
- version: 0.0.4
24
+ version: 0.0.5
25
25
  type: :runtime
26
26
  prerelease: false
27
27
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  requirements:
30
30
  - - ! '>='
31
31
  - !ruby/object:Gem::Version
32
- version: 0.0.4
32
+ version: 0.0.5
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: solve
35
35
  requirement: !ruby/object:Gem::Requirement