lib/chef/knife/github_compare.rb in knife-github-0.0.6 vs lib/chef/knife/github_compare.rb in knife-github-0.0.7

- old
+ new

@@ -18,11 +18,10 @@ require 'chef/knife' class Chef class Knife - class GithubCompare < Knife deps do require 'chef/knife/github_base' include Chef::Knife::GithubBase @@ -66,12 +65,12 @@ cookbooks[k].nil? || cookbooks[k]['versions'].nil? ? version = "" : version = cookbooks[k]['versions'][0]['version'] all_repos[k] = { 'name' => k, 'latest_cb_tag' => version, 'git_url' => v[git_link], 'latest_gh_tag' => v['latest_tag'] } } else cookbooks.each { |k,v| - get_all_repos[k].nil? || get_all_repos[k][git_link].nil? ? gh_url = ui.color("ERROR: Cannot find cookbook!", :red) : gh_url = get_all_repos[k][git_link] - get_all_repos[k].nil? || get_all_repos[k]['latest_tag'].nil? ? gh_tag = ui.color("ERROR: No tags!", :red) : gh_tag = get_all_repos[k]['latest_tag'] + get_all_repos[k].nil? || get_all_repos[k][git_link].nil? ? gh_url = ui.color("Cannot find cookbook!", :red) : gh_url = get_all_repos[k][git_link] + get_all_repos[k].nil? || get_all_repos[k]['latest_tag'].nil? || get_all_repos[k]['latest_tag'].empty? ? gh_tag = ui.color("No tags!", :red) : gh_tag = get_all_repos[k]['latest_tag'] all_repos[k] = { 'name' => k, 'latest_cb_tag' => v['versions'][0]['version'], 'git_url' => gh_url, 'latest_gh_tag' => gh_tag } } end end @@ -81,10 +80,10 @@ repos = all_repos.select { |k,v| v["name"] == @cookbook_name } else repos = all_repos end - columns = [ 'name,Name', 'latest_cb_tag,Tag', 'git_url,Link', 'latest_gh_tag,Tag' ] + columns = [ 'name,Chef Store', 'latest_cb_tag,Tag', 'git_url,Github Store', 'latest_gh_tag,Tag' ] match = [ 'latest_cb_tag', 'latest_gh_tag' ] if repos.nil? || repos.empty? Chef::Log.error("No repositories found.") else