batali 0.4.8 → 0.4.10

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: 97f59524874d12a82fbf6a83243667f8fe75862e
4
- data.tar.gz: 07a695381bf89644a5e54878b2d69063163263fb
3
+ metadata.gz: f4553dc89e46b84385924f5bb91aa2be8ef25f1a
4
+ data.tar.gz: 2002e75fc05c7b841f3152131ca66076969a1f26
5
5
  SHA512:
6
- metadata.gz: 8f4604d2387be774d94fe30a7259162dc059e1a962b7720986436e29a81bd5f110842c8394b88eac3e83217e7667b6a610012cc9fdaba49603ee24fc4edb9d22
7
- data.tar.gz: b3cf034a89fbcf276b9a8610067e20bce542f4a21dbe96286008b0b63d887000dfd696d3a3680ea6e462962fd43dff1741a2122d0fca4f7c57599ec57779b865
6
+ metadata.gz: 6c03e18e0c2ac2854ae223245b63134c5dc742ac2b3d1e439d248bb1e1ac5dad704b422ff4d0d1c168a66532da8981ba99606f28ec38396fcefbfe86c9986d15
7
+ data.tar.gz: 1ad3695558546faefb03819e2192ce5541dfc22e232c98b628fd99f58b2098a5f26286f05437d961e48da4ff780bdd314f3570d0dc75e31a60b044074dcc4c1b
@@ -1,3 +1,6 @@
1
+ # v0.4.10
2
+ * [fix] Cookbook installation errors on windows (#82)
3
+
1
4
  # v0.4.8
2
5
  * [task] Pin rubocop to make less annoying
3
6
  * [fix] Explicitly load tempfile
@@ -57,7 +57,7 @@ module Batali
57
57
  end
58
58
 
59
59
  ::Object.constants.each do |const_name|
60
- next if const_name == :Config
60
+ next if const_name == :Config || const_name == :TimeoutError
61
61
  const_set(const_name, ::Object.const_get(const_name))
62
62
  end
63
63
 
@@ -66,7 +66,7 @@ module Batali
66
66
  instance_exec do
67
67
  class << self
68
68
  ::Object.constants.each do |const_name|
69
- next if const_name == :Config
69
+ next if const_name == :Config || const_name == :TimeoutError
70
70
  const_set(const_name, ::Object.const_get(const_name))
71
71
  end
72
72
  end
@@ -23,6 +23,7 @@ module Batali
23
23
  manifest.cookbook.each_slice(100) do |units_slice|
24
24
  units_slice.map do |unit|
25
25
  Thread.new do
26
+ ui.debug "Starting unit install for: #{unit.name}<#{unit.version}>"
26
27
  if(unit.source.respond_to?(:cache_path))
27
28
  unit.source.cache_path = cache_directory(
28
29
  Bogo::Utility.snake(unit.source.class.name.split('::').last)
@@ -38,6 +39,10 @@ module Batali
38
39
  File.join(asset_path, '.'),
39
40
  final_path
40
41
  )
42
+ ui.debug "Completed unit install for: #{unit.name}<#{unit.version}>"
43
+ rescue => e
44
+ ui.debug "Failed unit install for: #{unit.name}<#{unit.version}> - #{e.class}: #{e}"
45
+ raise
41
46
  ensure
42
47
  unit.source.clean_asset(asset_path)
43
48
  end
@@ -74,6 +74,10 @@ module Batali
74
74
  ui.error 'No solutions found defined requirements!'
75
75
  else
76
76
  ideal_solution = results.pop
77
+ ui.debug 'Full solution raw contents:'
78
+ ideal_solution.units.each do |unit|
79
+ ui.debug [unit.name, unit.version].join(' -> ')
80
+ end
77
81
  dry_run('manifest file write') do
78
82
  run_action 'Writing manifest' do
79
83
  manifest = Manifest.new(
@@ -31,7 +31,7 @@ module Batali
31
31
  files_to_copy = Dir.glob(File.join(path, '{.[^.]*,**}', '**', '{*,*.*,.*}'))
32
32
  files_to_copy = files_to_copy.map do |file_path|
33
33
  next unless File.file?(file_path)
34
- relative_path = file_path.sub("#{path}/", '')
34
+ relative_path = file_path.sub("#{path}#{File::SEPARATOR}", '')
35
35
  relative_path unless chefignore.detect{|ig| File.fnmatch(ig, relative_path)}
36
36
  end.compact
37
37
  files_to_copy.each do |relative_path|
@@ -51,7 +51,13 @@ module Batali
51
51
  # @return [String] directory
52
52
  def asset
53
53
  path = File.join(cache_directory, Base64.urlsafe_encode64(url))
54
- unless(File.directory?(path))
54
+ if(File.directory?(path))
55
+ discovered_path = Dir.glob(File.join(path, '*')).reject do |i|
56
+ i.end_with?("#{File::SEPARATOR}asset")
57
+ end.first
58
+ FileUtils.rm_rf(path)
59
+ end
60
+ unless(discovered_path)
55
61
  retried = false
56
62
  begin
57
63
  FileUtils.mkdir_p(path)
@@ -92,13 +98,23 @@ module Batali
92
98
  end
93
99
  raise
94
100
  end
101
+ discovered_path = Dir.glob(File.join(path, '*')).reject do |i|
102
+ i.end_with?("#{File::SEPARATOR}asset")
103
+ end.first
104
+ end
105
+ unless(discovered_path)
106
+ raise Errno::ENOENT.new "Failed to locate asset within `#{path}`"
95
107
  end
96
- Dir.glob(File.join(path, '*')).reject{|i| i.end_with?('/asset') }.first
108
+ discovered_path
97
109
  end
98
110
 
99
111
  # @return [TrueClass, FalseClass]
100
112
  def clean_asset(asset_path)
101
- super File.dirname(asset_path)
113
+ if(asset_path)
114
+ super File.dirname(asset_path)
115
+ else
116
+ false
117
+ end
102
118
  end
103
119
 
104
120
  end
@@ -1,5 +1,5 @@
1
1
  # Batali namespace
2
2
  module Batali
3
3
  # Current version
4
- VERSION = Gem::Version.new('0.4.8')
4
+ VERSION = Gem::Version.new('0.4.10')
5
5
  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.4.8
4
+ version: 0.4.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Roberts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-11 00:00:00.000000000 Z
11
+ date: 2016-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: attribute_struct