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
a08e913a
Commit
a08e913a
authored
Mar 14, 2012
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Print a template for a new ticket when an error occurs. See #163.
parent
22f77e4b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
89 additions
and
6 deletions
+89
-6
command.rb
lib/cocoapods/command.rb
+6
-6
error_report.rb
lib/cocoapods/command/error_report.rb
+82
-0
config.rb
lib/cocoapods/config.rb
+1
-0
No files found.
lib/cocoapods/command.rb
View file @
a08e913a
module
Pod
module
Pod
class
Command
class
Command
autoload
:ErrorReport
,
'cocoapods/command/error_report'
autoload
:Install
,
'cocoapods/command/install'
autoload
:Install
,
'cocoapods/command/install'
autoload
:List
,
'cocoapods/command/list'
autoload
:Repo
,
'cocoapods/command/repo'
autoload
:Repo
,
'cocoapods/command/repo'
autoload
:Search
,
'cocoapods/command/search'
autoload
:Search
,
'cocoapods/command/search'
autoload
:List
,
'cocoapods/command/list'
autoload
:Setup
,
'cocoapods/command/setup'
autoload
:Setup
,
'cocoapods/command/setup'
autoload
:Spec
,
'cocoapods/command/spec'
autoload
:Spec
,
'cocoapods/command/spec'
...
@@ -52,13 +53,12 @@ module Pod
...
@@ -52,13 +53,12 @@ module Pod
def
self
.
run
(
*
argv
)
def
self
.
run
(
*
argv
)
parse
(
*
argv
).
run
parse
(
*
argv
).
run
rescue
Exception
=>
e
rescue
Exception
=>
e
unless
e
.
is_a?
(
Informative
)
if
e
.
is_a?
(
Informative
)
puts
"Oh no, an error occurred. Please run with `--verbose' and report "
\
"on https://github.com/CocoaPods/CocoaPods/issues."
puts
""
end
puts
e
.
message
puts
e
.
message
puts
*
e
.
backtrace
if
Config
.
instance
.
verbose
puts
*
e
.
backtrace
if
Config
.
instance
.
verbose
else
puts
ErrorReport
.
report
(
e
)
end
exit
1
exit
1
end
end
...
...
lib/cocoapods/command/error_report.rb
0 → 100644
View file @
a08e913a
require
'rbconfig'
require
'cgi'
module
Pod
class
Command
module
ErrorReport
class
<<
self
def
report
(
error
)
return
<<-
EOS
Oh no, an error occurred.
#{
error_from_podfile
(
error
)
}
Search for existing github issues similar to yours:
https://github.com/CocoaPods/CocoaPods/issues/search?q=%22
#{
CGI
.
escape
(
error
.
message
)
}
%22
If none exists, create a ticket with the following information to:
https://github.com/CocoaPods/CocoaPods/issues/new
Don't forget to anonymize any private data!
### Stack
* Host version:
#{
host_information
}
* Xcode version:
#{
xcode_information
}
* Ruby version:
#{
RUBY_DESCRIPTION
}
* Ruby lib dir:
#{
RbConfig
::
CONFIG
[
'libdir'
]
}
* RubyGems version:
#{
Gem
::
VERSION
}
* CocoaPods version:
#{
Pod
::
VERSION
}
* Specification repositories:
-
#{
repo_information
.
join
(
"
\n
- "
)
}
### Podfile
```ruby
#{
Config
.
instance
.
project_podfile
.
read
}
```
### Error
```
#{
error
.
message
}
#{
error
.
backtrace
.
join
(
"
\n
"
)
}
```
EOS
end
private
def
error_from_podfile
(
error
)
if
error
.
message
=~
/Podfile:(\d*)/
"It appears to have originated from your Podfile at line
#{
$1
}
."
end
end
def
host_information
product
,
version
,
build
=
`sw_vers`
.
strip
.
split
(
"
\n
"
).
map
{
|
line
|
line
.
split
(
":"
).
last
.
strip
}
"
#{
product
}
#{
version
}
(
#{
build
}
)"
end
def
xcode_information
version
,
build
=
`xcodebuild -version`
.
strip
.
split
(
"
\n
"
).
map
{
|
line
|
line
.
split
(
" "
).
last
}
"
#{
version
}
(
#{
build
}
)"
end
def
repo_information
Pod
::
Source
.
all
.
map
do
|
source
|
repo
=
source
.
repo
Dir
.
chdir
(
repo
)
do
url
=
`git config --get remote.origin.url`
.
strip
sha
=
`git rev-parse HEAD`
.
strip
"
#{
repo
.
basename
}
-
#{
url
}
@
#{
sha
}
"
end
end
end
end
end
end
end
lib/cocoapods/config.rb
View file @
a08e913a
...
@@ -33,6 +33,7 @@ module Pod
...
@@ -33,6 +33,7 @@ module Pod
def
project_podfile
def
project_podfile
unless
@project_podfile
unless
@project_podfile
@project_podfile
=
project_root
+
'Podfile'
@project_podfile
=
project_root
+
'Podfile'
# TODO this has to go, we don't support this anymore!
unless
@project_podfile
.
exist?
unless
@project_podfile
.
exist?
@project_podfile
=
project_root
.
glob
(
'*.podspec'
).
first
@project_podfile
=
project_root
.
glob
(
'*.podspec'
).
first
end
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