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
55d5c919
Commit
55d5c919
authored
Nov 09, 2011
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Install a library with a podspec from another source. Can be file, http, ftp.
parent
906346aa
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
6 deletions
+33
-6
dependency.rb
lib/cocoapods/dependency.rb
+14
-4
specification.rb
lib/cocoapods/specification.rb
+3
-2
integration_spec.rb
spec/integration_spec.rb
+16
-0
No files found.
lib/cocoapods/dependency.rb
View file @
55d5c919
...
@@ -48,10 +48,20 @@ module Pod
...
@@ -48,10 +48,20 @@ module Pod
@specification
||=
begin
@specification
||=
begin
# This is an external podspec
# This is an external podspec
pod_root
=
Config
.
instance
.
project_pods_root
+
@name
pod_root
=
Config
.
instance
.
project_pods_root
+
@name
downloader
=
Downloader
.
for_source
(
pod_root
,
@external_spec_source
)
spec
=
nil
downloader
.
download
if
@external_spec_source
[
:podspec
]
file
=
pod_root
+
"
#{
@name
}
.podspec"
Config
.
instance
.
project_pods_root
.
mkdir
Specification
.
from_file
(
file
)
spec
=
Config
.
instance
.
project_pods_root
+
"
#{
@name
}
.podspec"
# can be http, file, etc
require
'open-uri'
open
(
@external_spec_source
[
:podspec
])
do
|
io
|
spec
.
open
(
'w'
)
{
|
f
|
f
<<
io
.
read
}
end
else
Downloader
.
for_source
(
pod_root
,
@external_spec_source
).
download
spec
=
pod_root
+
"
#{
@name
}
.podspec"
end
Specification
.
from_file
(
spec
)
end
end
end
end
...
...
lib/cocoapods/specification.rb
View file @
55d5c919
...
@@ -287,8 +287,9 @@ module Pod
...
@@ -287,8 +287,9 @@ module Pod
def
install!
def
install!
puts
"==> Installing:
#{
self
}
"
unless
config
.
silent?
puts
"==> Installing:
#{
self
}
"
unless
config
.
silent?
config
.
project_pods_root
.
mkpath
config
.
project_pods_root
.
mkpath
require
'fileutils'
unless
(
config
.
project_pods_root
+
defined_in_file
.
basename
).
exist?
FileUtils
.
cp
(
defined_in_file
,
config
.
project_pods_root
)
FileUtils
.
cp
(
defined_in_file
,
config
.
project_pods_root
)
end
# In case this spec is part of another pod's source, we need to dowload
# In case this spec is part of another pod's source, we need to dowload
# the other pod's source.
# the other pod's source.
...
...
spec/integration_spec.rb
View file @
55d5c919
...
@@ -70,6 +70,22 @@ else
...
@@ -70,6 +70,22 @@ else
`git config --get remote.origin.url`
.
strip
.
should
==
url
`git config --get remote.origin.url`
.
strip
.
should
==
url
end
end
end
end
it
"installs a library with a podspec outside of the repo"
do
podfile
=
Pod
::
Podfile
.
new
do
self
.
platform
:ios
# TODO use a local file instead of http?
dependency
'Reachability'
,
:podspec
=>
'https://raw.github.com/gist/1349824/3ec6aa60c19113573fc48eac19d0fafd6a69e033/Reachability.podspec'
end
installer
=
SpecHelper
::
Installer
.
new
(
podfile
)
installer
.
install!
spec
=
Pod
::
Spec
.
from_file
(
config
.
project_pods_root
+
'Reachability.podspec'
)
spec
.
version
.
to_s
.
should
==
'1.2.3'
(
config
.
project_pods_root
+
'ASIHTTPRequest'
).
should
.
exist
end
end
end
before
do
before
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