Commit 319d6959 authored by Samuel E. Giddins's avatar Samuel E. Giddins

[ErrorReport] Include git information in stack

Closes https://github.com/CocoaPods/CocoaPods/issues/2678.
parent 306bbe16
...@@ -29,6 +29,7 @@ module Pod ...@@ -29,6 +29,7 @@ module Pod
RubyGems : #{Gem::VERSION} RubyGems : #{Gem::VERSION}
Host : #{host_information} Host : #{host_information}
Xcode : #{xcode_information} Xcode : #{xcode_information}
Git : #{git_information}
Ruby lib dir : #{RbConfig::CONFIG['libdir']} Ruby lib dir : #{RbConfig::CONFIG['libdir']}
Repositories : #{repo_information.join("\n ")} Repositories : #{repo_information.join("\n ")}
``` ```
...@@ -105,6 +106,10 @@ EOS ...@@ -105,6 +106,10 @@ EOS
"#{version} (#{build})" "#{version} (#{build})"
end end
def git_information
`git --version`.strip.split("\n").first
end
def installed_plugins def installed_plugins
CLAide::Command::PluginsHelper.specifications. CLAide::Command::PluginsHelper.specifications.
reduce({}) { |hash, s| hash.tap { |h| h[s.name] = s.version.to_s } } reduce({}) { |hash, s| hash.tap { |h| h[s.name] = s.version.to_s } }
......
...@@ -35,6 +35,7 @@ module Pod ...@@ -35,6 +35,7 @@ module Pod
RubyGems : #{Gem::VERSION} RubyGems : #{Gem::VERSION}
Host : :host_information Host : :host_information
Xcode : :xcode_information Xcode : :xcode_information
Git : :git_information
Ruby lib dir : #{RbConfig::CONFIG['libdir']} Ruby lib dir : #{RbConfig::CONFIG['libdir']}
Repositories : repo_1 Repositories : repo_1
repo_2 repo_2
...@@ -85,6 +86,7 @@ EOS ...@@ -85,6 +86,7 @@ EOS
EOS EOS
@report.stubs(:host_information).returns(':host_information') @report.stubs(:host_information).returns(':host_information')
@report.stubs(:xcode_information).returns(':xcode_information') @report.stubs(:xcode_information).returns(':xcode_information')
@report.stubs(:git_information).returns(':git_information')
@report.stubs(:repo_information).returns(%w(repo_1 repo_2)) @report.stubs(:repo_information).returns(%w(repo_1 repo_2))
@report.stubs(:installed_plugins).returns('cocoapods' => Pod::VERSION, @report.stubs(:installed_plugins).returns('cocoapods' => Pod::VERSION,
'cocoapods-core' => Pod::VERSION, 'cocoapods-core' => Pod::VERSION,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment