kitchen-cabinet 2.0.0 → 2.0.1

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: 99aea26399fc3f69deb9108743f3dee9e385ca89
4
- data.tar.gz: f10a08c659ec3b682e33b4ffffb10d0e10fe4df7
3
+ metadata.gz: 54cfbe8021410b0a68c2cc4dded7ee588eba95e6
4
+ data.tar.gz: c2ca2b6d157a4c53f7d8a4278acc5751b1eccb79
5
5
  SHA512:
6
- metadata.gz: d143919033ca700ee42de22ad8123eea75743f94713684d3966b7e4251563345b02bbbcbd924177ccbd4471877bb4b852b592fe8a73de4f65a8b5a2c6b30164e
7
- data.tar.gz: e55c4b8115dd3640a18686cbb41e115cfe4bc43f12a7e639dca22c3d1eefca355046a1443f9e33da98291eb10a17ba3455f76b8106af1f62f97de6b7a247b173
6
+ metadata.gz: 6291a1cd420aaca963c27de971bb2598dd6ff75bdeb9f92e70bb02fd8add87f8486c51a2b3d04f03be126e17eb0346a0ce876038278706c60c63f9ce4ef95a58
7
+ data.tar.gz: 99c32005875a10897015ab1a8ad5e2e85cff1d504ed67ff542758a2a0f89f731221ee06f6cec97aa50fb86d8a38251a79892894df62042be4e32e41f45550996
data/CHANGELOG.md CHANGED
@@ -1,7 +1,15 @@
1
+ ## v2.0.1
2
+ * Fixed `cabinet update` command.
3
+ * Vastly simplified bin logic
4
+ * Rake still runs tests, but soon it will be used just for releases (Guard runs tests already)
5
+
1
6
  ## v2.0.0
2
7
  * Read knife.rb config for cookbook values if no cli overrides are used
3
8
  * Uses Rake to execute tests instead of Strainer (Strainer is being phased out)
4
9
 
10
+ ####Known bugs:
11
+ * `cabinet update` does not work.
12
+
5
13
  ## v1.2.0:
6
14
 
7
15
  * Run commands from current directory if not otherwise specified with -o
data/bin/cabinet CHANGED
@@ -14,7 +14,7 @@ opt_parser = OptionParser.new do |opt|
14
14
  opt.banner = 'Usage: cabinet [options] <cookbook name>'
15
15
  opt.separator ''
16
16
  opt.separator 'Options'
17
- opt.on('-o', '--cookbook-path PATH', 'The directory where the cookbook will be created') do |path|
17
+ opt.on('-o', '--cookbook-path PATH', 'The directory where the cookbook will be created.') do |path|
18
18
  options[:path] = path
19
19
  end
20
20
  opt.on('-C', '--copyright COPYRIGHT_HOLDER', 'The name of the copyright holder.') do |copyright|
@@ -42,58 +42,32 @@ Error.opt_error('Please specify some options.', opt_parser) if ARGV.empty?
42
42
 
43
43
  cookbook_name = ARGV.pop
44
44
 
45
+ options[:update] = true if cookbook_name == 'update'
46
+
45
47
  if options[:path].respond_to?(:to_str)
46
- path = File.join(options[:path], cookbook_name)
47
- cookbook_path = path
48
+ cookbook_path = File.join(options[:path], cookbook_name)
48
49
  else
49
- options[:path] = Dir.getwd
50
- puts options[:path] + ' this is the expected path'
51
- path = Dir.getwd
52
- cookbook_path = File.join(path, cookbook_name)
53
- puts cookbook_path + ' this is the cookbook_path'
50
+ options[:path] = Dir.getwd
54
51
  end
55
52
 
56
53
  if cookbook_name == 'update'
57
- require 'kitchen-cabinet/update'
58
- # path = Dir.getwd
59
- metadata = File.join(cookbook_path, 'metadata.rb')
60
- puts path
61
- puts metadata
62
- if File.exists?(metadata)
63
- cookbook_name = File.basename(File.expand_path(File.dirname(__FILE__)))
64
- Update.update_cookbook(cookbook_name, options, cookbook_path)
65
- exit
66
- else
67
- puts Error.opt_error('Specify a path or run from within the cookbook folder!', opt_parser)
68
- end
54
+ cookbook_name = File.basename(options[:path])
55
+ cookbook_path = options[:path]
56
+ else
57
+ cookbook_path = File.join(options[:path], cookbook_name)
69
58
  end
70
59
 
71
60
  if options[:update]
72
- Error.opt_error('You need to create the cookbook first!', opt_parser) unless File.exists?(cookbook_path)
73
- unless options[:path].respond_to?(:to_str) && (cookbook_name.is_a? String)
74
- Error.opt_error('Make sure you specify -o and a cookbook name!', opt_parser)
75
- end
76
- if cookbook_name
61
+ if File.exists?(File.join(cookbook_path, 'metadata.rb'))
77
62
  require 'kitchen-cabinet/update'
78
63
  Update.update_cookbook(cookbook_name, options, cookbook_path)
79
64
  exit
80
65
  else
81
- Error.opt_error('Define a path with `-o` and a cookbook name!', opt_parser)
66
+ puts Error.opt_error('Specify a path or run from within the cookbook folder!', opt_parser)
67
+ exit
82
68
  end
83
- elsif cookbook_name
84
- Cabinet.init(cookbook_name, options, cookbook_path)
85
- puts "Cookbook #{cookbook_name} created successfully"
86
- puts 'Next steps...'
87
- puts " $ cd #{cookbook_path}"
88
- puts ' $ bundle install'
89
- puts ' $ bundle exec berks install'
90
- puts ' $ bundle exec rake -T'
91
- puts 'rake integration # Run Test Kitchen integration tests'
92
- puts 'rake kitchen:all # Run all test instances'
93
- puts 'rake kitchen:default-ubuntu-1204 # Run default-ubuntu-1204 test instance'
94
- puts 'rake spec # Run ChefSpec unit tests'
95
- puts 'rake style # Run all style checks'
96
- puts 'rake style:chef # Lint Chef cookbooks'
97
- puts 'rake style:ruby # Run Ruby style checks'
98
69
  exit
99
70
  end
71
+
72
+ Cabinet.init(cookbook_name, options, cookbook_path)
73
+ exit
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "kitchen-cabinet"
3
- s.version = '2.0.0'
3
+ s.version = '2.0.1'
4
4
  s.date = Time.now.strftime("%Y-%m-%d")
5
5
  s.homepage = 'https://github.com/onehealth/kitchen-cabinet'
6
6
  s.summary = 'Initializes a chef cookbook repo with relevant tools'
@@ -13,6 +13,19 @@ class Cabinet
13
13
  init_kitchen(cookbook_name, cookbook_path)
14
14
  init_spec(cookbook_name, cookbook_path)
15
15
  write_configs(cookbook_name, options, cookbook_path)
16
+ puts "Cookbook #{cookbook_name} created successfully"
17
+ puts 'Next steps...'
18
+ puts " $ cd #{cookbook_path}"
19
+ puts ' $ bundle install'
20
+ puts ' $ bundle exec berks install'
21
+ puts ' $ bundle exec rake -T'
22
+ puts 'rake integration # Run Test Kitchen integration tests'
23
+ puts 'rake kitchen:all # Run all test instances'
24
+ puts 'rake kitchen:default-ubuntu-1204 # Run default-ubuntu-1204 test instance'
25
+ puts 'rake spec # Run ChefSpec unit tests'
26
+ puts 'rake style # Run all style checks'
27
+ puts 'rake style:chef # Lint Chef cookbooks'
28
+ puts 'rake style:ruby # Run Ruby style checks'
16
29
  end
17
30
 
18
31
  def self.init_chef(cookbook_name, options, cookbook_path)
@@ -15,7 +15,6 @@ end
15
15
 
16
16
  group :release do
17
17
  gem 'stove', '~> 1.1'
18
- # gem 'stove', '~> 2.0.0.beta.2'
19
18
  gem 'rspec_junit_formatter'
20
19
  gem 'rubocop-checkstyle_formatter'
21
20
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-cabinet
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taylor Price
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-17 00:00:00.000000000 Z
11
+ date: 2014-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef