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
04843c3d
Commit
04843c3d
authored
Mar 30, 2012
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make specs green.
parent
fcdd011c
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
41 additions
and
31 deletions
+41
-31
installer.rb
lib/cocoapods/installer.rb
+15
-15
local_pod.rb
lib/cocoapods/local_pod.rb
+1
-2
platform.rb
lib/cocoapods/platform.rb
+8
-0
specification.rb
lib/cocoapods/specification.rb
+1
-1
command_spec.rb
spec/functional/command_spec.rb
+1
-1
downloader_spec.rb
spec/functional/downloader_spec.rb
+1
-1
integration_spec.rb
spec/integration_spec.rb
+2
-2
downloader_spec.rb
spec/unit/downloader_spec.rb
+2
-2
documentation_spec.rb
spec/unit/generator/documentation_spec.rb
+1
-1
installer_spec.rb
spec/unit/installer_spec.rb
+2
-4
platform_spec.rb
spec/unit/platform_spec.rb
+7
-2
No files found.
lib/cocoapods/installer.rb
View file @
04843c3d
...
...
@@ -21,13 +21,10 @@ module Pod
def
project
return
@project
if
@project
@project
=
Pod
::
Project
.
for_platform
(
@podfile
.
platform
)
# First we need to resolve dependencies across *all* targets, so that the
# same correct versions of pods are being used for all targets. This
# happens when we call `activated_specifications'.
activated_specifications
.
each
do
|
spec
|
activated_pods
.
each
do
|
pod
|
# Add all source files to the project grouped by pod
group
=
@project
.
add_pod_group
(
spec
.
name
)
spec
.
expanded_
source_files
.
each
do
|
path
|
group
=
@project
.
add_pod_group
(
pod
.
name
)
pod
.
source_files
.
each
do
|
path
|
group
.
files
.
new
(
'path'
=>
path
.
to_s
)
end
end
...
...
@@ -43,14 +40,10 @@ module Pod
end
def
install_dependencies!
activated_specifications
.
map
do
|
spec
|
# TODO @podfile.platform will change to target_definition.platform
LocalPod
.
new
(
spec
,
sandbox
,
@podfile
.
platform
).
tap
do
|
pod
|
activated_pods
.
each
do
|
pod
|
marker
=
config
.
verbose
?
"
\n
-> "
.
green
:
''
should_install
=
!
pod
.
exists?
&&
!
spec
.
local?
unless
should_install
unless
should_install
=
!
pod
.
exists?
&&
!
pod
.
specification
.
local?
puts
marker
+
"Using
#{
pod
}
"
unless
config
.
silent?
else
puts
marker
+
"Installing
#{
spec
}
"
.
green
unless
config
.
silent?
...
...
@@ -70,7 +63,6 @@ module Pod
end
end
end
end
def
install!
@sandbox
.
prepare_for_install
...
...
@@ -79,8 +71,9 @@ module Pod
specs_by_target
puts_title
"Installing dependencies"
pods
=
install_dependencies!
install_dependencies!
pods
=
activated_pods
puts_title
(
"Generating support files
\n
"
,
false
)
target_installers
.
each
do
|
target_installer
|
target_specs
=
activated_specifications_for_target
(
target_installer
.
target_definition
)
...
...
@@ -117,7 +110,7 @@ module Pod
file
.
puts
"PODS:"
pods
.
map
do
|
pod
|
# TODO this should list _all_ the pods, so merge the platforms
dependencies
=
pod
.
specification
.
dependencies
.
values
.
flatten
.
uniq
dependencies
=
pod
.
specification
.
dependencies
[
@podfile
.
platform
.
to_sym
]
[
pod
.
specification
.
to_s
,
dependencies
.
map
(
&
:to_s
).
sort
]
end
.
sort_by
(
&
:first
).
each
do
|
name
,
deps
|
if
deps
.
empty?
...
...
@@ -152,6 +145,13 @@ module Pod
specs_by_target
.
values
.
flatten
end
def
activated_pods
activated_specifications
.
map
do
|
spec
|
# TODO @podfile.platform will change to target_definition.platform
LocalPod
.
new
(
spec
,
sandbox
,
@podfile
.
platform
)
end
end
def
activated_specifications
dependency_specifications
.
reject
do
|
spec
|
# Don't activate specs which are only wrappers of subspecs, or share
...
...
lib/cocoapods/local_pod.rb
View file @
04843c3d
...
...
@@ -77,7 +77,7 @@ module Pod
def
add_to_target
(
target
)
implementation_files
.
each
do
|
file
|
target
.
add_source_file
(
file
,
nil
,
specification
.
compiler_flags
[
@platform
.
to_sym
])
target
.
add_source_file
(
file
,
nil
,
specification
.
compiler_flags
[
@platform
.
to_sym
]
.
strip
)
end
end
...
...
@@ -108,7 +108,6 @@ module Pod
def
expanded_paths
(
platforms_with_patterns
,
options
=
{})
patterns
=
platforms_with_patterns
.
is_a?
(
Hash
)
?
(
platforms_with_patterns
[
@platform
.
to_sym
]
||
[])
:
platforms_with_patterns
p
platforms_with_patterns
if
patterns
.
nil?
patterns
.
map
do
|
pattern
|
pattern
=
root
+
pattern
...
...
lib/cocoapods/platform.rb
View file @
04843c3d
module
Pod
class
Platform
def
self
.
ios
new
:ios
end
def
self
.
osx
new
:osx
end
attr_reader
:options
def
initialize
(
symbolic_name
,
options
=
{})
...
...
lib/cocoapods/specification.rb
View file @
04843c3d
...
...
@@ -235,7 +235,7 @@ module Pod
end
def
wrapper?
source_files
.
values
.
flatten
.
empty?
&&
!
subspecs
.
empty?
source_files
.
values
.
all?
(
&
:empty?
)
&&
!
subspecs
.
empty?
end
def
subspec_by_name
(
name
)
...
...
spec/functional/command_spec.rb
View file @
04843c3d
...
...
@@ -60,7 +60,7 @@ describe "Pod::Command" do
spec
.
authors
.
should
==
{
`git config --get user.name`
.
strip
=>
`git config --get user.email`
.
strip
,
"other author"
=>
"and email address"
}
spec
.
source
.
should
==
{
:git
=>
'http://EXAMPLE/Bananas.git'
,
:tag
=>
'1.0.0'
}
spec
.
description
.
should
==
'An optional longer description of Bananas.'
spec
.
source_files
.
should
==
[
'Classes'
,
'Classes/**/*.{h,m}'
]
spec
.
source_files
[
:ios
]
.
should
==
[
'Classes'
,
'Classes/**/*.{h,m}'
]
end
before
do
...
...
spec/functional/downloader_spec.rb
View file @
04843c3d
...
...
@@ -2,7 +2,7 @@ require File.expand_path('../../spec_helper', __FILE__)
describe
"Pod::Downloader"
do
before
do
@pod
=
Pod
::
LocalPod
.
new
(
fixture_spec
(
'banana-lib/BananaLib.podspec'
),
temporary_sandbox
)
@pod
=
Pod
::
LocalPod
.
new
(
fixture_spec
(
'banana-lib/BananaLib.podspec'
),
temporary_sandbox
,
Pod
::
Platform
.
ios
)
end
describe
"for Git"
do
...
...
spec/integration_spec.rb
View file @
04843c3d
...
...
@@ -184,7 +184,7 @@ else
# TODO add a simple source file which uses the compiled lib to check that it really really works
it
"activates required pods and create a working static library xcode project"
do
spec
=
Pod
::
Podfile
.
new
do
podfile
=
Pod
::
Podfile
.
new
do
# first ensure that the correct info is available to the specs when they load
config
.
rootspec
=
self
...
...
@@ -195,7 +195,7 @@ else
dependency
'SSZipArchive'
,
'< 2'
end
installer
=
SpecHelper
::
Installer
.
new
(
spec
)
installer
=
SpecHelper
::
Installer
.
new
(
podfile
)
installer
.
install!
lock_file_contents
=
{
...
...
spec/unit/downloader_spec.rb
View file @
04843c3d
...
...
@@ -13,7 +13,7 @@ end
describe
"Pod::Downloader"
do
it
"returns a git downloader with parsed options"
do
pod
=
Pod
::
LocalPod
.
new
(
fixture_spec
(
'banana-lib/BananaLib.podspec'
),
temporary_sandbox
)
pod
=
Pod
::
LocalPod
.
new
(
fixture_spec
(
'banana-lib/BananaLib.podspec'
),
temporary_sandbox
,
Pod
::
Platform
.
ios
)
downloader
=
Pod
::
Downloader
.
for_pod
(
pod
)
downloader
.
should
.
be
.
instance_of
Pod
::
Downloader
::
Git
downloader
.
url
.
should
==
'http://banana-corp.local/banana-lib.git'
...
...
@@ -21,7 +21,7 @@ describe "Pod::Downloader" do
end
it
'returns a github downloader when the :git URL is on github'
do
pod
=
Pod
::
LocalPod
.
new
(
fixture_spec
(
'banana-lib/BananaLib.podspec'
),
temporary_sandbox
)
pod
=
Pod
::
LocalPod
.
new
(
fixture_spec
(
'banana-lib/BananaLib.podspec'
),
temporary_sandbox
,
Pod
::
Platform
.
ios
)
pod
.
specification
.
stubs
(
:source
).
returns
(
:git
=>
"git://github.com/CocoaPods/CocoaPods"
)
downloader
=
Pod
::
Downloader
.
for_pod
(
pod
)
downloader
.
should
.
be
.
instance_of
Pod
::
Downloader
::
GitHub
...
...
spec/unit/generator/documentation_spec.rb
View file @
04843c3d
...
...
@@ -3,7 +3,7 @@ require File.expand_path('../../../spec_helper', __FILE__)
describe
Pod
::
Generator
::
Documentation
do
before
do
@sandbox
=
temporary_sandbox
@pod
=
Pod
::
LocalPod
.
new
(
fixture_spec
(
'banana-lib/BananaLib.podspec'
),
@sandbox
)
@pod
=
Pod
::
LocalPod
.
new
(
fixture_spec
(
'banana-lib/BananaLib.podspec'
),
@sandbox
,
Pod
::
Platform
.
ios
)
copy_fixture_to_pod
(
'banana-lib'
,
@pod
)
@doc_installer
=
Pod
::
Generator
::
Documentation
.
new
(
@pod
)
end
...
...
spec/unit/installer_spec.rb
View file @
04843c3d
...
...
@@ -36,14 +36,12 @@ describe "Pod::Installer" do
dependency
'ASIHTTPRequest'
end
config
.
rootspec
=
podfile
expected
=
[]
installer
=
Pod
::
Installer
.
new
(
podfile
)
pods
=
installer
.
activated_specifications
.
map
do
|
spec
|
spec
.
header_files
[
:ios
].
each
do
|
header
|
expected
<<
config
.
project_pods_root
+
header
end
Pod
::
LocalPod
.
new
(
spec
,
installer
.
sandbox
,
podfile
.
platform
)
end
expected
=
pods
.
map
{
|
pod
|
pod
.
header_files
}.
flatten
.
map
{
|
header
|
config
.
project_pods_root
+
header
}
expected
.
size
.
should
>
0
installer
.
target_installers
.
first
.
bridge_support_generator_for
(
pods
,
installer
.
sandbox
).
headers
.
should
==
expected
end
...
...
spec/unit/platform_spec.rb
View file @
04843c3d
require
File
.
expand_path
(
'../../spec_helper'
,
__FILE__
)
describe
"Pod::Platform"
do
describe
Pod
::
Platform
do
it
"returns a new Platform instance"
do
Pod
::
Platform
.
ios
.
should
==
Pod
::
Platform
.
new
(
:ios
)
Pod
::
Platform
.
osx
.
should
==
Pod
::
Platform
.
new
(
:osx
)
end
before
do
@platform
=
Pod
::
Platform
.
new
(
:ios
)
@platform
=
Pod
::
Platform
.
ios
end
it
"exposes it's symbolic name"
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