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 an option for file/STDIN to allow for third party chart data #31

Merged
merged 12 commits into from Sep 2, 2014

Conversation

Stantheman
Copy link
Contributor

This adds a -i/--input flag that takes a file or STDIN. In concert with something like fakehubstats, this would allow githubchart to create graphs of non-public or even non-git related streaks.

This is basically my first foray into Ruby, so I'm looking forward to feedback. I still need to add tests.

@@ -9,8 +9,37 @@ OptionParser.new do |opts|
"Usage: githubchart (-u username) (-t type) path/for/new/image\n"
opts.banner << 'Supported types: ' + GithubChart.supported.join(' ')
opts.on('-uUSER', '--user=USER', 'Specify GitHub user to graph') do |user|
if options.has_key?(:input)
Copy link
Owner

Choose a reason for hiding this comment

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

This should probably be "options.include? :input". has_key works, but include is the more conventional way for testing inclusion.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 536a5dc on Stantheman:stdin into faaa886 on akerl:master.

exit 1
end

unless (input.eql? '-') || (File.exists?(input))
Copy link
Owner

Choose a reason for hiding this comment

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

You may want to check "If file exists or (input equals '-' and stdin isn't a TTY", for sanity

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 8cb998f on Stantheman:stdin into faaa886 on akerl:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 01a2a73 on Stantheman:stdin into faaa886 on akerl:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling ad1bbef on Stantheman:stdin into faaa886 on akerl:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 26f3105 on Stantheman:stdin into faaa886 on akerl:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 1bc0dff on Stantheman:stdin into faaa886 on akerl:master.

@akerl
Copy link
Owner

akerl commented Sep 2, 2014

Welcome to Ruby Club 👍

akerl added a commit that referenced this pull request Sep 2, 2014
Add an option for file/STDIN to allow for third party chart data
@akerl akerl merged commit 4b5635c into akerl:master Sep 2, 2014
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.

None yet

3 participants