Skip to content
This repository was archived by the owner on Dec 20, 2018. It is now read-only.

Move PNG generation library code into a separate package and remove autodetection of dataDir#13

Open
sqs wants to merge 6 commits into
badges:masterfrom
sourcegraph:library-usage
Open

Move PNG generation library code into a separate package and remove autodetection of dataDir#13
sqs wants to merge 6 commits into
badges:masterfrom
sourcegraph:library-usage

Conversation

@sqs

@sqs sqs commented Aug 29, 2013

Copy link
Copy Markdown

This PR makes it possible to use buckler as a library.

Buckler is awesome, BTW!

@chadwhitacre

Copy link
Copy Markdown

@nathany Wanna review this PR?

@ghost ghost assigned nathany Dec 24, 2013
@nathany

nathany commented Dec 24, 2013

Copy link
Copy Markdown
Contributor

@sqs Can you look into why the Travis CI build is failing?

I can review this after the holidays. Thanks.

@sqs

sqs commented Dec 24, 2013

Copy link
Copy Markdown
Author

Will do

Sent from my iPhone

On Dec 24, 2013, at 12:46, Nathan Youngman notifications@github.com wrote:

@sqs Can you look into why the Travis CI build is failing?

I can review this after the holidays. Thanks.


Reply to this email directly or view it on GitHub.

@sqs

sqs commented Dec 31, 2013

Copy link
Copy Markdown
Author

I think the Travis CI build is failing because it's set up for jbowes/buckler, not gittip/img.shields.io. If that's not the proximate cause, then it makes it difficult to debug because clicking on the Details link above yields a page that just says "Loading."

I don't see this PR at https://travis-ci.org/gittip/img.shields.io/builds, but I think one of the repository owners could trigger a build of this PR over at that link. Then I will diagnose the issue.

@chadwhitacre

Copy link
Copy Markdown

@sqs I restarted the build using gittip/img.shields.io. The build did error, but the "Details" link here now gives more useful output.

@nathany

nathany commented Jan 3, 2014

Copy link
Copy Markdown
Contributor

#25 should help matters

Comment thread main.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe Go supports relative import paths. You'll need github.com/gittip/img.shields.io/shield.

@nathany

nathany commented Jan 3, 2014

Copy link
Copy Markdown
Contributor

@sqs I'm still brand new to this code base, but I'm not sure about deleting that resources.go code. Maybe resourcePaths() should still be used by main.go even if it's not used by the shield subpackage. Perhaps @jbowes can chime in on these changes.

@nathany

nathany commented Jan 3, 2014

Copy link
Copy Markdown
Contributor

@sqs #25 got Travis passing on master. It does introduce a small merge conflict (basePkg) for you to address. Thanks.

@sqs

sqs commented Jan 3, 2014

Copy link
Copy Markdown
Author

Great. Thanks for the CR and the other fixes. I'll push some changes to this PR to address these issues in a couple of hours.

@sqs

sqs commented Jan 5, 2014

Copy link
Copy Markdown
Author

OK, I pushed changes that address these comments and bring this branch up-to-date with master. Travis CI is now passing.

Regarding resourcePaths(), I personally find it simpler to be explicit about paths instead of guessing them according to convention. The old convention in resourcePaths() would only work if you run it with go run or if you copy the data/ and static/ dirs into your $GOBIN. I'm fine with either way, though, so let me know what you prefer. (Either way, it needs more changes; currently, staticDir is hard-coded and dataDir is specified via command-line option, and it only makes sense for both to be determined in the same way.)

Comment thread main.go

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need to change per badges/shields#90 (comment)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than having a shield subfolder, what do you think of flipping it around? Go stdlib and a few other places have a cmd folder.

so github.com/badges/buckler/cmd/buckler is the folder containing the buckler CLI.
so we could make github.com/badges/buckler the library import (stdlib actually has a pkg/ subfolder as well, but meh).

Also, let's just call this buckler (not shield).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sgtm!

@nathany

nathany commented Jan 7, 2014

Copy link
Copy Markdown
Contributor

Thanks @sqs.

Should there be some changes to the Command Line section of the README regarding resources?

We should also add a section on using it as a library, though it's going the be unstable for a bit as we rename repos and rearrange things again.

Hopefully @jbowes can take a look before we hit the big green button, just in case there's something we missed.

@sqs

sqs commented Jan 7, 2014

Copy link
Copy Markdown
Author

@nathany, yes, good point, we will need to update the README to describe the -d option, but I want to wait until it's decided whether we use -d or the previous discovery method (#13 (comment)). You or @jbowes can make the call. And I'll add library usage info to the README then, tooo.

@nathany

nathany commented Jan 7, 2014

Copy link
Copy Markdown
Contributor

@sqs Also check the discussion here. badges/shields#94 Everything's up in the air atm.

@nathany

nathany commented Jan 8, 2014

Copy link
Copy Markdown
Contributor

So I guess I'll do another bit of cleanup now that we've relocated once again.

@sqs

sqs commented Jan 8, 2014

Copy link
Copy Markdown
Author

Sounds like buckler won't be used by shields.io anymore, so this may be a moot point, right? (Re: badges/shields#90 (comment))

@nathany

nathany commented Jan 8, 2014

Copy link
Copy Markdown
Contributor

Yah. We'll see how that goes. What were your plans for the buckler library?

@sqs

sqs commented Jan 8, 2014

Copy link
Copy Markdown
Author

We've been using this branch for a few months to generate the badges at https://sourcegraph.com/help/authors/badges.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants