batali 0.4.8 → 0.4.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/batali/b_file.rb +2 -2
- data/lib/batali/command/install.rb +5 -0
- data/lib/batali/command/resolve.rb +4 -0
- data/lib/batali/source/path.rb +1 -1
- data/lib/batali/source/site.rb +19 -3
- data/lib/batali/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4553dc89e46b84385924f5bb91aa2be8ef25f1a
|
4
|
+
data.tar.gz: 2002e75fc05c7b841f3152131ca66076969a1f26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c03e18e0c2ac2854ae223245b63134c5dc742ac2b3d1e439d248bb1e1ac5dad704b422ff4d0d1c168a66532da8981ba99606f28ec38396fcefbfe86c9986d15
|
7
|
+
data.tar.gz: 1ad3695558546faefb03819e2192ce5541dfc22e232c98b628fd99f58b2098a5f26286f05437d961e48da4ff780bdd314f3570d0dc75e31a60b044074dcc4c1b
|
data/CHANGELOG.md
CHANGED
data/lib/batali/b_file.rb
CHANGED
@@ -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(
|
data/lib/batali/source/path.rb
CHANGED
@@ -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|
|
data/lib/batali/source/site.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
108
|
+
discovered_path
|
97
109
|
end
|
98
110
|
|
99
111
|
# @return [TrueClass, FalseClass]
|
100
112
|
def clean_asset(asset_path)
|
101
|
-
|
113
|
+
if(asset_path)
|
114
|
+
super File.dirname(asset_path)
|
115
|
+
else
|
116
|
+
false
|
117
|
+
end
|
102
118
|
end
|
103
119
|
|
104
120
|
end
|
data/lib/batali/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2016-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: attribute_struct
|