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
1a34157e
Commit
1a34157e
authored
Dec 19, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Commands] Fix pod outdated.
parent
792abfd5
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
53 additions
and
52 deletions
+53
-52
command.rb
lib/cocoapods/command.rb
+3
-3
outdated.rb
lib/cocoapods/command/outdated.rb
+20
-14
project.rb
lib/cocoapods/command/project.rb
+8
-10
list_spec.rb
spec/functional/command/list_spec.rb
+0
-1
outdated_spec.rb
spec/functional/command/outdated_spec.rb
+0
-1
project_spec.rb
spec/functional/command/project_spec.rb
+22
-1
update_spec.rb
spec/functional/command/update_spec.rb
+0
-22
No files found.
lib/cocoapods/command.rb
View file @
1a34157e
...
...
@@ -52,10 +52,10 @@ module Pod
# @todo We should probably not even load colored unless needed.
#
def
initialize
(
argv
)
config
.
silent
||=
argv
.
flag?
(
'silent'
)
super
config
.
verbose
||=
self
.
verbose?
config
.
silent
=
argv
.
flag?
(
'silent'
,
config
.
silent
)
config
.
verbose
=
argv
.
flag?
(
'verbose'
,
config
.
verbose?
)
String
.
send
(
:define_method
,
:colorize
)
{
|
string
,
_
|
string
}
unless
self
.
colorize_output?
super
end
#-------------------------------------------------------------------------#
...
...
lib/cocoapods/command/outdated.rb
View file @
1a34157e
...
...
@@ -13,32 +13,38 @@ module Pod
end
def
initialize
(
argv
)
config
.
skip_repo_update
=
argv
.
flag?
(
'update'
,
tru
e
)
config
.
skip_repo_update
=
argv
.
flag?
(
'update'
,
config
.
skip_repo_updat
e
)
super
end
# @todo the command report new dependencies added to the Podfile as
# updates.
# @todo fix.
#
def
run
verify_podfile_exists!
verify_lockfile_exists!
sandbox
=
Sandbox
.
new
(
config
.
project_pods_root
)
resolver
=
Resolver
.
new
(
config
.
podfile
,
config
.
lockfile
,
sandbox
)
resolver
.
update_mode
=
true
resolver
.
update_external_specs
=
false
resolver
.
resolve
names
=
resolver
.
pods_to_install
-
resolver
.
pods_from_external_sources
specs
=
resolver
.
specs
.
select
do
|
spec
|
names
.
include?
(
spec
.
name
)
&&
!
spec
.
version
.
head?
lockfile
=
config
.
lockfile
pods
=
lockfile
.
pod_names
updates
=
[]
pods
.
each
do
|
pod_name
|
set
=
SourcesManager
.
search
(
Dependency
.
new
(
pod_name
))
source_version
=
set
.
versions
.
first
lockfile_version
=
lockfile
.
version
(
pod_name
)
if
source_version
>
lockfile_version
updates
<<
[
pod_name
,
lockfile_version
,
source_version
]
end
end
if
spec
s
.
empty?
puts
"No updates are available."
.
yellow
if
update
s
.
empty?
UI
.
puts
"No updates are available."
.
yellow
else
puts
"The following updates are available:"
.
green
puts
" - "
<<
specs
.
join
(
"
\n
- "
)
<<
"
\n
"
UI
.
section
"The following updates are available:"
do
updates
.
each
do
|
(
name
,
from_version
,
to_version
)
|
UI
.
message
"-
#{
name
}
#{
from_version
}
->
#{
to_version
}
"
end
end
end
end
end
...
...
lib/cocoapods/command/project.rb
View file @
1a34157e
module
Pod
class
Command
# Provides support the common behaviour of the `install` and `update`
# commands.
#
module
Project
module
Options
def
options
...
...
@@ -16,17 +20,11 @@ module Pod
base
.
extend
Options
end
# @todo find a better way to not override the config if the flag was not
# specified. A solution could be a method called only if the flag
# is not nil:
#
# argv.set_flag('clean') { |value| config.clean = value }
#
def
initialize
(
argv
)
config
.
clean
=
value
if
value
=
argv
.
flag?
(
'clean'
)
config
.
generate_docs
=
value
if
value
=
argv
.
flag?
(
'doc'
)
config
.
integrate_targets
=
value
if
value
=
argv
.
flag?
(
'integrate'
)
config
.
skip_repo_update
=
value
if
value
=
!
argv
.
flag?
(
'update'
)
config
.
clean
=
argv
.
flag?
(
'clean'
,
config
.
clean
)
config
.
generate_docs
=
argv
.
flag?
(
'doc'
,
config
.
generate_docs
)
config
.
integrate_targets
=
argv
.
flag?
(
'integrate'
,
config
.
integrate_targets
)
config
.
skip_repo_update
=
!
argv
.
flag?
(
'update'
,
!
config
.
skip_repo_update
)
super
end
...
...
spec/functional/command/list_spec.rb
View file @
1a34157e
...
...
@@ -3,7 +3,6 @@ require File.expand_path('../../../spec_helper', __FILE__)
module
Pod
describe
"Command::List"
do
extend
SpecHelper
::
TemporaryRepos
before
do
set_up_test_repo
...
...
spec/functional/command/outdated_spec.rb
View file @
1a34157e
...
...
@@ -2,7 +2,6 @@ require File.expand_path('../../../spec_helper', __FILE__)
module
Pod
describe
Command
::
Outdated
do
extend
SpecHelper
::
TemporaryRepos
it
"tells the user that no Podfile was found in the current working dir"
do
...
...
spec/functional/command/
install
_spec.rb
→
spec/functional/command/
project
_spec.rb
View file @
1a34157e
...
...
@@ -2,11 +2,32 @@ require File.expand_path('../../../spec_helper', __FILE__)
module
Pod
describe
Command
::
Install
do
it
"tells the user that no Podfile or podspec was found in the current working dir"
do
exception
=
lambda
{
run_command
(
'install'
,
'--no-update'
)
}.
should
.
raise
Informative
exception
.
message
.
should
.
include
"No `Podfile' found in the current working directory."
end
end
#--------------------------------------------------------------------------------#
describe
Command
::
Update
do
extend
SpecHelper
::
TemporaryRepos
it
"tells the user that no Podfile was found in the current working dir"
do
exception
=
lambda
{
run_command
(
'update'
,
'--no-update'
)
}.
should
.
raise
Informative
exception
.
message
.
should
.
include
"No `Podfile' found in the current working directory."
end
it
"tells the user that no Lockfile was found in the current working dir"
do
file
=
temporary_directory
+
'Podfile'
File
.
open
(
file
,
'w'
)
{
|
f
|
f
.
write
(
'platform :ios'
)
}
Dir
.
chdir
(
temporary_directory
)
do
exception
=
lambda
{
run_command
(
'update'
,
'--no-update'
)
}.
should
.
raise
Informative
exception
.
message
.
should
.
include
"No `Podfile.lock' found in the current working directory"
end
end
end
end
spec/functional/command/update_spec.rb
View file @
1a34157e
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
module
Pod
describe
Command
::
Update
do
extend
SpecHelper
::
TemporaryRepos
it
"tells the user that no Podfile was found in the current working dir"
do
exception
=
lambda
{
run_command
(
'update'
,
'--no-update'
)
}.
should
.
raise
Informative
exception
.
message
.
should
.
include
"No `Podfile' found in the current working directory."
end
it
"tells the user that no Lockfile was found in the current working dir"
do
file
=
temporary_directory
+
'Podfile'
File
.
open
(
file
,
'w'
)
{
|
f
|
f
.
write
(
'platform :ios'
)
}
Dir
.
chdir
(
temporary_directory
)
do
exception
=
lambda
{
run_command
(
'update'
,
'--no-update'
)
}.
should
.
raise
Informative
exception
.
message
.
should
.
include
"No `Podfile.lock' found in the current working directory"
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