lib/chef/knife/github_compare.rb in knife-github-0.0.8 vs lib/chef/knife/github_compare.rb in knife-github-0.0.9
- old
+ new
@@ -51,11 +51,11 @@
# Get all chef cookbooks and versions.
cookbooks = rest.get_rest("/cookbooks?num_version=1")
#Get the github link
git_link = get_repo_clone_link
-
+
# Filter all repo information based on the tags that we can find
if config[:fields] || config[:fieldlist]
all_repos = get_all_repos
config[:fields] = "name" if config[:fields].nil? || config[:fields].empty?
else
@@ -66,11 +66,11 @@
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("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']
+ get_all_repos[k].nil? || get_all_repos[k]['tags_last'].nil? || get_all_repos[k]['tags_last'].empty? ? gh_tag = ui.color("No tags!", :red) : gh_tag = get_all_repos[k]['tags_last']
all_repos[k] = { 'name' => k, 'latest_cb_tag' => v['versions'][0]['version'], 'git_url' => gh_url, 'latest_gh_tag' => gh_tag }
}
end
end
@@ -90,9 +90,8 @@
else
display_info(repos, columns, match)
end
end
-
end
end
end