Commit 65a360e7 authored by Samuel E. Giddins's avatar Samuel E. Giddins

[ErrorReport] List the installed plugins

[ErrorReportSpec] Update spec to include plugins list

[Hound] Clean up error report

[Hound] Remove explicit curly braces for hash in error report spec

[ErrorReport] Ensure plugins are sorted

Use the new CLAide::PluginsHelper method
parent 3fe8b500
...@@ -32,6 +32,12 @@ module Pod ...@@ -32,6 +32,12 @@ module Pod
Ruby lib dir : #{RbConfig::CONFIG['libdir']} Ruby lib dir : #{RbConfig::CONFIG['libdir']}
Repositories : #{repo_information.join("\n ")} Repositories : #{repo_information.join("\n ")}
``` ```
### Plugins
```
#{plugins_string}
```
#{markdown_podfile} #{markdown_podfile}
### Error ### Error
...@@ -99,6 +105,19 @@ EOS ...@@ -99,6 +105,19 @@ EOS
"#{version} (#{build})" "#{version} (#{build})"
end end
def installed_plugins
CLAide::Command::PluginsHelper.specifications.
reduce({}) { |hash, s| hash.tap { |h| h[s.name] = s.version.to_s } }
end
def plugins_string
plugins = installed_plugins
max_name_length = plugins.keys.map(&:length).max
plugins.map do |name, version|
"#{name.ljust(max_name_length)} : #{version}"
end.sort.join("\n")
end
def repo_information def repo_information
SourcesManager.all.map do |source| SourcesManager.all.map do |source|
next unless source.type == 'file system' next unless source.type == 'file system'
......
...@@ -40,6 +40,14 @@ Repositories : repo_1 ...@@ -40,6 +40,14 @@ Repositories : repo_1
repo_2 repo_2
``` ```
### Plugins
```
cocoapods : #{Pod::VERSION}
cocoapods-core : #{Pod::VERSION}
cocoapods-plugins : 1.2.3
```
### Podfile ### Podfile
```ruby ```ruby
...@@ -78,6 +86,11 @@ EOS ...@@ -78,6 +86,11 @@ 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(: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,
'cocoapods-core' => Pod::VERSION,
'cocoapods-plugins' => '1.2.3'
})
report = remove_color(@report.report(@exception)) report = remove_color(@report.report(@exception))
report.should == expected report.should == expected
end end
......
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