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
de7fe36f
Commit
de7fe36f
authored
Sep 15, 2011
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+ source spec
parent
2e893d13
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
81 additions
and
31 deletions
+81
-31
.gitignore
.gitignore
+1
-1
source.rb
lib/cocoa_pods/source.rb
+1
-1
set.rb
lib/cocoa_pods/specification/set.rb
+2
-0
master-spec-repo.git.tar.gz
spec/fixtures/master-spec-repo.git.tar.gz
+0
-0
command_spec.rb
spec/functional/command_spec.rb
+15
-28
git.rb
spec/spec_helper/git.rb
+21
-1
installer_spec.rb
spec/unit/installer_spec.rb
+18
-0
source_spec.rb
spec/unit/source_spec.rb
+23
-0
No files found.
.gitignore
View file @
de7fe36f
...
...
@@ -4,4 +4,4 @@
tmp
examples/Pods
spec/fixtures/banana-lib
spec/fixtures/
master-spec-repo.git
spec/fixtures/
spec-repos/master
lib/cocoa_pods/source.rb
View file @
de7fe36f
...
...
@@ -5,7 +5,7 @@ module Pod
end
def
self
.
search
(
dependency
)
all
.
map
{
|
source
|
source
.
search
(
dependency
)
}.
compact
all
.
map
{
|
source
|
source
.
search
(
dependency
)
}.
compact
.
first
end
attr_reader
:repo
...
...
lib/cocoa_pods/specification/set.rb
View file @
de7fe36f
...
...
@@ -17,6 +17,8 @@ module Pod
sets
[
set
.
name
]
end
attr_reader
:pod_dir
def
initialize
(
pod_dir
)
@pod_dir
=
pod_dir
@required_by
=
[]
...
...
spec/fixtures/master-spec-repo.git.tar.gz
deleted
100644 → 0
View file @
2e893d13
File deleted
spec/functional/command_spec.rb
View file @
de7fe36f
...
...
@@ -2,52 +2,39 @@ require File.expand_path('../../spec_helper', __FILE__)
describe
"Pod::Command"
do
extend
SpecHelper
::
Git
extend
SpecHelper
::
Log
extend
SpecHelper
::
TemporaryDirectory
before
do
fixture
(
'
master-spec-repo.git
'
)
# ensure the archive is unpacked
fixture
(
'
spec-repos/master
'
)
# ensure the archive is unpacked
end
it
"creates the local spec-repos directory and creates a clone of the `master' repo"
do
command
=
Pod
::
Command
.
parse
(
'setup'
)
def
command
.
master_repo_url
;
SpecHelper
.
fixture
(
'
master-spec-repo.git
'
);
end
def
command
.
master_repo_url
;
SpecHelper
.
fixture
(
'
spec-repos/master
'
);
end
command
.
run
git_config
(
'master'
,
'remote.origin.url'
).
should
==
fixture
(
'master-spec-repo.git'
).
to_s
end
def
command
(
*
argv
)
command
=
Pod
::
Command
.
parse
(
*
argv
)
command
.
run
command
git_config
(
'master'
,
'remote.origin.url'
).
should
==
fixture
(
'spec-repos/master'
).
to_s
end
it
"adds a spec-repo"
do
command
(
'repo'
,
'add'
,
'private'
,
fixture
(
'master-spec-repo.git
'
))
git_config
(
'private'
,
'remote.origin.url'
).
should
==
fixture
(
'
master-spec-repo.git
'
).
to_s
add_repo
(
'private'
,
fixture
(
'spec-repos/master
'
))
git_config
(
'private'
,
'remote.origin.url'
).
should
==
fixture
(
'
spec-repos/master
'
).
to_s
end
it
"updates a spec-repo"
do
repo1
=
command
(
'repo'
,
'add'
,
'repo1'
,
fixture
(
'master-spec-repo.git'
))
repo2
=
command
(
'repo'
,
'add'
,
'repo2'
,
repo1
.
dir
)
(
repo1
.
dir
+
'README'
).
open
(
'a'
)
{
|
f
|
f
<<
'updated!'
}
git
(
'repo1'
,
'commit -a -m "update"'
)
repo1
=
add_repo
(
'repo1'
,
fixture
(
'spec-repos/master'
))
repo2
=
add_repo
(
'repo2'
,
repo1
.
dir
)
make_change
(
repo1
,
'repo1'
)
command
(
'repo'
,
'update'
,
'repo2'
)
(
repo2
.
dir
+
'README'
).
read
.
should
.
include
'
updat
ed!'
(
repo2
.
dir
+
'README'
).
read
.
should
.
include
'
Add
ed!'
end
it
"updates all the spec-repos"
do
repo1
=
command
(
'repo'
,
'add'
,
'repo1'
,
fixture
(
'master-spec-repo.git'
))
repo2
=
command
(
'repo'
,
'add'
,
'repo2'
,
repo1
.
dir
)
repo3
=
command
(
'repo'
,
'add'
,
'repo3'
,
repo1
.
dir
)
(
repo1
.
dir
+
'README'
).
open
(
'a'
)
{
|
f
|
f
<<
'updated!'
}
git
(
'repo1'
,
'commit -a -m "update"'
)
repo1
=
add_repo
(
'repo1'
,
fixture
(
'spec-repos/master'
))
repo2
=
add_repo
(
'repo2'
,
repo1
.
dir
)
repo3
=
add_repo
(
'repo3'
,
repo1
.
dir
)
make_change
(
repo1
,
'repo1'
)
command
(
'repo'
,
'update'
)
(
repo2
.
dir
+
'README'
).
read
.
should
.
include
'
updat
ed!'
(
repo3
.
dir
+
'README'
).
read
.
should
.
include
'
updat
ed!'
(
repo2
.
dir
+
'README'
).
read
.
should
.
include
'
Add
ed!'
(
repo3
.
dir
+
'README'
).
read
.
should
.
include
'
Add
ed!'
end
end
spec/spec_helper/git.rb
View file @
de7fe36f
...
...
@@ -21,11 +21,31 @@ module SpecHelper
alias_method
:git_super
,
:git
def
git
(
repo
,
command
)
Dir
.
chdir
(
tmp_repos_path
+
repo
)
{
git_super
(
command
).
strip
}
Dir
.
chdir
(
tmp_repos_path
+
repo
)
do
if
output
=
git_super
(
command
)
output
.
strip
end
end
end
def
git_config
(
repo
,
attr
)
git
repo
,
"config --get
#{
attr
}
"
end
def
command
(
*
argv
)
command
=
Pod
::
Command
.
parse
(
*
argv
)
command
.
run
command
end
def
add_repo
(
name
,
from
)
command
(
'repo'
,
'add'
,
name
,
from
)
end
def
make_change
(
repo
,
name
)
(
repo
.
dir
+
'README'
).
open
(
'w'
)
{
|
f
|
f
<<
'Added!'
}
git
(
name
,
'add README'
)
git
(
name
,
'commit -m "changed"'
)
end
end
end
spec/unit/installer_spec.rb
0 → 100644
View file @
de7fe36f
require
File
.
expand_path
(
'../../spec_helper'
,
__FILE__
)
describe
"Pod::Installer"
do
before
do
config
.
repos_dir
=
fixture
(
'spec-repos/master'
)
@spec
=
Pod
::
Spec
.
new
do
dependency
'SSZipArchive'
end
end
after
do
config
.
repos_dir
=
SpecHelper
.
tmp_repos_path
end
it
""
do
end
end
spec/unit/source_spec.rb
0 → 100644
View file @
de7fe36f
require
File
.
expand_path
(
'../../spec_helper'
,
__FILE__
)
describe
"Pod::Source"
do
extend
SpecHelper
::
Git
extend
SpecHelper
::
TemporaryDirectory
before
do
add_repo
(
'repo1'
,
fixture
(
'spec-repos/master'
))
(
config
.
repos_dir
+
'repo1/JSONKit'
).
rmtree
add_repo
(
'repo2'
,
fixture
(
'spec-repos/master'
))
(
config
.
repos_dir
+
'repo2/Reachability'
).
rmtree
end
it
"returns a specification set by name from any spec repo"
do
set
=
Pod
::
Source
.
search
(
Pod
::
Dependency
.
new
(
'Reachability'
))
set
.
should
.
be
.
instance_of
Pod
::
Specification
::
Set
set
.
pod_dir
.
should
==
config
.
repos_dir
+
'repo1/Reachability'
set
=
Pod
::
Source
.
search
(
Pod
::
Dependency
.
new
(
'JSONKit'
))
set
.
should
.
be
.
instance_of
Pod
::
Specification
::
Set
set
.
pod_dir
.
should
==
config
.
repos_dir
+
'repo2/JSONKit'
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