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
57fb7838
Commit
57fb7838
authored
Feb 19, 2013
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove old todos
parent
1546afe6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
65 deletions
+57
-65
spec.rb
lib/cocoapods/command/spec.rb
+56
-58
copy_resources_script.rb
lib/cocoapods/generator/copy_resources_script.rb
+1
-1
xcconfig.rb
lib/cocoapods/generator/xcconfig.rb
+0
-1
file_references_installer.rb
lib/cocoapods/installer/file_references_installer.rb
+0
-3
integration_spec.rb
spec/integration_spec.rb
+0
-2
No files found.
lib/cocoapods/command/spec.rb
View file @
57fb7838
...
@@ -155,7 +155,7 @@ module Pod
...
@@ -155,7 +155,7 @@ module Pod
DESC
DESC
self
.
arguments
=
'[ NAME ]'
self
.
arguments
=
'[ NAME ]'
def
self
.
options
def
self
.
options
[[
"--show-all"
,
"Pick from all versions of the given podspec"
]].
concat
(
super
)
[[
"--show-all"
,
"Pick from all versions of the given podspec"
]].
concat
(
super
)
end
end
...
@@ -186,20 +186,20 @@ module Pod
...
@@ -186,20 +186,20 @@ module Pod
end
end
#-----------------------------------------------------------------------#
#-----------------------------------------------------------------------#
class
Edit
<
Spec
class
Edit
<
Spec
self
.
summary
=
'Edit a spec file.'
self
.
summary
=
'Edit a spec file.'
self
.
description
=
<<-
DESC
self
.
description
=
<<-
DESC
Opens 'NAME.podspec' to be edited.
Opens 'NAME.podspec' to be edited.
DESC
DESC
self
.
arguments
=
'[ NAME ]'
self
.
arguments
=
'[ NAME ]'
def
self
.
options
def
self
.
options
[[
"--show-all"
,
"Pick which spec to edit from all avaliable versions of the given podspec"
]].
concat
(
super
)
[[
"--show-all"
,
"Pick which spec to edit from all avaliable versions of the given podspec"
]].
concat
(
super
)
end
end
def
initialize
(
argv
)
def
initialize
(
argv
)
@show_all
=
argv
.
flag?
(
'show-all'
)
@show_all
=
argv
.
flag?
(
'show-all'
)
@spec
=
argv
.
shift_argument
@spec
=
argv
.
shift_argument
...
@@ -211,7 +211,7 @@ module Pod
...
@@ -211,7 +211,7 @@ module Pod
super
super
help!
"A podspec name is required."
unless
@spec
help!
"A podspec name is required."
unless
@spec
end
end
def
run
def
run
filepath
=
if
@show_all
filepath
=
if
@show_all
specs
=
get_path_of_spec
(
@spec
,
@show_all
).
split
(
/\n/
)
specs
=
get_path_of_spec
(
@spec
,
@show_all
).
split
(
/\n/
)
...
@@ -220,61 +220,62 @@ module Pod
...
@@ -220,61 +220,62 @@ module Pod
else
else
get_path_of_spec
(
@spec
)
get_path_of_spec
(
@spec
)
end
end
exec_editor
(
filepath
.
to_s
)
if
File
.
exists?
filepath
exec_editor
(
filepath
.
to_s
)
if
File
.
exists?
filepath
raise
Informative
,
"
#{
filepath
}
doesn't exist."
raise
Informative
,
"
#{
filepath
}
doesn't exist."
end
end
# Thank you homebrew
# Thank you homebrew
def
which
(
cmd
)
def
which
(
cmd
)
dir
=
ENV
[
'PATH'
].
split
(
':'
).
find
{
|
p
|
File
.
executable?
File
.
join
(
p
,
cmd
)
}
dir
=
ENV
[
'PATH'
].
split
(
':'
).
find
{
|
p
|
File
.
executable?
File
.
join
(
p
,
cmd
)
}
Pathname
.
new
(
File
.
join
(
dir
,
cmd
))
unless
dir
.
nil?
Pathname
.
new
(
File
.
join
(
dir
,
cmd
))
unless
dir
.
nil?
end
end
def
which_editor
def
which_editor
editor
=
ENV
[
'EDITOR'
]
editor
=
ENV
[
'EDITOR'
]
# If an editor wasn't set, try to pick a sane default
# If an editor wasn't set, try to pick a sane default
return
editor
unless
editor
.
nil?
return
editor
unless
editor
.
nil?
# Find Sublime Text 2
# Find Sublime Text 2
return
'subl'
if
which
'subl'
return
'subl'
if
which
'subl'
# Find Textmate
# Find Textmate
return
'mate'
if
which
'mate'
return
'mate'
if
which
'mate'
# Find # BBEdit / TextWrangler
# Find # BBEdit / TextWrangler
return
'edit'
if
which
'edit'
return
'edit'
if
which
'edit'
# Default to vim
# Default to vim
return
'vim'
if
which
'vim'
return
'vim'
if
which
'vim'
raise
Informative
,
"Failed to open editor. Set your 'EDITOR' environment variable."
raise
Informative
,
"Failed to open editor. Set your 'EDITOR' environment variable."
end
end
def
exec_editor
*
args
def
exec_editor
*
args
return
if
args
.
to_s
.
empty?
return
if
args
.
to_s
.
empty?
safe_exec
(
which_editor
,
*
args
)
safe_exec
(
which_editor
,
*
args
)
end
end
def
safe_exec
(
cmd
,
*
args
)
def
safe_exec
(
cmd
,
*
args
)
# This buys us proper argument quoting and evaluation
# This buys us proper argument quoting and evaluation
# of environment variables in the cmd parameter.
# of environment variables in the cmd parameter.
exec
"/bin/sh"
,
"-i"
,
"-c"
,
cmd
+
' "$@"'
,
"--"
,
*
args
exec
"/bin/sh"
,
"-i"
,
"-c"
,
cmd
+
' "$@"'
,
"--"
,
*
args
end
end
end
end
#-----------------------------------------------------------------------#
#-----------------------------------------------------------------------#
# TODO some of the following methods can probably move to one of the subclasses.
# @todo some of the following methods can probably move to one of the
# subclasses.
private
private
# @return [Fixnum] the index of the chosen array item
# @return [Fixnum] the index of the chosen array item
#
#
def
choose_from_array
(
array
,
message
)
def
choose_from_array
(
array
,
message
)
array
.
each_with_index
do
|
item
,
index
|
array
.
each_with_index
do
|
item
,
index
|
UI
.
puts
"
#{
index
+
1
}
:
#{
item
}
"
UI
.
puts
"
#{
index
+
1
}
:
#{
item
}
"
end
end
print
message
print
message
index
=
STDIN
.
gets
.
chomp
.
to_i
-
1
index
=
STDIN
.
gets
.
chomp
.
to_i
-
1
if
index
<
0
||
index
>
array
.
count
if
index
<
0
||
index
>
array
.
count
raise
Informative
,
"
#{
index
+
1
}
is invalid [1-
#{
array
.
count
}
]"
raise
Informative
,
"
#{
index
+
1
}
is invalid [1-
#{
array
.
count
}
]"
...
@@ -306,14 +307,14 @@ module Pod
...
@@ -306,14 +307,14 @@ module Pod
def
pathname_from_spec
(
spec
,
source
)
def
pathname_from_spec
(
spec
,
source
)
Pathname
.
new
(
"~/.cocoapods/
#{
source
}
/
#{
spec
.
name
}
/
#{
spec
.
version
}
/
#{
spec
.
name
}
.podspec"
).
expand_path
Pathname
.
new
(
"~/.cocoapods/
#{
source
}
/
#{
spec
.
name
}
/
#{
spec
.
version
}
/
#{
spec
.
name
}
.podspec"
).
expand_path
end
end
# @return [String] of spec paths one on each line
# @return [String] of spec paths one on each line
#
#
def
all_paths_from_set
(
set
)
def
all_paths_from_set
(
set
)
paths
=
""
paths
=
""
sources
=
set
.
sources
sources
=
set
.
sources
sources
.
each
do
|
source
|
sources
.
each
do
|
source
|
versions
=
source
.
versions
(
set
.
name
)
versions
=
source
.
versions
(
set
.
name
)
...
@@ -322,7 +323,7 @@ module Pod
...
@@ -322,7 +323,7 @@ module Pod
paths
+=
"
#{
pathname_from_spec
(
spec
,
source
)
}
\n
"
paths
+=
"
#{
pathname_from_spec
(
spec
,
source
)
}
\n
"
end
end
end
end
paths
paths
end
end
...
@@ -344,8 +345,6 @@ module Pod
...
@@ -344,8 +345,6 @@ module Pod
return
best_source
.
specification
(
set
.
name
,
best_version
),
best_source
return
best_source
.
specification
(
set
.
name
,
best_version
),
best_source
end
end
def
podspecs_to_lint
def
podspecs_to_lint
@podspecs_to_lint
||=
begin
@podspecs_to_lint
||=
begin
...
@@ -380,11 +379,10 @@ module Pod
...
@@ -380,11 +379,10 @@ module Pod
#--------------------------------------#
#--------------------------------------#
# Templates and github information retrieval for spec create
# Templates and github information retrieval for spec create
#
# TODO it would be nice to have a template class that accepts options and
# @todo It would be nice to have a template class that accepts options
# uses the default ones if not provided.
# and uses the default ones if not provided.
# @todo The template is outdated.
# TODO The template is outdated.
def
default_data_for_template
(
name
)
def
default_data_for_template
(
name
)
data
=
{}
data
=
{}
...
...
lib/cocoapods/generator/copy_resources_script.rb
View file @
57fb7838
...
@@ -41,7 +41,7 @@ EOS
...
@@ -41,7 +41,7 @@ EOS
script
.
puts
"install_resource '
#{
resource
}
'"
script
.
puts
"install_resource '
#{
resource
}
'"
end
end
end
end
#
TODO
use File api
#
@todo
use File api
system
(
"chmod +x '
#{
pathname
}
'"
)
system
(
"chmod +x '
#{
pathname
}
'"
)
end
end
end
end
...
...
lib/cocoapods/generator/xcconfig.rb
View file @
57fb7838
...
@@ -56,7 +56,6 @@ module Pod
...
@@ -56,7 +56,6 @@ module Pod
'HEADER_SEARCH_PATHS'
=>
'${PODS_HEADERS_SEARCH_PATHS}'
,
'HEADER_SEARCH_PATHS'
=>
'${PODS_HEADERS_SEARCH_PATHS}'
,
'PODS_ROOT'
=>
relative_pods_root
,
'PODS_ROOT'
=>
relative_pods_root
,
'PODS_HEADERS_SEARCH_PATHS'
=>
'${PODS_PUBLIC_HEADERS_SEARCH_PATHS}'
,
'PODS_HEADERS_SEARCH_PATHS'
=>
'${PODS_PUBLIC_HEADERS_SEARCH_PATHS}'
,
# TODO With this setup every targets gets the headers of the previus targets.
'PODS_BUILD_HEADERS_SEARCH_PATHS'
=>
quote
(
sandbox
.
build_headers
.
search_paths
),
'PODS_BUILD_HEADERS_SEARCH_PATHS'
=>
quote
(
sandbox
.
build_headers
.
search_paths
),
'PODS_PUBLIC_HEADERS_SEARCH_PATHS'
=>
quote
(
sandbox
.
public_headers
.
search_paths
),
'PODS_PUBLIC_HEADERS_SEARCH_PATHS'
=>
quote
(
sandbox
.
public_headers
.
search_paths
),
})
})
...
...
lib/cocoapods/installer/file_references_installer.rb
View file @
57fb7838
...
@@ -145,9 +145,6 @@ module Pod
...
@@ -145,9 +145,6 @@ module Pod
# headers folders as the keys and the absolute paths of the
# headers folders as the keys and the absolute paths of the
# header files as the values.
# header files as the values.
#
#
# TODO This is being overridden in the RestKit 0.9.4 spec and that
# override should be fixed.
#
def
header_mappings
(
headers_sandbox
,
consumer
,
headers
)
def
header_mappings
(
headers_sandbox
,
consumer
,
headers
)
dir
=
headers_sandbox
dir
=
headers_sandbox
dir
=
dir
+
consumer
.
header_dir
if
consumer
.
header_dir
dir
=
dir
+
consumer
.
header_dir
if
consumer
.
header_dir
...
...
spec/integration_spec.rb
View file @
57fb7838
...
@@ -169,7 +169,6 @@ module Pod
...
@@ -169,7 +169,6 @@ module Pod
#--------------------------------------#
#--------------------------------------#
# TODO add a simple source file which uses the compiled lib to check that it really really works
it
"activates required pods and create a working static library xcode project"
do
it
"activates required pods and create a working static library xcode project"
do
podfile
=
Podfile
.
new
do
podfile
=
Podfile
.
new
do
platform
test_platform
platform
test_platform
...
@@ -202,7 +201,6 @@ module Pod
...
@@ -202,7 +201,6 @@ module Pod
# No Reachability is required by ASIHTTPRequest on OSX
# No Reachability is required by ASIHTTPRequest on OSX
lockfile_contents
[
'DEPENDENCIES'
].
delete_at
(
1
)
lockfile_contents
[
'DEPENDENCIES'
].
delete_at
(
1
)
lockfile_contents
[
'PODS'
].
delete_at
(
1
)
lockfile_contents
[
'PODS'
].
delete_at
(
1
)
# lockfile_contents['PODS'][0] = 'ASIHTTPRequest (1.8.1)'
end
end
lockfile
=
installer
.
lockfile
.
to_hash
lockfile
=
installer
.
lockfile
.
to_hash
lockfile
.
delete
(
"SPEC CHECKSUMS"
)
lockfile
.
delete
(
"SPEC CHECKSUMS"
)
...
...
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