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
906346aa
Commit
906346aa
authored
Nov 08, 2011
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Install a Pod directly from its repo.
parent
fb7d8537
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
86 additions
and
4 deletions
+86
-4
.gitmodules
.gitmodules
+3
-0
dependency.rb
lib/cocoapods/dependency.rb
+11
-0
downloader.rb
lib/cocoapods/downloader.rb
+5
-1
resolver.rb
lib/cocoapods/resolver.rb
+5
-1
set.rb
lib/cocoapods/specification/set.rb
+34
-0
sstoolkit
spec/fixtures/integration/sstoolkit
+1
-0
integration_spec.rb
spec/integration_spec.rb
+27
-2
No files found.
.gitmodules
View file @
906346aa
...
...
@@ -10,3 +10,6 @@
[submodule "spec/fixtures/spec-repos/master"]
path = spec/fixtures/spec-repos/master
url = git://github.com/alloy/cocoapods-specs.git
[submodule "spec/fixtures/integration/sstoolkit"]
path = spec/fixtures/integration/sstoolkit
url = https://github.com/samsoffes/sstoolkit.git
lib/cocoapods/dependency.rb
View file @
906346aa
...
...
@@ -44,6 +44,17 @@ module Pod
!
@specification
.
nil?
end
def
specification
@specification
||=
begin
# This is an external podspec
pod_root
=
Config
.
instance
.
project_pods_root
+
@name
downloader
=
Downloader
.
for_source
(
pod_root
,
@external_spec_source
)
downloader
.
download
file
=
pod_root
+
"
#{
@name
}
.podspec"
Specification
.
from_file
(
file
)
end
end
# Taken from a newer version of RubyGems
unless
public_method_defined?
(
:merge
)
def
merge
other
...
...
lib/cocoapods/downloader.rb
View file @
906346aa
...
...
@@ -25,10 +25,14 @@ module Pod
elsif
@options
[
:commit
]
download_commit
else
raise
"Either a tag or a commit has to be specified."
download_head
end
end
def
download_head
git
"clone '
#{
@url
}
' '
#{
@pod_root
}
'"
end
def
download_tag
@pod_root
.
mkdir
Dir
.
chdir
(
@pod_root
)
do
...
...
lib/cocoapods/resolver.rb
View file @
906346aa
...
...
@@ -23,7 +23,11 @@ module Pod
end
def
find_dependency_set
(
dependency
)
Source
.
search
(
dependency
)
if
dependency
.
external_podspec?
Specification
::
Set
::
External
.
new
(
dependency
.
specification
)
else
Source
.
search
(
dependency
)
end
end
def
validate_platform!
(
set
)
...
...
lib/cocoapods/specification/set.rb
View file @
906346aa
...
...
@@ -81,6 +81,40 @@ module Pod
Version
.
new
(
basename
)
if
v
.
directory?
&&
basename
[
0
,
1
]
!=
'.'
end
.
compact
.
sort
.
reverse
end
class
External
<
Set
def
initialize
(
specification
)
@specification
=
specification
@required_by
=
[]
end
def
name
@specification
.
name
end
def
required_by
(
specification
)
before
=
@specification
super
(
specification
)
ensure
@specification
=
before
end
def
only_part_of_other_pod?
false
end
def
specification_path
raise
"specification_path"
end
def
specification
@specification
end
def
versions
[
@specification
.
version
]
end
end
end
end
end
sstoolkit
@
2adcd0f8
Subproject commit 2adcd0f81740d6b0cd4589af98790eee3bd1ae7b
spec/integration_spec.rb
View file @
906346aa
...
...
@@ -38,8 +38,6 @@ else
config
.
silent
=
true
config
.
repos_dir
=
fixture
(
'spec-repos'
)
config
.
project_pods_root
=
temporary_directory
+
'Pods'
FileUtils
.
cp_r
(
fixture
(
'integration/.'
),
config
.
project_pods_root
)
end
after
do
...
...
@@ -52,6 +50,32 @@ else
$?
.
should
.
be
.
success
end
# Lame way to run on one platform only
if
platform
==
:ios
it
"installs a Pod directly from its repo"
do
url
=
fixture
(
'integration/sstoolkit'
).
to_s
podfile
=
Pod
::
Podfile
.
new
do
self
.
platform
:ios
dependency
'SSToolkit'
,
:git
=>
url
,
:commit
=>
'2adcd0f81740d6b0cd4589af98790eee3bd1ae7b'
end
# Note that we are *not* using the stubbed SpecHelper::Installer subclass.
installer
=
Pod
::
Installer
.
new
(
podfile
)
installer
.
install!
spec
=
Pod
::
Spec
.
from_file
(
config
.
project_pods_root
+
'SSToolkit.podspec'
)
spec
.
version
.
to_s
.
should
==
'0.1.3'
Dir
.
chdir
(
config
.
project_pods_root
+
'SSToolkit'
)
do
`git config --get remote.origin.url`
.
strip
.
should
==
url
end
end
end
before
do
FileUtils
.
cp_r
(
fixture
(
'integration/.'
),
config
.
project_pods_root
)
end
# TODO add a simple source file which uses the compiled lib to check that it really really works
it
"should activate required pods and create a working static library xcode project"
do
spec
=
Pod
::
Podfile
.
new
do
...
...
@@ -220,4 +244,5 @@ else
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