Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
88742dd0
Commit
88742dd0
authored
Sep 11, 2014
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2214 from CocoaPods/error-report-plugins
[ErrorReport] List the installed plugins
parents
5bc3fc01
65a360e7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
error_report.rb
lib/cocoapods/user_interface/error_report.rb
+19
-0
error_report_spec.rb
spec/unit/user_interface/error_report_spec.rb
+13
-0
No files found.
lib/cocoapods/user_interface/error_report.rb
View file @
88742dd0
...
...
@@ -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'
...
...
spec/unit/user_interface/error_report_spec.rb
View file @
88742dd0
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment