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
57d061c9
Commit
57d061c9
authored
Jan 03, 2015
by
Kyle Fuller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Rubocop] Enable Lint/UselessAssignment
parent
dedd11ab
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
26 additions
and
37 deletions
+26
-37
.rubocop_todo.yml
.rubocop_todo.yml
+0
-4
analyzer.rb
lib/cocoapods/installer/analyzer.rb
+1
-2
pod_source_installer.rb
lib/cocoapods/installer/pod_source_installer.rb
+1
-1
target_installer.rb
lib/cocoapods/installer/target_installer.rb
+1
-1
sources_manager.rb
lib/cocoapods/sources_manager.rb
+5
-5
init_spec.rb
spec/functional/command/init_spec.rb
+2
-2
lib_spec.rb
spec/functional/command/lib_spec.rb
+1
-1
setup_spec.rb
spec/functional/command/setup_spec.rb
+1
-1
acknowledgements_spec.rb
spec/unit/generator/acknowledgements_spec.rb
+1
-1
analyzer_spec.rb
spec/unit/installer/analyzer_spec.rb
+1
-1
file_references_installer_spec.rb
spec/unit/installer/file_references_installer_spec.rb
+1
-1
user_project_integrator_spec.rb
spec/unit/installer/user_project_integrator_spec.rb
+1
-1
installer_spec.rb
spec/unit/installer_spec.rb
+3
-9
project_spec.rb
spec/unit/project_spec.rb
+3
-3
sources_manager_spec.rb
spec/unit/sources_manager_spec.rb
+3
-3
validator_spec.rb
spec/unit/validator_spec.rb
+1
-1
No files found.
.rubocop_todo.yml
View file @
57d061c9
...
...
@@ -9,10 +9,6 @@
Lint/UselessAccessModifier
:
Enabled
:
false
# Offense count: 32
Lint/UselessAssignment
:
Enabled
:
false
# Offense count: 1
Metrics/BlockNesting
:
Max
:
4
...
...
lib/cocoapods/installer/analyzer.rb
View file @
57d061c9
...
...
@@ -344,7 +344,6 @@ module Pod
def
dependencies_to_fetch
@deps_to_fetch
||=
begin
deps_to_fetch
=
[]
deps_to_fetch_if_needed
=
[]
deps_with_external_source
=
podfile
.
dependencies
.
select
(
&
:external_source
)
if
update_mode
==
:all
...
...
@@ -668,7 +667,7 @@ module Pod
project_path
=
compute_user_project_path
(
target_definition
)
user_project
=
Xcodeproj
::
Project
.
open
(
project_path
)
targets
=
compute_user_project_targets
(
target_definition
,
user_project
)
platform
=
compute_platform_for_target_definition
(
target_definition
,
targets
)
compute_platform_for_target_definition
(
target_definition
,
targets
)
archs
=
compute_archs_for_target_definition
(
target_definition
,
targets
)
@archs_by_target_def
[
target_definition
]
=
archs
else
...
...
lib/cocoapods/installer/pod_source_installer.rb
View file @
57d061c9
...
...
@@ -46,7 +46,7 @@ module Pod
run_prepare_command
rescue
Informative
raise
rescue
Object
=>
e
rescue
Object
UI
.
notice
(
"Error installing
#{
root_spec
.
name
}
"
)
clean!
raise
...
...
lib/cocoapods/installer/target_installer.rb
View file @
57d061c9
...
...
@@ -48,7 +48,7 @@ module Pod
product
.
path
=
product_name
target
.
user_build_configurations
.
each
do
|
bc_name
,
type
|
configuration
=
@native_target
.
add_build_configuration
(
bc_name
,
type
)
@native_target
.
add_build_configuration
(
bc_name
,
type
)
end
@native_target
.
build_configurations
.
each
do
|
configuration
|
...
...
lib/cocoapods/sources_manager.rb
View file @
57d061c9
...
...
@@ -44,7 +44,7 @@ module Pod
argv
=
[
name
,
url
]
argv
<<
'--shallow'
if
name
=~
/^master(-\d+)?$/
Command
::
Repo
::
Add
.
new
(
CLAide
::
ARGV
.
new
(
argv
)).
run
rescue
Informative
=>
e
rescue
Informative
raise
Informative
,
"Unable to add a source with url `
#{
url
}
` "
\
"named `
#{
name
}
`.
\n
You can try adding it manually in "
\
'`~/.cocoapods/repos` or via `pod repo add`.'
...
...
@@ -197,7 +197,7 @@ module Pod
begin
output
=
git!
(
'pull --ff-only'
)
UI
.
puts
output
if
show_output
&&
!
config
.
verbose?
rescue
Informative
=>
e
rescue
Informative
UI
.
warn
'CocoaPods was not able to update the '
\
"`
#{
source
.
name
}
` repo. If this is an unexpected issue "
\
'and persists you can inspect it running '
\
...
...
@@ -314,7 +314,7 @@ module Pod
return
{}
unless
yaml_file
.
exist?
begin
YAMLHelper
.
load_file
(
yaml_file
)
rescue
Informative
=>
e
rescue
Informative
raise
Informative
,
"There was an error reading '
#{
yaml_file
}
'.
\n
"
\
'Please consult http://blog.cocoapods.org/'
\
'Repairing-Our-Broken-Specs-Repository/ '
\
...
...
@@ -432,8 +432,8 @@ module Pod
else
base
=
''
end
base
+=
path
.
gsub
(
/.git$/
,
''
).
gsub
(
/^\//
,
''
).
split
(
'/'
).
join
(
'-'
)
base
+
path
.
gsub
(
/.git$/
,
''
).
gsub
(
/^\//
,
''
).
split
(
'/'
).
join
(
'-'
)
end
case
url
.
to_s
.
downcase
...
...
spec/functional/command/init_spec.rb
View file @
57d061c9
...
...
@@ -51,8 +51,8 @@ module Pod
it
'creates a Podfile with targets from the project'
do
Dir
.
chdir
(
temporary_directory
)
do
project
=
Xcodeproj
::
Project
.
new
(
temporary_directory
+
'test.xcodeproj'
)
target1
=
project
.
new_target
(
:application
,
'AppA'
,
:ios
)
target2
=
project
.
new_target
(
:application
,
'AppB'
,
:ios
)
project
.
new_target
(
:application
,
'AppA'
,
:ios
)
project
.
new_target
(
:application
,
'AppB'
,
:ios
)
project
.
save
run_command
(
'init'
)
...
...
spec/functional/command/lib_spec.rb
View file @
57d061c9
...
...
@@ -49,7 +49,7 @@ module Pod
it
'should use the given template URL'
do
template_url
=
'https://github.com/custom/template.git'
@sut
.
any_instance
.
expects
(
:git!
).
with
(
"clone '
#{
template_url
}
' TestPod"
).
once
sut
=
run_command
(
'lib'
,
'create'
,
'TestPod'
,
template_url
)
run_command
(
'lib'
,
'create'
,
'TestPod'
,
template_url
)
end
it
'should use the default URL if no template URL is given'
do
...
...
spec/functional/command/setup_spec.rb
View file @
57d061c9
...
...
@@ -68,7 +68,7 @@ module Pod
source
.
should
.
exist?
target
.
should
.
not
.
exist?
output
=
run_command
(
'setup'
)
run_command
(
'setup'
)
source
.
should
.
not
.
exist?
target
.
should
.
exist?
...
...
spec/unit/generator/acknowledgements_spec.rb
View file @
57d061c9
...
...
@@ -46,7 +46,7 @@ module Pod
it
"warns the user if the file specified in the license doesn't exists"
do
@spec
.
stubs
(
:license
).
returns
(
:type
=>
'MIT'
,
:file
=>
'MISSING'
)
text_from_spec
=
@generator
.
send
(
:license_text
,
@spec
)
@generator
.
send
(
:license_text
,
@spec
)
UI
.
warnings
.
should
.
include
'Unable to read the license file'
end
...
...
spec/unit/installer/analyzer_spec.rb
View file @
57d061c9
...
...
@@ -524,7 +524,7 @@ module Pod
it
'uses the lowest deployment target of the user targets if inferring the platform'
do
user_project
=
Xcodeproj
::
Project
.
new
(
'path'
)
target1
=
user_project
.
new_target
(
:application
,
'Target'
,
:ios
)
configuration1
=
target1
.
build_configuration_list
.
build_configurations
.
first
target1
.
build_configuration_list
.
build_configurations
.
first
target1
.
build_configuration_list
.
set_setting
(
'SDKROOT'
,
'iphoneos'
)
target1
.
build_configuration_list
.
set_setting
(
'IPHONEOS_DEPLOYMENT_TARGET'
,
'4.0'
)
...
...
spec/unit/installer/file_references_installer_spec.rb
View file @
57d061c9
...
...
@@ -92,7 +92,7 @@ module Pod
pod_target_1
=
PodTarget
.
new
([],
nil
,
config
.
sandbox
)
pod_target_1
.
file_accessors
=
[]
installer
=
Installer
::
FileReferencesInstaller
.
new
(
config
.
sandbox
,
[
pod_target_1
],
@project
)
roots
=
installer
.
send
(
:file_accessors
).
should
==
[]
installer
.
send
(
:file_accessors
).
should
==
[]
end
end
...
...
spec/unit/installer/user_project_integrator_spec.rb
View file @
57d061c9
...
...
@@ -188,7 +188,7 @@ module Pod
it
'raises if no workspace could be selected'
do
@integrator
.
expects
(
:user_project_paths
).
returns
(
%w( project1 project2 )
)
e
=
lambda
{
@integrator
.
send
(
:workspace_path
)
}.
should
.
raise
Informative
lambda
{
@integrator
.
send
(
:workspace_path
)
}.
should
.
raise
Informative
end
it
'returns the paths of the user projects'
do
...
...
spec/unit/installer_spec.rb
View file @
57d061c9
...
...
@@ -14,7 +14,7 @@ end
# @return [Podfile]
#
def
generate_podfile
(
pods
=
[
'JSONKit'
])
podfile
=
Pod
::
Podfile
.
new
do
Pod
::
Podfile
.
new
do
platform
:ios
xcodeproj
SpecHelper
.
fixture
(
'SampleProject/SampleProject'
),
'Test'
=>
:debug
,
'App Store'
=>
:release
pods
.
each
{
|
name
|
pod
name
}
...
...
@@ -24,7 +24,7 @@ end
# @return [Podfile]
#
def
generate_local_podfile
podfile
=
Pod
::
Podfile
.
new
do
Pod
::
Podfile
.
new
do
platform
:ios
xcodeproj
SpecHelper
.
fixture
(
'SampleProject/SampleProject'
),
'Test'
=>
:debug
,
'App Store'
=>
:release
pod
'Reachability'
,
:path
=>
SpecHelper
.
fixture
(
'integration/Reachability'
)
...
...
@@ -494,7 +494,7 @@ module Pod
it
'saves the project to the given path'
do
Xcodeproj
::
Project
.
any_instance
.
stubs
(
:recreate_user_schemes
)
path
=
temporary_directory
+
'Pods/Pods.xcodeproj'
temporary_directory
+
'Pods/Pods.xcodeproj'
@installer
.
pods_project
.
expects
(
:save
)
@installer
.
send
(
:write_pod_project
)
end
...
...
@@ -601,8 +601,6 @@ module Pod
it
'runs the pre install hooks'
do
installer_rep
=
stub
pod_rep
=
stub
library_rep
=
stub
@installer
.
expects
(
:installer_rep
).
returns
(
installer_rep
)
@installer
.
podfile
.
expects
(
:pre_install!
).
with
(
installer_rep
)
...
...
@@ -611,7 +609,6 @@ module Pod
it
'run_podfile_post_install_hooks'
do
installer_rep
=
stub
target_installer_data
=
stub
@installer
.
expects
(
:installer_rep
).
returns
(
installer_rep
)
@installer
.
podfile
.
expects
(
:post_install!
).
with
(
installer_rep
)
...
...
@@ -623,9 +620,6 @@ module Pod
pod_target_osx
=
PodTarget
.
new
([
@spec
],
nil
,
config
.
sandbox
)
pod_target_ios
.
stubs
(
:name
).
returns
(
'label'
)
pod_target_osx
.
stubs
(
:name
).
returns
(
'label'
)
library_ios_rep
=
stub
library_osx_rep
=
stub
target_installer_data
=
stub
@installer
.
stubs
(
:pod_targets
).
returns
([
pod_target_ios
,
pod_target_osx
])
@installer
.
stubs
(
:installer_rep
).
returns
(
stub
)
...
...
spec/unit/project_spec.rb
View file @
57d061c9
...
...
@@ -42,14 +42,14 @@ module Pod
end
it
'adds the group for a development Pod'
do
path
=
config
.
sandbox
.
pod_dir
(
'BananaLib'
)
config
.
sandbox
.
pod_dir
(
'BananaLib'
)
group
=
@project
.
add_pod_group
(
'BananaLib'
,
@path
,
true
)
group
.
parent
.
should
==
@project
.
development_pods
group
.
name
.
should
==
'BananaLib'
end
it
'configures the path of a new Pod group'
do
path
=
config
.
sandbox
.
pod_dir
(
'BananaLib'
)
config
.
sandbox
.
pod_dir
(
'BananaLib'
)
group
=
@project
.
add_pod_group
(
'BananaLib'
,
@path
)
group
.
source_tree
.
should
==
'<group>'
group
.
path
.
should
==
'BananaLib'
...
...
@@ -57,7 +57,7 @@ module Pod
end
it
'configures the path of a new Pod group as absolute if requested'
do
path
=
config
.
sandbox
.
pod_dir
(
'BananaLib'
)
config
.
sandbox
.
pod_dir
(
'BananaLib'
)
group
=
@project
.
add_pod_group
(
'BananaLib'
,
@path
,
false
,
true
)
group
.
source_tree
.
should
==
'<absolute>'
group
.
path
.
should
==
@path
.
to_s
...
...
spec/unit/sources_manager_spec.rb
View file @
57d061c9
...
...
@@ -15,7 +15,7 @@ def set_up_test_repo_for_update
end
def
merge_conflict_version_yaml
text
=
<<-
VERSION
.
strip_heredoc
<<-
VERSION
.
strip_heredoc
---
<<<<<<< HEAD
min: 0.18.1
...
...
@@ -91,7 +91,7 @@ module Pod
Source
::
Aggregate
.
any_instance
.
expects
(
:generate_search_index
).
returns
(
'BananaLib'
=>
{})
Source
::
Aggregate
.
any_instance
.
expects
(
:update_search_index
).
never
SourcesManager
.
updated_search_index
=
nil
sets
=
SourcesManager
.
search_by_name
(
'BananaLib'
,
true
)
SourcesManager
.
search_by_name
(
'BananaLib'
,
true
)
end
it
'updates the search index before performing a search if it exits'
do
...
...
@@ -100,7 +100,7 @@ module Pod
Source
::
Aggregate
.
any_instance
.
expects
(
:generate_search_index
).
never
Source
::
Aggregate
.
any_instance
.
expects
(
:update_search_index
).
returns
(
'BananaLib'
=>
{})
SourcesManager
.
updated_search_index
=
nil
sets
=
SourcesManager
.
search_by_name
(
'BananaLib'
,
true
)
SourcesManager
.
search_by_name
(
'BananaLib'
,
true
)
end
it
'returns the path of the search index'
do
...
...
spec/unit/validator_spec.rb
View file @
57d061c9
...
...
@@ -298,7 +298,7 @@ module Pod
validator
.
expects
(
:podfile_from_spec
).
with
(
:osx
,
nil
,
nil
).
once
validator
.
expects
(
:podfile_from_spec
).
with
(
:ios
,
nil
,
nil
).
once
validator
.
expects
(
:podfile_from_spec
).
with
(
:ios
,
'7.0'
,
nil
).
once
podfile
=
validator
.
send
(
:perform_extensive_analysis
,
validator
.
spec
)
validator
.
send
(
:perform_extensive_analysis
,
validator
.
spec
)
end
describe
'#podfile_from_spec'
do
...
...
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