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
2e7b9245
Commit
2e7b9245
authored
Aug 05, 2013
by
Ian Ynda-Hummel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move templates into a separate templates directory.
parent
01015ec8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
13 deletions
+25
-13
config.rb
lib/cocoapods/config.rb
+8
-2
init_spec.rb
spec/functional/command/init_spec.rb
+9
-9
config_spec.rb
spec/unit/config_spec.rb
+8
-2
No files found.
lib/cocoapods/config.rb
View file @
2e7b9245
...
...
@@ -147,6 +147,12 @@ module Pod
attr_writer
:repos_dir
# @return [Pathname] the directory where the CocoaPods templates are stored.
#
def
templates_dir
@templates_dir
||=
Pathname
.
new
(
ENV
[
'CP_TEMPLATES_DIR'
]
||
"~/.cocoapods/templates"
).
expand_path
end
# @return [Pathname] the root of the CocoaPods installation where the
# Podfile is located.
#
...
...
@@ -230,7 +236,7 @@ module Pod
# @return [Pathname]
#
def
default_podfile_path
@default_podfile_path
||=
repo
s_dir
+
"default.podfile"
@default_podfile_path
||=
template
s_dir
+
"default.podfile"
end
# Returns the path of the default Podfile test pods.
...
...
@@ -240,7 +246,7 @@ module Pod
# @return [Pathname]
#
def
default_test_podfile_path
@default_test_podfile_path
||=
repo
s_dir
+
"test.podfile"
@default_test_podfile_path
||=
template
s_dir
+
"test.podfile"
end
# @return [Pathname] The file to use a cache of the statistics provider.
...
...
spec/functional/command/init_spec.rb
View file @
2e7b9245
...
...
@@ -67,9 +67,9 @@ module Pod
it
"includes default pods in a Podfile"
do
Dir
.
chdir
(
temporary_directory
)
do
tmp_
repos_dir
=
Pathname
.
pwd
+
'repo
s_dir'
tmp_
repo
s_dir
.
mkpath
config
.
repos_dir
=
tmp_repos_dir
tmp_
templates_dir
=
Pathname
.
pwd
+
'template
s_dir'
tmp_
template
s_dir
.
mkpath
config
.
stubs
(
:templates_dir
).
returns
(
tmp_templates_dir
)
open
(
config
.
default_podfile_path
,
'w'
)
{
|
f
|
f
<<
"pod 'AFNetworking'"
}
...
...
@@ -85,9 +85,9 @@ module Pod
it
"includes default test pods in test targets in a Podfile"
do
Dir
.
chdir
(
temporary_directory
)
do
tmp_
repos_dir
=
Pathname
.
pwd
+
'repo
_dir'
tmp_
repo
s_dir
.
mkpath
config
.
repos_dir
=
tmp_repos_dir
tmp_
templates_dir
=
Pathname
.
pwd
+
'templates
_dir'
tmp_
template
s_dir
.
mkpath
config
.
stubs
(
:templates_dir
).
returns
(
tmp_templates_dir
)
open
(
config
.
default_test_podfile_path
,
'w'
)
{
|
f
|
f
<<
"pod 'Kiwi'"
}
...
...
@@ -105,9 +105,9 @@ module Pod
it
"does not include default test pods if there are no test targets"
do
Dir
.
chdir
(
temporary_directory
)
do
tmp_
repos_dir
=
Pathname
.
pwd
+
'repo
_dir'
tmp_
repo
s_dir
.
mkpath
config
.
repos_dir
=
tmp_repos_dir
tmp_
templates_dir
=
Pathname
.
pwd
+
'templates
_dir'
tmp_
template
s_dir
.
mkpath
config
.
stubs
(
:templates_dir
).
returns
(
tmp_templates_dir
)
open
(
config
.
default_test_podfile_path
,
'w'
)
{
|
f
|
f
<<
"pod 'Kiwi'"
}
...
...
spec/unit/config_spec.rb
View file @
2e7b9245
...
...
@@ -21,9 +21,15 @@ module Pod
it
"returns the path to the spec-repos dir"
do
@sut
.
repos_dir
.
should
==
Pathname
.
new
(
"~/.cocoapods/repos"
).
expand_path
end
it
"returns the path to the templates dir"
do
@sut
.
templates_dir
.
should
==
Pathname
.
new
(
"~/.cocoapods/templates"
).
expand_path
end
it
"returns the path of the default podfiles"
do
config
.
default_podfile_path
.
should
==
Pathname
.
new
(
"~/.cocoapod
s/default.podfile"
).
expand_path
config
.
default_test_podfile_path
.
should
==
Pathname
.
new
(
"~/.cocoapod
s/test.podfile"
).
expand_path
@sut
.
default_podfile_path
.
should
==
Pathname
.
new
(
"~/.cocoapods/template
s/default.podfile"
).
expand_path
@sut
.
default_test_podfile_path
.
should
==
Pathname
.
new
(
"~/.cocoapods/template
s/test.podfile"
).
expand_path
end
it
"allows to specify whether the aggressive cache should be used with an environment variable"
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