Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a badge for Chef cookbooks #157

Merged
merged 2 commits into from
Apr 11, 2014
Merged

Add a badge for Chef cookbooks #157

merged 2 commits into from
Apr 11, 2014

Conversation

sethvargo
Copy link
Contributor

This PR adds support for Chef cookbook version badges.

@badges/owners I wasn't sure what the difference between try.html and index.html were, so I updated both. Please let me know what you need from me.

@espadrine espadrine merged commit ec786b1 into badges:master Apr 11, 2014
@espadrine
Copy link
Member

Thanks a lot for this contribution!

Version information badges have traditionally been given information about the name of the corresponding package repository it is indexed in. Should I use chef, or cookbook, for that purpose? A non-thourough reading of the website makes me believe that chef is the package index' brand, while cookbook is a term used to designate a particular package, much like pypi vs. egg (now wheel) in the Python world. In which case, it would make sense to use chef both in the badge, and in the URL.

Please tell me whether you agree with that change. Otherwise, I'll do the change, and subsequently push to production on Tuesday.

I will attempt to make the use of try.html more prominent. It is currently explained on both our CONTRIBUTING.md and INSTALL.md pages, in the repo. Would explaining it in README.md be beneficial in your opinion?

@sethvargo sethvargo deleted the sethvargo/cookbook branch April 11, 2014 17:44
@sethvargo
Copy link
Contributor Author

Hey @espadrine! Thank you for the quick turnaround!

Cookbooks are very similar to Ruby gems. "RubyGems" is the organization that hosts them, but they are called "gems". "Chef" is the organization that hosts them, but they are called "cookbooks". Since RubyGems went with "gem", I matched that and went with "cookbook".

Since Chef is already it's own project, I think it would be confusing if the badge were chef | x.y.z. What do you think?

@sethvargo
Copy link
Contributor Author

@espadrine I think this is what it should be:

diff --git a/server.js b/server.js
index 9e28ff7..9e1b503 100644
--- a/server.js
+++ b/server.js
@@ -824,7 +824,7 @@ cache(function(data, match, sendBadge) {
   var cookbook = match[1]; // eg, chef-sugar
   var format = match[2];
   var apiUrl = 'https://cookbooks.opscode.com/api/v1/cookbooks/' + cookbook + '/versions/latest';
-  var badgeData = getBadgeData('version', data);
+  var badgeData = getBadgeData('cookbook', data);

@espadrine
Copy link
Member

What do you think?

I think you're the expert on this! ☺

espadrine added a commit that referenced this pull request Apr 11, 2014
@sethvargo
Copy link
Contributor Author

@espadrine I blogged about this: https://sethvargo.com/chef-cookbook-badges/ 😄

@espadrine
Copy link
Member

Cool! I retweeted it from the Shields_io account!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants