berkshelf 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Guardfile +2 -0
- data/LICENSE +1 -0
- data/berkshelf.gemspec +1 -0
- data/features/init_command.feature +4 -4
- data/features/step_definitions/cli_steps.rb +1 -1
- data/features/step_definitions/filesystem_steps.rb +1 -1
- data/features/without.feature +2 -1
- data/lib/berkshelf/berksfile.rb +7 -2
- data/lib/berkshelf/cli.rb +1 -8
- data/lib/berkshelf/version.rb +1 -1
- data/spec/unit/berkshelf/init_generator_spec.rb +2 -2
- metadata +19 -3
data/Guardfile
CHANGED
@@ -20,4 +20,6 @@ guard 'cucumber', :cli => "--drb --format pretty --tags ~@wip", :all_on_start =>
|
|
20
20
|
watch(%r{^features/.+\.feature$})
|
21
21
|
watch(%r{^features/support/.+$}) { 'features' }
|
22
22
|
watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
|
23
|
+
|
24
|
+
watch(%r{^lib/berkshelf/cli.rb}) { 'features' }
|
23
25
|
end
|
data/LICENSE
CHANGED
data/berkshelf.gemspec
CHANGED
@@ -7,8 +7,8 @@ Feature: initialize command
|
|
7
7
|
Given a cookbook named "sparkle_motion"
|
8
8
|
When I run the init command with the cookbook "sparkle_motion" as the target
|
9
9
|
Then the cookbook "sparkle_motion" should have the following files:
|
10
|
-
| Berksfile
|
11
|
-
|
|
10
|
+
| Berksfile |
|
11
|
+
| chefignore |
|
12
12
|
And the file "Berksfile" in the cookbook "sparkle_motion" should contain:
|
13
13
|
"""
|
14
14
|
metadata
|
@@ -22,7 +22,7 @@ Feature: initialize command
|
|
22
22
|
Then the directory "not_a_cookbook" should have the following files:
|
23
23
|
| Berksfile |
|
24
24
|
And the directory "not_a_cookbook" should not have the following files:
|
25
|
-
|
|
25
|
+
| chefignore |
|
26
26
|
And the file "Berksfile" in the directory "not_a_cookbook" should not contain:
|
27
27
|
"""
|
28
28
|
metadata
|
@@ -36,5 +36,5 @@ Feature: initialize command
|
|
36
36
|
And the current directory should have the following files:
|
37
37
|
| Berksfile |
|
38
38
|
And the current directory should not have the following files:
|
39
|
-
|
|
39
|
+
| chefignore |
|
40
40
|
And the exit status should be 0
|
@@ -39,7 +39,7 @@ When /^I run the init command with no value for the target$/ do
|
|
39
39
|
end
|
40
40
|
|
41
41
|
When /^I run the install command$/ do
|
42
|
-
run_simple(unescape("berks install"),
|
42
|
+
run_simple(unescape("berks install"), false)
|
43
43
|
end
|
44
44
|
|
45
45
|
When /^I run the install command with flags:$/ do |flags|
|
data/features/without.feature
CHANGED
@@ -17,7 +17,8 @@ Feature: --without block
|
|
17
17
|
cookbook "ntp", "= 1.1.8"
|
18
18
|
end
|
19
19
|
"""
|
20
|
-
When I run
|
20
|
+
When I run the install command with flags:
|
21
|
+
| --without notme |
|
21
22
|
Then the cookbook store should have the cookbooks:
|
22
23
|
| mysql | 1.2.4 |
|
23
24
|
| ntp | 1.1.8 |
|
data/lib/berkshelf/berksfile.rb
CHANGED
@@ -185,8 +185,13 @@ module Berkshelf
|
|
185
185
|
def write_shims(path, cached_cookbooks)
|
186
186
|
FileUtils.mkdir_p(path)
|
187
187
|
cached_cookbooks.each do |cached_cookbook|
|
188
|
-
destination = File.join(path, cached_cookbook.cookbook_name)
|
189
|
-
|
188
|
+
destination = File.expand_path(File.join(path, cached_cookbook.cookbook_name))
|
189
|
+
begin
|
190
|
+
FileUtils.ln_r(cached_cookbook.path, destination, force: true)
|
191
|
+
rescue ArgumentError
|
192
|
+
Berkshelf.ui.warn "Skipping shim for #{cached_cookbook}."
|
193
|
+
Berkshelf.ui.warn "Cannot write a shim for a path location source into a subdirectory of itself."
|
194
|
+
end
|
190
195
|
end
|
191
196
|
end
|
192
197
|
|
data/lib/berkshelf/cli.rb
CHANGED
@@ -32,6 +32,7 @@ module Berkshelf
|
|
32
32
|
method_option :shims,
|
33
33
|
type: :string,
|
34
34
|
default: nil,
|
35
|
+
lazy_default: File.join(Dir.pwd, "cookbooks"),
|
35
36
|
desc: "Create a directory of shims pointing to Cookbook Versions.",
|
36
37
|
banner: "PATH"
|
37
38
|
method_option :without,
|
@@ -47,10 +48,6 @@ module Berkshelf
|
|
47
48
|
banner: "PATH"
|
48
49
|
desc "install", "Install the Cookbooks specified by a Berksfile or a Berskfile.lock."
|
49
50
|
def install
|
50
|
-
if options[:shims] == "shims" # This means 'no value given'.
|
51
|
-
options[:shims] = default_shims_path
|
52
|
-
end
|
53
|
-
|
54
51
|
berksfile = ::Berkshelf::Berksfile.from_file(options[:berksfile])
|
55
52
|
berksfile.install(options)
|
56
53
|
rescue BerkshelfError => e
|
@@ -144,9 +141,5 @@ module Berkshelf
|
|
144
141
|
rescue Errno::ENOENT
|
145
142
|
raise KnifeConfigNotFound, "Unable to find a Knife config at #{options[:config]}. Specify a different path with --config."
|
146
143
|
end
|
147
|
-
|
148
|
-
def default_shims_path
|
149
|
-
File.join(Dir.pwd, "cookbooks")
|
150
|
-
end
|
151
144
|
end
|
152
145
|
end
|
data/lib/berkshelf/version.rb
CHANGED
@@ -15,12 +15,12 @@ module Berkshelf
|
|
15
15
|
specify do
|
16
16
|
target_root.should have_structure {
|
17
17
|
file "Berksfile"
|
18
|
-
no_file "
|
18
|
+
no_file "chefignore"
|
19
19
|
}
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
context "with a
|
23
|
+
context "with a chefignore" do
|
24
24
|
before do
|
25
25
|
generator = subject.new([target_root], chefignore: true)
|
26
26
|
capture(:stdout) { generator.invoke_all }
|
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.3.
|
4
|
+
version: 0.3.3
|
5
5
|
prerelease:
|
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-06-
|
15
|
+
date: 2012-06-27 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: dep_selector
|
@@ -334,6 +334,22 @@ dependencies:
|
|
334
334
|
- - ! '>='
|
335
335
|
- !ruby/object:Gem::Version
|
336
336
|
version: '0'
|
337
|
+
- !ruby/object:Gem::Dependency
|
338
|
+
name: coolline
|
339
|
+
requirement: !ruby/object:Gem::Requirement
|
340
|
+
none: false
|
341
|
+
requirements:
|
342
|
+
- - ! '>='
|
343
|
+
- !ruby/object:Gem::Version
|
344
|
+
version: '0'
|
345
|
+
type: :development
|
346
|
+
prerelease: false
|
347
|
+
version_requirements: !ruby/object:Gem::Requirement
|
348
|
+
none: false
|
349
|
+
requirements:
|
350
|
+
- - ! '>='
|
351
|
+
- !ruby/object:Gem::Version
|
352
|
+
version: '0'
|
337
353
|
description: Manages a Cookbook's, or an Application's, Cookbook dependencies
|
338
354
|
email:
|
339
355
|
- josiah@skirmisher.net
|
@@ -458,7 +474,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
458
474
|
version: '0'
|
459
475
|
segments:
|
460
476
|
- 0
|
461
|
-
hash: -
|
477
|
+
hash: -3981898465681112327
|
462
478
|
requirements: []
|
463
479
|
rubyforge_project:
|
464
480
|
rubygems_version: 1.8.23
|