batali 0.1.12 → 0.1.14

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: cc7940adb3a1a14d55eb855b5f4e1e23d05777bb
4
- data.tar.gz: 50bface2e8d95e696b7d5d403885b9b1b08dc085
3
+ metadata.gz: 27264f54883b15e90cf86e0c44a18c861ee33e05
4
+ data.tar.gz: 3db117858379470704b67ad9e0acef863a471d3a
5
5
  SHA512:
6
- metadata.gz: 763cedeab275662414f90a01938fc7d42879cf57b0507a917fcf0723c5ad2a9b291bba6938a88b877f1b8823d38fe8417d7e92ddf3b1c6aaaba6cde14039e8a1
7
- data.tar.gz: 795b924481089ad62bb8bb6b5dc83dd2a7f7bab66b108a2ebfc9787fcdae83a1c04bf6a8b7f100e618e8f0cb8819eb175f1a29b36b38990dcb969652c62626ac
6
+ metadata.gz: 4fad68431b1362dafb49f2c2821ce8907a06c1af70c8591512e1ad4094148f681d85a335cf281e903887eb1ca76fbccb1e74c2590a99de79c942c9e8b60a92d7
7
+ data.tar.gz: 136eaed0d5bf501e5fe0f66b03f697beb532230f33600031794d29e06a92c2b3cc76e021adb7c66fd48b01095c7040f80fbdb953c1cf6cf583aff1773f5bbb23
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # v0.1.14
2
+ * Start adding debug and verbose output (#9)
3
+ * Update exception messages to provide more clarity
4
+
1
5
  # v0.1.12
2
6
  * Bug fix for multiple constraint arguments
3
7
  * Provide consistent type for values that can be multiples within Batali file
data/batali.gemspec CHANGED
@@ -11,10 +11,11 @@ Gem::Specification.new do |s|
11
11
  s.require_path = 'lib'
12
12
  s.license = 'Apache 2.0'
13
13
  s.add_runtime_dependency 'attribute_struct', '>= 0.2.14'
14
- s.add_runtime_dependency 'grimoire', '>= 0.1.4'
14
+ s.add_runtime_dependency 'grimoire', '> 0.1.4'
15
15
  s.add_runtime_dependency 'bogo', '>= 0.1.12'
16
- s.add_runtime_dependency 'bogo-cli', '>= 0.1.8'
16
+ s.add_runtime_dependency 'bogo-cli', '> 0.1.8'
17
17
  s.add_runtime_dependency 'bogo-config', '>= 0.1.10'
18
+ s.add_runtime_dependency 'bogo-ui', '> 0.1.6'
18
19
  s.add_runtime_dependency 'git'
19
20
  s.add_runtime_dependency 'http'
20
21
  s.add_development_dependency 'minitest'
data/lib/batali/b_file.rb CHANGED
@@ -91,7 +91,7 @@ module Batali
91
91
  Origin::RemoteSite.new(args)
92
92
  }
93
93
  attribute :group, Group, :multiple => true, :coerce => lambda{|v| Group.new()}
94
- attribute :cookbook, Cookbook, :multiple => true, :coerce => BFile.cookbook_coerce
94
+ attribute :cookbook, Cookbook, :multiple => true, :coerce => BFile.cookbook_coerce, :default => []
95
95
 
96
96
  end
97
97
 
@@ -12,24 +12,32 @@ module Batali
12
12
  autoload :Resolve, 'batali/command/resolve'
13
13
  autoload :Update, 'batali/command/update'
14
14
 
15
+ # Set UI when loading via command
16
+ def initialize(*_)
17
+ super
18
+ Batali.ui = ui
19
+ end
20
+
15
21
  # @return [BFile]
16
22
  def batali_file
17
23
  memoize(:batali_file) do
18
24
  # TODO: Add directory traverse searching
19
- BFile.new(opts.fetch(:file, File.join(Dir.pwd, 'Batali')))
25
+ path = opts.fetch(:file, File.join(Dir.pwd, 'Batali'))
26
+ ui.verbose "Loading Batali file from: #{path}"
27
+ BFile.new(path)
20
28
  end
21
29
  end
22
30
 
23
31
  # @return [Manifest]
24
32
  def manifest
25
33
  memoize(:manifest) do
26
- Manifest.build(
27
- File.join(
28
- File.dirname(
29
- opts.fetch(:file, File.join(Dir.pwd, 'batali.manifest'))
30
- ), 'batali.manifest'
31
- )
34
+ path = File.join(
35
+ File.dirname(
36
+ opts.fetch(:file, File.join(Dir.pwd, 'batali.manifest'))
37
+ ), 'batali.manifest'
32
38
  )
39
+ ui.verbose "Loading manifest file from: #{path}"
40
+ Manifest.build(path)
33
41
  end
34
42
  end
35
43
 
@@ -37,6 +45,7 @@ module Batali
37
45
  def cache_directory(*args)
38
46
  memoize(['cache_directory', *args].join('_')) do
39
47
  directory = opts.fetch(:cache_directory, '/tmp/batali-cache')
48
+ ui.debug "Cache directory to persist cookbooks: #{directory}"
40
49
  unless(args.empty?)
41
50
  directory = File.join(directory, *args.map(&:to_s))
42
51
  end
@@ -76,7 +76,7 @@ module Batali
76
76
  end
77
77
  struct._dump.to_smash
78
78
  else
79
- raise Errno::ENOENT.new('No metadata file available to load!')
79
+ raise Errno::ENOENT.new("Failed to locate metadata file in cookbook directory! (path: #{path})")
80
80
  end
81
81
  end
82
82
  end
@@ -1,4 +1,4 @@
1
1
  module Batali
2
2
  # Current version
3
- VERSION = Gem::Version.new('0.1.12')
3
+ VERSION = Gem::Version.new('0.1.14')
4
4
  end
data/lib/batali.rb CHANGED
@@ -18,6 +18,37 @@ module Batali
18
18
  autoload :UnitLoader, 'batali/unit_loader'
19
19
  autoload :Utility, 'batali/utility'
20
20
 
21
+ class << self
22
+ # @return [Bogo::Ui]
23
+ attr_reader :ui
24
+
25
+ # Set Ui instance
26
+ #
27
+ # @param ui [Bogo::Ui]
28
+ # @return [Bogo::Ui]
29
+ def ui=(ui)
30
+ unless(ui.respond_to?(:verbose) && ui.respond_to?(:debug))
31
+ raise TypeError.new "Expecting type `Bogo::Ui` but received `#{ui.class}`"
32
+ end
33
+ @ui = Grimoire.ui = ui
34
+ end
35
+
36
+ # Write verbose message
37
+ def verbose(*args)
38
+ if(ui)
39
+ ui.verbose(*args)
40
+ end
41
+ end
42
+
43
+ # Write debug message
44
+ def debug(*args)
45
+ if(ui)
46
+ ui.debug(*args)
47
+ end
48
+ end
49
+
50
+ end
51
+
21
52
  end
22
53
 
23
54
  require 'batali/b_file'
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.12
4
+ version: 0.1.14
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-17 00:00:00.000000000 Z
11
+ date: 2015-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: attribute_struct
@@ -28,14 +28,14 @@ dependencies:
28
28
  name: grimoire
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - ">"
32
32
  - !ruby/object:Gem::Version
33
33
  version: 0.1.4
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - ">"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.1.4
41
41
  - !ruby/object:Gem::Dependency
@@ -56,14 +56,14 @@ dependencies:
56
56
  name: bogo-cli
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - ">"
60
60
  - !ruby/object:Gem::Version
61
61
  version: 0.1.8
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - ">"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 0.1.8
69
69
  - !ruby/object:Gem::Dependency
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: 0.1.10
83
+ - !ruby/object:Gem::Dependency
84
+ name: bogo-ui
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">"
88
+ - !ruby/object:Gem::Version
89
+ version: 0.1.6
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">"
95
+ - !ruby/object:Gem::Version
96
+ version: 0.1.6
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: git
85
99
  requirement: !ruby/object:Gem::Requirement