From 33e628a47a8f08e41b52d38158ac8871fc39216e Mon Sep 17 00:00:00 2001 From: Jon Cowie Date: Tue, 18 Aug 2015 13:27:27 +0100 Subject: [PATCH] Fixing bug for #186 where single quoted cookbook names would cause errors --- CHANGELOG.md | 6 ++++++ knife-spork.gemspec | 2 +- lib/chef/knife/spork-bump.rb | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d44868..fa71dc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.6.1(18th August, 2015) + +Bugfixes: + + - Fix bug in automatic bump command when cookbook name is single quoted in metadata.rb + ## 1.6.0(18th August, 2015) Features: diff --git a/knife-spork.gemspec b/knife-spork.gemspec index 1c30690..386d6bd 100644 --- a/knife-spork.gemspec +++ b/knife-spork.gemspec @@ -2,7 +2,7 @@ $:.push File.expand_path('../lib', __FILE__) Gem::Specification.new do |gem| gem.name = 'knife-spork' - gem.version = '1.6.0' + gem.version = '1.6.1' gem.authors = ["Jon Cowie"] gem.email = 'jonlives@gmail.com' gem.homepage = 'https://github.com/jonlives/knife-spork' diff --git a/lib/chef/knife/spork-bump.rb b/lib/chef/knife/spork-bump.rb index e155ffb..ef5888f 100644 --- a/lib/chef/knife/spork-bump.rb +++ b/lib/chef/knife/spork-bump.rb @@ -38,7 +38,7 @@ def run cookbook_name = "" if @name_args.empty? && File.exists?("#{Dir.pwd}/metadata.rb") - cookbook_name = File.read("#{Dir.pwd}/metadata.rb").split("\n").select{|l|l.start_with?("name")}.first.split.last.gsub("\"","") + cookbook_name = File.read("#{Dir.pwd}/metadata.rb").split("\n").select{|l|l.start_with?("name")}.first.split.last.gsub("\"","").gsub("'","") ui.info "Cookbook name omitted, but metadata.rb for cookbook #{cookbook_name} found - bumping that." elsif @name_args.empty? show_usage