batali 0.2.24 → 0.2.26

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: 9e2938e0db16df2660cdcc95f749013b7e59ee98
4
- data.tar.gz: 4d03af6c43cbd88a501b7efd3fc04c031776b256
3
+ metadata.gz: dac0de77697b201893a7f171b36a7e27031936f2
4
+ data.tar.gz: d7ee1c50669c8a4c8ffcd818813c2fa07a998811
5
5
  SHA512:
6
- metadata.gz: 1216d6feda21f8fa8f7db477a65e18970a55b83b77f532cd766e8b42b0f840041315db08c404d2e396591ef7796225dd968a7469f203fbc42fbc44163b7458f0
7
- data.tar.gz: 91b90b17ec80979b8f84460d71be89b0ce2fcf6dbde3d78de3f7f7f47716b23c99f85249674192a9a1faca26e2e2fcd716316fa185dcd3bb1f2f552203271080
6
+ metadata.gz: c066c8150764c5cbf92d6e28448f3c0d243c2417dd3371265154822049c8c51ae23c2790c7642722103cf12eceef48d638436c36dac9d18f6dfe796cb756f315
7
+ data.tar.gz: 42b2598fd903b77feed6e5d1c2c0444ddc364ab3f1301e5a03bf408f9f6729b19b6db90e4ca13e459198be6be66be43ea910aa2c4e498fc581f618a5e3027a79
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # v0.2.26
2
+ * [feature] Add subdirectory support for git repository sources
3
+
1
4
  # v0.2.24
2
5
  * [enhancement] Add cache command for inspection and removal
3
6
  * [fix] Automatically destroy and retry failed asset unpack
data/README.md CHANGED
@@ -114,6 +114,13 @@ Git sources are defined via cookbook entries:
114
114
  cookbook 'example', git: 'git://git.example.com/example-repo.git', ref: 'master'
115
115
  ```
116
116
 
117
+ In some crazy instances, you may have a cookbook located in the subdirectory of
118
+ a git repository:
119
+
120
+ ```ruby
121
+ cookbook 'example', git: 'git://git.example.com/example-repo.git', ref: 'master', path: 'my-cookbook'
122
+ ```
123
+
117
124
  ### Least Impact Updates
118
125
 
119
126
  After a `batali.manifest` file has been generated, subsequent `resolve` requests
@@ -7,11 +7,10 @@ module Batali
7
7
  class Git < Path
8
8
 
9
9
  include Batali::Git
10
+ attribute :path, String, :required => false
11
+ attribute :subdirectory, String
10
12
 
11
13
  def initialize(args={})
12
- unless(args[:path])
13
- args[:path] = '/dev/null'
14
- end
15
14
  super
16
15
  self.identifier = Smash.new(
17
16
  :url => url,
@@ -29,7 +28,7 @@ module Batali
29
28
  items.first.source = Source::Git.new(
30
29
  :url => url,
31
30
  :ref => ref,
32
- :path => path
31
+ :subdirectory => subdirectory
33
32
  )
34
33
  items
35
34
  end
@@ -38,7 +37,11 @@ module Batali
38
37
  # @return [Smash] metadata information
39
38
  def load_metadata
40
39
  fetch_repo
41
- super
40
+ original_path = path.dup
41
+ self.path = File.join(*[path, subdirectory].compact)
42
+ result = super
43
+ self.path = original_path
44
+ result
42
45
  end
43
46
 
44
47
  # @return [String] path to repository
@@ -11,12 +11,13 @@ module Batali
11
11
  include Bogo::Memoization
12
12
  include Batali::Git
13
13
 
14
+ attribute :subdirectory, String
14
15
  attribute :path, String
15
16
 
16
17
  # @return [String] directory containing contents
17
18
  def asset
18
19
  clone_repository
19
- self.path = ref_dup
20
+ self.path = File.join(*[ref_dup, subdirectory].compact)
20
21
  super
21
22
  end
22
23
 
@@ -27,18 +27,19 @@ module Batali
27
27
  end
28
28
  end
29
29
  file.cookbook.each do |ckbk|
30
- if(ckbk.path)
31
- source = Origin::Path.new(
32
- :name => ckbk.name,
33
- :path => ckbk.path
34
- )
35
- elsif(ckbk.git)
30
+ if(ckbk.git)
36
31
  source = Origin::Git.new(
37
32
  :name => ckbk.name,
38
33
  :url => ckbk.git,
34
+ :subdirectory => ckbk.path,
39
35
  :ref => ckbk.ref || 'master',
40
36
  :cache => cache
41
37
  )
38
+ elsif(ckbk.path)
39
+ source = Origin::Path.new(
40
+ :name => ckbk.name,
41
+ :path => ckbk.path
42
+ )
42
43
  end
43
44
  if(source)
44
45
  system.add_unit(source.units.first)
@@ -1,4 +1,4 @@
1
1
  module Batali
2
2
  # Current version
3
- VERSION = Gem::Version.new('0.2.24')
3
+ VERSION = Gem::Version.new('0.2.26')
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: batali
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.24
4
+ version: 0.2.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Roberts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-22 00:00:00.000000000 Z
11
+ date: 2015-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: attribute_struct
@@ -242,9 +242,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
242
242
  version: '0'
243
243
  requirements: []
244
244
  rubyforge_project:
245
- rubygems_version: 2.2.2
245
+ rubygems_version: 2.4.8
246
246
  signing_key:
247
247
  specification_version: 4
248
248
  summary: Magic
249
249
  test_files: []
250
- has_rdoc: