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
DESC
self
.
arguments
=
'[ NAME ]'
def
self
.
options
[[
"--show-all"
,
"Pick from all versions of the given podspec"
]].
concat
(
super
)
end
...
...
@@ -186,20 +186,20 @@ module Pod
end
#-----------------------------------------------------------------------#
class
Edit
<
Spec
self
.
summary
=
'Edit a spec file.'
self
.
description
=
<<-
DESC
Opens 'NAME.podspec' to be edited.
DESC
self
.
arguments
=
'[ NAME ]'
def
self
.
options
[[
"--show-all"
,
"Pick which spec to edit from all avaliable versions of the given podspec"
]].
concat
(
super
)
end
def
initialize
(
argv
)
@show_all
=
argv
.
flag?
(
'show-all'
)
@spec
=
argv
.
shift_argument
...
...
@@ -211,7 +211,7 @@ module Pod
super
help!
"A podspec name is required."
unless
@spec
end
def
run
filepath
=
if
@show_all
specs
=
get_path_of_spec
(
@spec
,
@show_all
).
split
(
/\n/
)
...
...
@@ -220,61 +220,62 @@ module Pod
else
get_path_of_spec
(
@spec
)
end
exec_editor
(
filepath
.
to_s
)
if
File
.
exists?
filepath
raise
Informative
,
"
#{
filepath
}
doesn't exist."
end
# Thank you homebrew
def
which
(
cmd
)
dir
=
ENV
[
'PATH'
].
split
(
':'
).
find
{
|
p
|
File
.
executable?
File
.
join
(
p
,
cmd
)
}
Pathname
.
new
(
File
.
join
(
dir
,
cmd
))
unless
dir
.
nil?
end
def
which_editor
editor
=
ENV
[
'EDITOR'
]
# If an editor wasn't set, try to pick a sane default
return
editor
unless
editor
.
nil?
# Find Sublime Text 2
return
'subl'
if
which
'subl'
# Find Textmate
return
'mate'
if
which
'mate'
# Find # BBEdit / TextWrangler
return
'edit'
if
which
'edit'
# Default to vim
return
'vim'
if
which
'vim'
raise
Informative
,
"Failed to open editor. Set your 'EDITOR' environment variable."
end
def
exec_editor
*
args
return
if
args
.
to_s
.
empty?
safe_exec
(
which_editor
,
*
args
)
end
def
safe_exec
(
cmd
,
*
args
)
# This buys us proper argument quoting and evaluation
# of environment variables in the cmd parameter.
exec
"/bin/sh"
,
"-i"
,
"-c"
,
cmd
+
' "$@"'
,
"--"
,
*
args
end
# Thank you homebrew
def
which
(
cmd
)
dir
=
ENV
[
'PATH'
].
split
(
':'
).
find
{
|
p
|
File
.
executable?
File
.
join
(
p
,
cmd
)
}
Pathname
.
new
(
File
.
join
(
dir
,
cmd
))
unless
dir
.
nil?
end
def
which_editor
editor
=
ENV
[
'EDITOR'
]
# If an editor wasn't set, try to pick a sane default
return
editor
unless
editor
.
nil?
# Find Sublime Text 2
return
'subl'
if
which
'subl'
# Find Textmate
return
'mate'
if
which
'mate'
# Find # BBEdit / TextWrangler
return
'edit'
if
which
'edit'
# Default to vim
return
'vim'
if
which
'vim'
raise
Informative
,
"Failed to open editor. Set your 'EDITOR' environment variable."
end
def
exec_editor
*
args
return
if
args
.
to_s
.
empty?
safe_exec
(
which_editor
,
*
args
)
end
def
safe_exec
(
cmd
,
*
args
)
# This buys us proper argument quoting and evaluation
# of environment variables in the cmd parameter.
exec
"/bin/sh"
,
"-i"
,
"-c"
,
cmd
+
' "$@"'
,
"--"
,
*
args
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
# @return [Fixnum] the index of the chosen array item
#
def
choose_from_array
(
array
,
message
)
array
.
each_with_index
do
|
item
,
index
|
UI
.
puts
"
#{
index
+
1
}
:
#{
item
}
"
end
print
message
index
=
STDIN
.
gets
.
chomp
.
to_i
-
1
if
index
<
0
||
index
>
array
.
count
raise
Informative
,
"
#{
index
+
1
}
is invalid [1-
#{
array
.
count
}
]"
...
...
@@ -306,14 +307,14 @@ module Pod
def
pathname_from_spec
(
spec
,
source
)
Pathname
.
new
(
"~/.cocoapods/
#{
source
}
/
#{
spec
.
name
}
/
#{
spec
.
version
}
/
#{
spec
.
name
}
.podspec"
).
expand_path
end
# @return [String] of spec paths one on each line
#
def
all_paths_from_set
(
set
)
paths
=
""
sources
=
set
.
sources
sources
.
each
do
|
source
|
versions
=
source
.
versions
(
set
.
name
)
...
...
@@ -322,7 +323,7 @@ module Pod
paths
+=
"
#{
pathname_from_spec
(
spec
,
source
)
}
\n
"
end
end
paths
end
...
...
@@ -344,8 +345,6 @@ module Pod
return
best_source
.
specification
(
set
.
name
,
best_version
),
best_source
end
def
podspecs_to_lint
@podspecs_to_lint
||=
begin
...
...
@@ -380,11 +379,10 @@ module Pod
#--------------------------------------#
# Templates and github information retrieval for spec create
# TODO it would be nice to have a template class that accepts options and
# uses the default ones if not provided.
# TODO The template is outdated.
#
# @todo It would be nice to have a template class that accepts options
# and uses the default ones if not provided.
# @todo The template is outdated.
def
default_data_for_template
(
name
)
data
=
{}
...
...
lib/cocoapods/generator/copy_resources_script.rb
View file @
57fb7838
...
...
@@ -41,7 +41,7 @@ EOS
script
.
puts
"install_resource '
#{
resource
}
'"
end
end
#
TODO
use File api
#
@todo
use File api
system
(
"chmod +x '
#{
pathname
}
'"
)
end
end
...
...
lib/cocoapods/generator/xcconfig.rb
View file @
57fb7838
...
...
@@ -56,7 +56,6 @@ module Pod
'HEADER_SEARCH_PATHS'
=>
'${PODS_HEADERS_SEARCH_PATHS}'
,
'PODS_ROOT'
=>
relative_pods_root
,
'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_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
# headers folders as the keys and the absolute paths of the
# 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
)
dir
=
headers_sandbox
dir
=
dir
+
consumer
.
header_dir
if
consumer
.
header_dir
...
...
spec/integration_spec.rb
View file @
57fb7838
...
...
@@ -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
podfile
=
Podfile
.
new
do
platform
test_platform
...
...
@@ -202,7 +201,6 @@ module Pod
# No Reachability is required by ASIHTTPRequest on OSX
lockfile_contents
[
'DEPENDENCIES'
].
delete_at
(
1
)
lockfile_contents
[
'PODS'
].
delete_at
(
1
)
# lockfile_contents['PODS'][0] = 'ASIHTTPRequest (1.8.1)'
end
lockfile
=
installer
.
lockfile
.
to_hash
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