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
4b9f4594
Commit
4b9f4594
authored
Oct 04, 2012
by
Taras Kalapun
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #571 from xslim/master
Podfile & Lockfile error handling
parents
11edebab
303dbb54
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
lockfile.rb
lib/cocoapods/lockfile.rb
+4
-0
podfile.rb
lib/cocoapods/podfile.rb
+4
-0
No files found.
lib/cocoapods/lockfile.rb
View file @
4b9f4594
...
@@ -8,7 +8,11 @@ module Pod
...
@@ -8,7 +8,11 @@ module Pod
#
#
def
self
.
from_file
(
path
)
def
self
.
from_file
(
path
)
return
nil
unless
path
.
exist?
return
nil
unless
path
.
exist?
begin
hash
=
YAML
.
load
(
File
.
open
(
path
))
hash
=
YAML
.
load
(
File
.
open
(
path
))
rescue
Exception
=>
e
raise
Informative
,
"Podfile.lock syntax error:
#{
e
.
inspect
}
"
end
lockfile
=
Lockfile
.
new
(
hash
)
lockfile
=
Lockfile
.
new
(
hash
)
lockfile
.
defined_in_file
=
path
lockfile
.
defined_in_file
=
path
lockfile
lockfile
...
...
lib/cocoapods/podfile.rb
View file @
4b9f4594
...
@@ -177,7 +177,11 @@ module Pod
...
@@ -177,7 +177,11 @@ module Pod
string
=
File
.
open
(
path
,
'r:utf-8'
)
{
|
f
|
f
.
read
}
string
=
File
.
open
(
path
,
'r:utf-8'
)
{
|
f
|
f
.
read
}
# TODO: work around for Rubinius incomplete encoding in 1.9 mode
# TODO: work around for Rubinius incomplete encoding in 1.9 mode
string
.
encode!
(
'UTF-8'
)
if
string
.
respond_to?
(
:encoding
)
&&
string
.
encoding
.
name
!=
"UTF-8"
string
.
encode!
(
'UTF-8'
)
if
string
.
respond_to?
(
:encoding
)
&&
string
.
encoding
.
name
!=
"UTF-8"
begin
eval
(
string
,
nil
,
path
.
to_s
)
eval
(
string
,
nil
,
path
.
to_s
)
rescue
Exception
=>
e
raise
Informative
,
"Podfile syntax error:
#{
e
.
inspect
}
"
end
end
end
podfile
.
defined_in_file
=
path
podfile
.
defined_in_file
=
path
podfile
.
validate!
podfile
.
validate!
...
...
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