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
Conversation
…user flag is set at a time
…nd hand it to githubchart. GithubChart uses the data object directly
@@ -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) |
There was a problem hiding this comment.
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.
exit 1 | ||
end | ||
|
||
unless (input.eql? '-') || (File.exists?(input)) |
There was a problem hiding this comment.
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
…d collapsing long if check
…onsuming external data and checking for data creation without external data
Welcome to Ruby Club 👍 |
Add an option for file/STDIN to allow for third party chart data
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.