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
aef7ea0f
Commit
aef7ea0f
authored
Nov 09, 2011
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Install a library from a podspec defined on a dependency in a Podfile.
parent
ddc5ac50
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
34 additions
and
30 deletions
+34
-30
dependency.rb
lib/cocoapods/dependency.rb
+4
-9
downloader.rb
lib/cocoapods/downloader.rb
+2
-1
resolver.rb
lib/cocoapods/resolver.rb
+2
-2
specification.rb
lib/cocoapods/specification.rb
+1
-1
integration_spec.rb
spec/integration_spec.rb
+25
-0
dependency_spec.rb
spec/unit/dependency_spec.rb
+0
-14
podfile_spec.rb
spec/unit/podfile_spec.rb
+0
-3
No files found.
lib/cocoapods/dependency.rb
View file @
aef7ea0f
...
...
@@ -13,6 +13,7 @@ module Pod
def
initialize
(
*
name_and_version_requirements
,
&
block
)
if
name_and_version_requirements
.
empty?
&&
block
@inline_podspec
=
true
@specification
=
Specification
.
new
(
&
block
)
super
(
@specification
.
name
,
@specification
.
version
)
...
...
@@ -35,17 +36,11 @@ module Pod
(
@specification
?
@specification
==
other
.
specification
:
@external_spec_source
==
other
.
external_spec_source
)
end
def
external_podspec?
!
@external_spec_source
.
nil?
end
def
inline_podspec?
!
@specification
.
nil?
end
# In case this dependency was defined with either a repo url, :podspec, or block,
# this method will return the Specification instance.
def
specification
@specification
||=
begin
if
external_podspec?
if
@external_spec_source
pod_root
=
Config
.
instance
.
project_pods_root
+
@name
spec
=
nil
if
@external_spec_source
[
:podspec
]
...
...
lib/cocoapods/downloader.rb
View file @
aef7ea0f
...
...
@@ -20,6 +20,7 @@ module Pod
executable
:git
def
download
@pod_root
.
dirname
.
mkpath
if
@options
[
:tag
]
download_tag
elsif
@options
[
:commit
]
...
...
@@ -34,7 +35,7 @@ module Pod
end
def
download_tag
@pod_root
.
mk
dir
@pod_root
.
mk
path
Dir
.
chdir
(
@pod_root
)
do
git
"init"
git
"remote add origin '
#{
@url
}
'"
...
...
lib/cocoapods/resolver.rb
View file @
aef7ea0f
...
...
@@ -23,8 +23,8 @@ module Pod
end
def
find_dependency_set
(
dependency
)
if
dependency
.
external_podspec?
Specification
::
Set
::
External
.
new
(
dependency
.
specification
)
if
external_spec
=
dependency
.
specification
Specification
::
Set
::
External
.
new
(
external_spec
)
else
Source
.
search
(
dependency
)
end
...
...
lib/cocoapods/specification.rb
View file @
aef7ea0f
...
...
@@ -286,8 +286,8 @@ module Pod
# end
def
install!
puts
"==> Installing:
#{
self
}
"
unless
config
.
silent?
if
defined_in_file
&&
!
(
config
.
project_pods_root
+
defined_in_file
.
basename
).
exist?
config
.
project_pods_root
.
mkpath
unless
(
config
.
project_pods_root
+
defined_in_file
.
basename
).
exist?
FileUtils
.
cp
(
defined_in_file
,
config
.
project_pods_root
)
end
...
...
spec/integration_spec.rb
View file @
aef7ea0f
...
...
@@ -86,8 +86,32 @@ else
(
config
.
project_pods_root
+
'ASIHTTPRequest'
).
should
.
exist
end
it
"installs a library with a podspec defined inline"
do
podfile
=
Pod
::
Podfile
.
new
do
self
.
platform
:ios
dependency
do
|
s
|
s
.
name
=
'JSONKit'
s
.
version
=
'1.2'
s
.
source
=
{
:git
=>
'https://github.com/johnezang/JSONKit.git'
,
:tag
=>
'v1.2'
}
s
.
source_files
=
'JSONKit.*'
end
end
installer
=
SpecHelper
::
Installer
.
new
(
podfile
)
installer
.
install!
# TODO do we need the write out the podspec?
#spec = Pod::Spec.from_file(config.project_pods_root + 'JSONKit.podspec')
#spec.version.to_s.should == '1.2'
change_log
=
(
config
.
project_pods_root
+
'JSONKit/CHANGELOG.md'
).
read
change_log
.
should
.
include
'1.2'
change_log
.
should
.
not
.
include
'1.3'
end
end
if
false
before
do
FileUtils
.
cp_r
(
fixture
(
'integration/.'
),
config
.
project_pods_root
)
end
...
...
@@ -262,3 +286,4 @@ else
end
end
end
spec/unit/dependency_spec.rb
View file @
aef7ea0f
...
...
@@ -7,20 +7,6 @@ describe "Pod::Dependency" do
dep1
.
merge
(
dep2
).
should
==
Pod
::
Dependency
.
new
(
'bananas'
,
'>= 1.8'
,
'1.9'
)
end
it
"returns wether or not the spec for this pod is in a spec repo"
do
dep
=
Pod
::
Dependency
.
new
(
'bananas'
)
dep
.
should
.
not
.
be
.
external_podspec
dep
.
external_spec_source
=
{
:git
=>
'GIT-URL'
}
dep
.
should
.
be
.
external_podspec
end
it
"returns wether or not the spec for this pod is defined inline"
do
dep
=
Pod
::
Dependency
.
new
{
|
s
|
s
.
name
=
'bananas'
}
dep
.
should
.
be
.
inline_podspec
dep
.
specification
.
should
.
be
.
instance_of
Pod
::
Specification
dep
.
specification
.
name
.
should
==
'bananas'
end
it
"is equal to another dependency if `part_of_other_pod' is the same"
do
dep1
=
Pod
::
Dependency
.
new
(
'bananas'
,
'>= 1'
)
dep1
.
only_part_of_other_pod
=
true
...
...
spec/unit/podfile_spec.rb
View file @
aef7ea0f
...
...
@@ -23,7 +23,6 @@ describe "Pod::Podfile" do
dependency
'SomeExternalPod'
,
:git
=>
'GIT-URL'
,
:commit
=>
'1234'
end
dep
=
podfile
.
dependency_by_name
(
'SomeExternalPod'
)
dep
.
should
.
be
.
external_podspec
dep
.
external_spec_source
.
should
==
{
:git
=>
'GIT-URL'
,
:commit
=>
'1234'
}
end
...
...
@@ -32,7 +31,6 @@ describe "Pod::Podfile" do
dependency
'SomeExternalPod'
,
:podspec
=>
'http://gist/SomeExternalPod.podspec'
end
dep
=
podfile
.
dependency_by_name
(
'SomeExternalPod'
)
dep
.
should
.
be
.
external_podspec
dep
.
external_spec_source
.
should
==
{
:podspec
=>
'http://gist/SomeExternalPod.podspec'
}
end
...
...
@@ -43,7 +41,6 @@ describe "Pod::Podfile" do
end
end
dep
=
podfile
.
dependency_by_name
(
'SomeExternalPod'
)
dep
.
should
.
be
.
inline_podspec
dep
.
specification
.
name
.
should
==
'SomeExternalPod'
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