Commit 88742dd0 authored by Samuel E. Giddins's avatar Samuel E. Giddins

Merge pull request #2214 from CocoaPods/error-report-plugins

[ErrorReport] List the installed plugins
parents 5bc3fc01 65a360e7
......@@ -32,6 +32,12 @@ module Pod
Ruby lib dir : #{RbConfig::CONFIG['libdir']}
Repositories : #{repo_information.join("\n ")}
```
### Plugins
```
#{plugins_string}
```
#{markdown_podfile}
### Error
......@@ -99,6 +105,19 @@ EOS
"#{version} (#{build})"
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
SourcesManager.all.map do |source|
next unless source.type == 'file system'
......
......@@ -40,6 +40,14 @@ Repositories : repo_1
repo_2
```
### Plugins
```
cocoapods : #{Pod::VERSION}
cocoapods-core : #{Pod::VERSION}
cocoapods-plugins : 1.2.3
```
### Podfile
```ruby
......@@ -78,6 +86,11 @@ EOS
@report.stubs(:host_information).returns(':host_information')
@report.stubs(:xcode_information).returns(':xcode_information')
@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.should == expected
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