berkshelf_ext 1.0.8 → 1.0.10

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## v1.0.10
2
+ * Forcibly set name when uploading via knife
3
+ * Only load sources of specified cookbooks when uploading with `--skip-dependencies`
4
+
1
5
  ## v1.0.8
2
6
  * Add environment variable to allow loading all available extensions
3
7
  * Add new addon extension fast_resolution to locate and use cached cookbooks faster
@@ -40,8 +40,8 @@ class RidleyMocker
40
40
  loader.load_cookbooks
41
41
  cv = loader.cookbook_version
42
42
  cv.send(:generate_manifest)
43
- cv.manifest['name'] = "#{cv.name}-#{cv.version}" #.sub!(%r{-[^-]+$}, '')
44
- cv.manifest['cookbook_name'] = cv.name
43
+ cv.manifest['name'] = "#{cv.metadata.name}-#{cv.version}"
44
+ cv.name = cv.manifest['cookbook_name'] = cv.metadata.name
45
45
  cv.freeze_version if upload_options.delete(:freeze)
46
46
  Chef::CookbookUploader.new([cv], cookbook.path, upload_options).upload_cookbooks
47
47
  @ckbk = cv
@@ -14,12 +14,18 @@ module BerkshelfExt
14
14
  def dependency_chains_sources(options = {})
15
15
  l_sources = @sources.collect { |name, source| source }.flatten
16
16
 
17
+ cookbooks = options[:skip_dependencies] ? Array(options.fetch(:cookbooks, nil)) : []
17
18
  except = Array(options.fetch(:except, nil)).collect(&:to_sym)
18
19
  only = Array(options.fetch(:only, nil)).collect(&:to_sym)
19
20
 
20
21
  case
21
22
  when !except.empty? && !only.empty?
22
23
  raise Berkshelf::ArgumentError, "Cannot specify both :except and :only"
24
+ when !cookbooks.empty?
25
+ if !except.empty? && !only.empty?
26
+ Berkshelf.ui.warn "Cookbooks were specified, ignoring :except and :only"
27
+ end
28
+ l_sources.select { |source| options[:cookbooks].include?(source.name) }
23
29
  when !except.empty?
24
30
  l_sources.select { |source| (except & source.groups).empty? }
25
31
  when !only.empty?
@@ -2,6 +2,6 @@ module BerkshelfExt
2
2
  class Version < Gem::Version
3
3
  end
4
4
 
5
- VERSION = Version.new('1.0.8')
5
+ VERSION = Version.new('1.0.10')
6
6
  BERKSHELF_CONSTRAINT = '~> 1.3.1'
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: berkshelf_ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.10
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-04-11 00:00:00.000000000 Z
12
+ date: 2013-04-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: berkshelf