batali 0.1.4 → 0.1.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c692d1edb330642392a6ef61b210a5f5037e793c
4
- data.tar.gz: b1aa54310c247f36d94a0e432e7e32ff7c351eb0
3
+ metadata.gz: d366f8505f42d3de37db98957d97c9375aed1e92
4
+ data.tar.gz: 4fc9d0f05e4cbe6b96f0e39814c75d34820ec5ee
5
5
  SHA512:
6
- metadata.gz: b0b3ac70767d86424b2ef49b603352d06dc8bfba7b1ef24d876fb3b207424d90a8b9bd06b2ebfd84608255fd9db28c7798a288d97200a69d44ea0fba53ffdaaf
7
- data.tar.gz: 2f96dcad44fb26db63b243c48d4e1ce395390ff773d5c5b9fd69520bae5533bae1740d71b7050491caa99e5faef22ba0b71bc87e44f6376169a5455d50a5596d
6
+ metadata.gz: ec2b50fe38838317715d79ed0de57b467c853397f54ceb0da9c49b9d7f51d2c3b6e4cbd04e89a926d82425c8dc0000ed41ac8e7fbc42a0d20290c6fbd71527f6
7
+ data.tar.gz: dda1337c5320c000f5689f25c27b2b4389b50f1c1b0e908c0206f668e8368674b6a8b204f2b336d1dd11579b471ee7179113de849ac16ef1a041f127909cf0a7
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # v0.1.6
2
+ * Bug fix for proper Batali file loading when single cookbook defined
3
+ * Bug fix for cookbook install when using path source (git as well)
4
+ * Add color coding to solution output on single path resolutions
5
+
1
6
  # v0.1.4
2
7
  * Bug fix for dependency parsing when using path type source
3
8
 
data/lib/batali/b_file.rb CHANGED
@@ -47,6 +47,13 @@ module Batali
47
47
  end
48
48
  when String
49
49
  Cookbook.new(:name => v)
50
+ when Hash
51
+ c_name = v.first
52
+ Cookbook.new(
53
+ v.last.merge(
54
+ :name => c_name
55
+ )
56
+ )
50
57
  else
51
58
  raise ArgumentError.new "Unable to coerce given type `#{v.class}` to `Batali::BFile::Cookbook`!"
52
59
  end
@@ -39,6 +39,11 @@ module Batali
39
39
  end
40
40
  end
41
41
  else
42
+ original_units = Smash[
43
+ [manifest.cookbook].flatten.compact.map do |unit|
44
+ [unit.name, unit.version]
45
+ end
46
+ ]
42
47
  ui.info 'Performing single path resolution.'
43
48
  results = []
44
49
  run_action 'Resolving dependency constraints' do
@@ -60,7 +65,20 @@ module Batali
60
65
  end
61
66
  ui.info "Number of solutions collected for defined requirements: #{results.size + 1}"
62
67
  ui.info 'Ideal solution:'
63
- ui.puts ideal_solution.units.sort_by(&:name).map{|u| "#{u.name}<#{u.version}>"}
68
+ ideal_solution.units.sort_by(&:name).map do |unit|
69
+ output_args = ["#{unit.name} <#{unit.version}>"]
70
+ unless(original_units.empty?)
71
+ if(original_units[unit.name])
72
+ unless(original_units[unit.name] == unit.version)
73
+ output_args.first.replace "#{unit.name} <#{original_units[unit.name]} -> #{unit.version}>"
74
+ output_args.push(:yellow)
75
+ end
76
+ else
77
+ output_args.push(:green)
78
+ end
79
+ end
80
+ ui.puts ui.color(*output_args)
81
+ end
64
82
  end
65
83
  end
66
84
  end
data/lib/batali/git.rb CHANGED
@@ -31,6 +31,7 @@ module Batali
31
31
  def ref_dup
32
32
  git = ::Git.open(base_path)
33
33
  git.checkout(ref)
34
+ git.pull('origin', ref)
34
35
  self.ref = git.log.first.sha
35
36
  self.path = File.join(cache, ref)
36
37
  unless(File.directory?(path))
@@ -16,7 +16,7 @@ module Batali
16
16
  def asset
17
17
  memoize(:asset) do
18
18
  dir = Dir.mktmpdir
19
- FileUtils.cp_r(path, dir)
19
+ FileUtils.cp_r(File.join(path, '.'), dir)
20
20
  dir
21
21
  end
22
22
  end
@@ -1,4 +1,4 @@
1
1
  module Batali
2
2
  # Current version
3
- VERSION = Gem::Version.new('0.1.4')
3
+ VERSION = Gem::Version.new('0.1.6')
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.1.4
4
+ version: 0.1.6
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-03-11 00:00:00.000000000 Z
11
+ date: 2015-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: attribute_struct