forked from jscruggs/metric_fu
-
Notifications
You must be signed in to change notification settings - Fork 96
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 debug-info command line option. #118
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,7 @@ def process!(arguments = ARGV) | |
p.on_tail("-h", "--help", "Show this message") {puts p ; exit} | ||
short = @used_short.include?("v") ? "-V" : "-v" | ||
p.on_tail(short, "--version", "Print version") {puts @version ; exit} unless @version.nil? | ||
p.on_tail("--debug-info", "Print debug info") { debug_info; exit } | ||
@default_values = @result.clone # save default values to reset @result in subsequent calls | ||
end | ||
|
||
|
@@ -78,6 +79,16 @@ def process!(arguments = ARGV) | |
@result | ||
end | ||
|
||
def debug_info | ||
puts "Ruby" | ||
puts " Version: #{RUBY_VERSION}" | ||
puts " Platform: #{RUBY_PLATFORM}" | ||
puts " Engine: #{RUBY_ENGINE}" | ||
puts "\nMetricFu" | ||
puts " Version: #{@version}" | ||
puts "\n Dependencies #{`gem dependency metric_fu`}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can put this in a HERE doc message = <<-NACHOS
Ruby
Engine #{ruby_engine}
Version #{ruby_version}
NACHOS
STDOUT.puts message |
||
end | ||
|
||
# Build a nicely formatted list of built-in | ||
# formatter keys and their descriptions | ||
# @see MetricFu::Formatter::BUILTIN_FORMATS | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Thanks for this. Some suggestions:
Use only methods on MetricFu::Environment (
include Environment
)If the method you need isn't there, add it. e.g. ruby_version ruby_platform ruby_engine. See redcard
MetricFu version is fine, of course, as is.
I'm curious why you're collecting the immediate dependencies. That's what's effectively specified by the gemspec.
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 don't need to use all those variables, they're just what I thought of while commenting. I'm interested in what you think would be useful, as well.