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
97e61199
Commit
97e61199
authored
Apr 17, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[#201] Moved version check to repo sub-command
parent
331c95f9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
20 deletions
+19
-20
cocoapods.rb
lib/cocoapods.rb
+1
-1
command.rb
lib/cocoapods/command.rb
+1
-15
repo.rb
lib/cocoapods/command/repo.rb
+17
-0
source.rb
lib/cocoapods/source.rb
+0
-4
No files found.
lib/cocoapods.rb
View file @
97e61199
Encoding
.
default_external
=
Encoding
::
UTF_8
if
RUBY_VERSION
>
'1.8.7'
module
Pod
VERSION
=
'0.6.0
.a
'
VERSION
=
'0.6.0
rc1
'
class
Informative
<
StandardError
end
...
...
lib/cocoapods/command.rb
View file @
97e61199
...
...
@@ -65,23 +65,9 @@ module Pod
end
def
self
.
run
(
*
argv
)
bin_version
=
Gem
::
Version
.
new
(
VERSION
)
last_version
=
bin_version
Source
.
all
.
each
{
|
source
|
file
=
source
.
repo
+
'CocoaPods-version.txt'
next
unless
file
.
exist?
repo_min_version
=
Gem
::
Version
.
new
(
YAML
.
load_file
(
file
)[
:min
])
repo_last_version
=
Gem
::
Version
.
new
(
YAML
.
load_file
(
file
)[
:last
])
last_version
=
repo_last_version
if
repo_last_version
&&
repo_last_version
>
last_version
if
repo_min_version
>
bin_version
raise
Informative
,
"
\n
[!] The repo `
#{
source
}
' requires CocoaPods version
#{
repo_version
}
\n
"
.
red
+
"
\n
Please, update your gem
\n\n
"
end
}
puts
"
\n
-> Cocoapods
#{
last_version
}
is available
\n
"
.
green
.
reversed
if
last_version
>
bin_version
Setup
.
new
(
ARGV
.
new
).
run_if_needed
parse
(
*
argv
).
run
rescue
Interrupt
puts
"[!] Cancelled"
.
red
Config
.
instance
.
verbose?
?
raise
:
exit
(
1
)
...
...
lib/cocoapods/command/repo.rb
View file @
97e61199
...
...
@@ -45,6 +45,7 @@ module Pod
puts
"Cloning spec repo `
#{
@name
}
' from `
#{
@url
}
'"
unless
config
.
silent?
config
.
repos_dir
.
mkpath
Dir
.
chdir
(
config
.
repos_dir
)
{
git
(
"clone '
#{
@url
}
'
#{
@name
}
"
)
}
check_versions
(
dir
)
end
def
update
...
...
@@ -52,8 +53,24 @@ module Pod
dirs
.
each
do
|
dir
|
puts
"Updating spec repo `
#{
dir
.
basename
}
'"
unless
config
.
silent?
Dir
.
chdir
(
dir
)
{
git
(
"pull"
)
}
check_versions
(
dir
)
end
end
def
check_versions
(
dir
)
bin_version
=
Gem
::
Version
.
new
(
VERSION
)
yaml_file
=
dir
+
'CocoaPods-version.yml'
return
unless
yaml_file
.
exist?
data
=
YAML
.
load_file
(
yaml_file
)
min_version
=
Gem
::
Version
.
new
(
data
[
:min
])
last_version
=
Gem
::
Version
.
new
(
data
[
:last
])
if
min_version
>
bin_version
raise
Informative
,
"
\n
[!] The `
#{
dir
.
basename
.
to_s
}
' repo requires CocoaPods
#{
min_version
}
\n
"
.
red
+
"Update Cocoapods, or checkout the appropriate tag/commit in the repo
\n\n
"
end
puts
"Cocoapods
#{
last_version
}
is available"
.
green
if
last_version
>
bin_version
end
end
end
end
...
...
lib/cocoapods/source.rb
View file @
97e61199
...
...
@@ -83,9 +83,5 @@ module Pod
set
if
text
.
downcase
.
include?
(
query
.
downcase
)
end
.
compact
end
def
to_s
@repo
.
basename
.
to_s
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