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
...
@@ -52,10 +52,10 @@ module Pod
# @todo We should probably not even load colored unless needed.
# @todo We should probably not even load colored unless needed.
#
#
def
initialize
(
argv
)
def
initialize
(
argv
)
config
.
silent
||=
argv
.
flag?
(
'silent'
)
config
.
silent
=
argv
.
flag?
(
'silent'
,
config
.
silent
)
super
config
.
verbose
=
argv
.
flag?
(
'verbose'
,
config
.
verbose?
)
config
.
verbose
||=
self
.
verbose?
String
.
send
(
:define_method
,
:colorize
)
{
|
string
,
_
|
string
}
unless
self
.
colorize_output?
String
.
send
(
:define_method
,
:colorize
)
{
|
string
,
_
|
string
}
unless
self
.
colorize_output?
super
end
end
#-------------------------------------------------------------------------#
#-------------------------------------------------------------------------#
...
...
lib/cocoapods/command/outdated.rb
View file @
1a34157e
...
@@ -13,32 +13,38 @@ module Pod
...
@@ -13,32 +13,38 @@ module Pod
end
end
def
initialize
(
argv
)
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
super
end
end
# @todo the command report new dependencies added to the Podfile as
# @todo the command report new dependencies added to the Podfile as
# updates.
# updates.
# @todo fix.
#
def
run
def
run
verify_podfile_exists!
verify_podfile_exists!
verify_lockfile_exists!
verify_lockfile_exists!
sandbox
=
Sandbox
.
new
(
config
.
project_pods_root
)
lockfile
=
config
.
lockfile
resolver
=
Resolver
.
new
(
config
.
podfile
,
config
.
lockfile
,
sandbox
)
pods
=
lockfile
.
pod_names
resolver
.
update_mode
=
true
updates
=
[]
resolver
.
update_external_specs
=
false
pods
.
each
do
|
pod_name
|
resolver
.
resolve
set
=
SourcesManager
.
search
(
Dependency
.
new
(
pod_name
))
source_version
=
set
.
versions
.
first
names
=
resolver
.
pods_to_install
-
resolver
.
pods_from_external_sources
lockfile_version
=
lockfile
.
version
(
pod_name
)
specs
=
resolver
.
specs
.
select
do
|
spec
|
if
source_version
>
lockfile_version
names
.
include?
(
spec
.
name
)
&&
!
spec
.
version
.
head?
updates
<<
[
pod_name
,
lockfile_version
,
source_version
]
end
end
end
if
spec
s
.
empty?
if
update
s
.
empty?
puts
"No updates are available."
.
yellow
UI
.
puts
"No updates are available."
.
yellow
else
else
puts
"The following updates are available:"
.
green
UI
.
section
"The following updates are available:"
do
puts
" - "
<<
specs
.
join
(
"
\n
- "
)
<<
"
\n
"
updates
.
each
do
|
(
name
,
from_version
,
to_version
)
|
UI
.
message
"-
#{
name
}
#{
from_version
}
->
#{
to_version
}
"
end
end
end
end
end
end
end
end
...
...
lib/cocoapods/command/project.rb
View file @
1a34157e
module
Pod
module
Pod
class
Command
class
Command
# Provides support the common behaviour of the `install` and `update`
# commands.
#
module
Project
module
Project
module
Options
module
Options
def
options
def
options
...
@@ -16,17 +20,11 @@ module Pod
...
@@ -16,17 +20,11 @@ module Pod
base
.
extend
Options
base
.
extend
Options
end
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
)
def
initialize
(
argv
)
config
.
clean
=
value
if
value
=
argv
.
flag?
(
'clean'
)
config
.
clean
=
argv
.
flag?
(
'clean'
,
config
.
clean
)
config
.
generate_docs
=
value
if
value
=
argv
.
flag?
(
'doc'
)
config
.
generate_docs
=
argv
.
flag?
(
'doc'
,
config
.
generate_docs
)
config
.
integrate_targets
=
value
if
value
=
argv
.
flag?
(
'integrate'
)
config
.
integrate_targets
=
argv
.
flag?
(
'integrate'
,
config
.
integrate_targets
)
config
.
skip_repo_update
=
value
if
value
=
!
argv
.
flag?
(
'update'
)
config
.
skip_repo_update
=
!
argv
.
flag?
(
'update'
,
!
config
.
skip_repo_update
)
super
super
end
end
...
...
spec/functional/command/list_spec.rb
View file @
1a34157e
...
@@ -3,7 +3,6 @@ require File.expand_path('../../../spec_helper', __FILE__)
...
@@ -3,7 +3,6 @@ require File.expand_path('../../../spec_helper', __FILE__)
module
Pod
module
Pod
describe
"Command::List"
do
describe
"Command::List"
do
extend
SpecHelper
::
TemporaryRepos
extend
SpecHelper
::
TemporaryRepos
before
do
before
do
set_up_test_repo
set_up_test_repo
...
...
spec/functional/command/outdated_spec.rb
View file @
1a34157e
...
@@ -2,7 +2,6 @@ require File.expand_path('../../../spec_helper', __FILE__)
...
@@ -2,7 +2,6 @@ require File.expand_path('../../../spec_helper', __FILE__)
module
Pod
module
Pod
describe
Command
::
Outdated
do
describe
Command
::
Outdated
do
extend
SpecHelper
::
TemporaryRepos
extend
SpecHelper
::
TemporaryRepos
it
"tells the user that no Podfile was found in the current working dir"
do
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__)
...
@@ -2,11 +2,32 @@ require File.expand_path('../../../spec_helper', __FILE__)
module
Pod
module
Pod
describe
Command
::
Install
do
describe
Command
::
Install
do
it
"tells the user that no Podfile or podspec was found in the current working dir"
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
=
lambda
{
run_command
(
'install'
,
'--no-update'
)
}.
should
.
raise
Informative
exception
.
message
.
should
.
include
"No `Podfile' found in the current working directory."
exception
.
message
.
should
.
include
"No `Podfile' found in the current working directory."
end
end
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
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