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
4ee2fc68
Commit
4ee2fc68
authored
May 29, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Repo] Check versions only if defined.
parent
e32e4255
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
repo.rb
lib/cocoapods/command/repo.rb
+7
-5
No files found.
lib/cocoapods/command/repo.rb
View file @
4ee2fc68
...
@@ -63,16 +63,18 @@ module Pod
...
@@ -63,16 +63,18 @@ module Pod
yaml_file
=
dir
+
'CocoaPods-version.yml'
yaml_file
=
dir
+
'CocoaPods-version.yml'
return
unless
yaml_file
.
exist?
return
unless
yaml_file
.
exist?
data
=
YAML
.
load_file
(
yaml_file
)
data
=
YAML
.
load_file
(
yaml_file
)
min_version
=
Gem
::
Version
.
new
(
data
[
'min'
])
min_version
=
Gem
::
Version
.
new
(
data
[
'min'
])
if
data
[
'min'
]
max_version
=
Gem
::
Version
.
new
(
data
[
'max'
])
max_version
=
Gem
::
Version
.
new
(
data
[
'max'
])
if
data
[
'max'
]
last_version
=
Gem
::
Version
.
new
(
data
[
'last'
])
last_version
=
Gem
::
Version
.
new
(
data
[
'last'
])
if
data
[
'last'
]
if
min_version
>
bin_version
||
max_version
<
bin_version
supports_min
=
min_version
?
bin_version
>=
min_version
:
true
supports_max
=
max_version
?
bin_version
<=
max_version
:
true
unless
supports_min
&&
supports_max
version_msg
=
(
min_version
==
max_version
)
?
min_version
:
"
#{
min_version
}
-
#{
max_version
}
"
version_msg
=
(
min_version
==
max_version
)
?
min_version
:
"
#{
min_version
}
-
#{
max_version
}
"
raise
Informative
,
raise
Informative
,
"
\n
[!] The `
#{
dir
.
basename
.
to_s
}
' repo requires CocoaPods
#{
min_version
}
\n
"
.
red
+
"
\n
[!] The `
#{
dir
.
basename
.
to_s
}
' repo requires CocoaPods
#{
min_version
}
\n
"
.
red
+
"Update Cocoapods, or checkout the appropriate tag in the repo.
\n\n
"
"Update Cocoapods, or checkout the appropriate tag in the repo.
\n\n
"
end
end
puts
"
Cocoapods
#{
last_version
}
is available"
.
green
if
last_version
>
bin_version
puts
"
\n
Cocoapods
#{
last_version
}
is available.
\n
"
.
green
if
last_version
&&
last_version
>
bin_version
end
end
end
end
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