batali 0.2.14 → 0.2.16

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: 6a858775a739465f30069ecf5ce22dee5b8e1a24
4
- data.tar.gz: 59eb2bf5517829257bbdd9d2b9afacca2633fded
3
+ metadata.gz: 95116c2d6a246d0c41771808a3de9097db08e4f5
4
+ data.tar.gz: ba3506822b97ffe1fa18c200f734b395b876e03e
5
5
  SHA512:
6
- metadata.gz: ebd131450fdb5ba57f570f89795663f912c44237b04609576ed44890ffbe54623e8b65fcbb3b355ddb98d2c4c95c8bcf82c7c7244b3ca987b56d6741a40671dc
7
- data.tar.gz: 4e2daaec6765cd360e821978e717e50b45cc98a3badf9b30e66952508da359e16729f927827f777ba9b7f8b7c8bc3c35c887402ffabcf961c612b228f8747742
6
+ metadata.gz: dc4ac9054ff2bbb0e9e07c98a25cb44714c1f303da5714a85b633bc76a75867c39be50e9f7c44fc35ee9c3447afcf4cec346ae25db475500f1c46621a7f0deea
7
+ data.tar.gz: 41d22ff1c595f21414abae181d63a6a49ff870d3e2f4a9250fa3d26679cd7f2fbe3471e9cd6ee08e73f0486a2387013ae9afff2ebc970ca140a89bd18563c484
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # v0.2.16
2
+ * Add `display` command for inspect manifest
3
+ * [fix] Update bogo-cli constraint to provide configuration merge fix
4
+
1
5
  # v0.2.14
2
6
  * Add support for using the Chef Server as a source
3
7
 
data/README.md CHANGED
@@ -95,6 +95,16 @@ Paths are defined via cookbook entries:
95
95
  cookbook 'example', path: '/path/to/example'
96
96
  ```
97
97
 
98
+ A short cut is also available when you're Batali file is
99
+ located at the root of the cookbook you want to add:
100
+
101
+ ```ruby
102
+ metadata
103
+ ```
104
+
105
+ This will extract the name from the `metadata` file and automatically
106
+ set the path `'.'`.
107
+
98
108
  ##### Git
99
109
 
100
110
  Git sources are defined via cookbook entries:
data/batali.gemspec CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
  s.add_runtime_dependency 'attribute_struct', '~> 0.2.14'
14
14
  s.add_runtime_dependency 'grimoire', '~> 0.2.6'
15
15
  s.add_runtime_dependency 'bogo', '~> 0.1.20'
16
- s.add_runtime_dependency 'bogo-cli', '~> 0.1.18'
16
+ s.add_runtime_dependency 'bogo-cli', '~> 0.1.23'
17
17
  s.add_runtime_dependency 'bogo-config', '~> 0.1.10'
18
18
  s.add_runtime_dependency 'bogo-ui', '~> 0.1.6'
19
19
  s.add_runtime_dependency 'http', '~> 0.8.2'
data/bin/batali CHANGED
@@ -16,6 +16,14 @@ Bogo::Cli::Setup.define do
16
16
  on :f, :file, 'Path to Batali file'
17
17
  end
18
18
 
19
+ command 'display' do
20
+ description 'Display manifest information'
21
+ self.instance_exec(&global_opts)
22
+ run do |opts, args|
23
+ Batali::Command::Display.new({:display => opts.to_hash}, args).execute!
24
+ end
25
+ end
26
+
19
27
  command 'install' do
20
28
  description 'Install cookbooks from manifest'
21
29
  self.instance_exec(&global_opts)
@@ -0,0 +1,47 @@
1
+ require 'batali'
2
+
3
+ module Batali
4
+ class Command
5
+
6
+ # Display manifest information
7
+ class Display < Batali::Command
8
+
9
+ # Display information from manifest
10
+ def execute!
11
+ ui.puts ui.color('Batali manifest information:', :bold) + "\n"
12
+ display(arguments)
13
+ end
14
+
15
+ # Display manifest information
16
+ #
17
+ # @param names [Array<String>] limit to given cookbooks
18
+ # @return [NilClass]
19
+ def display(ckbk_names)
20
+ info = Smash.new.tap do |ckbks|
21
+ manifest.cookbook.sort_by(&:name).each do |ckbk|
22
+ ckbks[ckbk.name] ||= []
23
+ ckbks[ckbk.name].push(ckbk)
24
+ end
25
+ end
26
+ info.each do |name, ckbks|
27
+ next unless ckbk_names.empty? || ckbk_names.include?(name)
28
+ ui.puts " #{ui.color(name, :bold)}:"
29
+ ckbks.each do |ckbk|
30
+ ui.puts " Version: #{ckbk.version}"
31
+ case ckbk.source
32
+ when Batali::Source::Site
33
+ ui.puts " Source: #{URI.parse(ckbk.source.url).host}"
34
+ when Batali::Source::Git
35
+ ui.puts " Source: #{ckbk.source.url}"
36
+ ui.puts " Reference: #{ckbk.source.ref}"
37
+ when Batali::Source::Path
38
+ ui.puts " Source: #{ckbk.source.path}"
39
+ end
40
+ end
41
+ end
42
+ end
43
+
44
+ end
45
+
46
+ end
47
+ end
@@ -28,7 +28,7 @@ module Batali
28
28
  end
29
29
  asset_path = unit.source.asset
30
30
  final_path = File.join(install_path, unit.name)
31
- if(config[:infrastructure] || (config[:infrastructure].nil? && manifest.infrastructure))
31
+ if(infrastructure?)
32
32
  final_path << "-#{unit.version}"
33
33
  end
34
34
  begin
@@ -29,7 +29,7 @@ module Batali
29
29
  :system => system,
30
30
  :score_keeper => score_keeper
31
31
  )
32
- if(config[:infrastructure] || (config[:infrastructure].nil? && manifest.infrastructure))
32
+ if(infrastructure?)
33
33
  infrastructure_resolution(solv)
34
34
  else
35
35
  single_path_resolution(solv)
@@ -10,6 +10,7 @@ module Batali
10
10
  include Bogo::Memoization
11
11
 
12
12
  autoload :Configure, 'batali/command/configure'
13
+ autoload :Display, 'batali/command/display'
13
14
  autoload :Install, 'batali/command/install'
14
15
  autoload :Resolve, 'batali/command/resolve'
15
16
  autoload :Update, 'batali/command/update'
@@ -72,5 +73,13 @@ module Batali
72
73
  end
73
74
  end
74
75
 
76
+ # @return [TrueClass, FalseClass] infrastructure mode
77
+ def infrastructure?
78
+ config[:infrastructure] || (
79
+ config[:infrastructure].nil? &&
80
+ manifest.infrastructure
81
+ )
82
+ end
83
+
75
84
  end
76
85
  end
@@ -1,4 +1,4 @@
1
1
  module Batali
2
2
  # Current version
3
- VERSION = Gem::Version.new('0.2.14')
3
+ VERSION = Gem::Version.new('0.2.16')
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.14
4
+ version: 0.2.16
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-06-18 00:00:00.000000000 Z
11
+ date: 2015-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: attribute_struct
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.1.18
61
+ version: 0.1.23
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
- version: 0.1.18
68
+ version: 0.1.23
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bogo-config
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -196,6 +196,7 @@ files:
196
196
  - lib/batali/chefspec.rb
197
197
  - lib/batali/command.rb
198
198
  - lib/batali/command/configure.rb
199
+ - lib/batali/command/display.rb
199
200
  - lib/batali/command/install.rb
200
201
  - lib/batali/command/resolve.rb
201
202
  - lib/batali/command/update.rb
@@ -244,3 +245,4 @@ signing_key:
244
245
  specification_version: 4
245
246
  summary: Magic
246
247
  test_files: []
248
+ has_rdoc: