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
042b51f9
Commit
042b51f9
authored
Dec 06, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Documenation] Clean-up.
parent
faa726a3
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
152 additions
and
273 deletions
+152
-273
CHANGELOG.md
CHANGELOG.md
+7
-1
external_sources.rb
lib/cocoapods/external_sources.rb
+9
-7
prefix_header.rb
lib/cocoapods/generator/prefix_header.rb
+1
-1
xcconfig.rb
lib/cocoapods/generator/xcconfig.rb
+3
-3
installer.rb
lib/cocoapods/installer.rb
+85
-89
target_installer.rb
lib/cocoapods/installer/target_installer.rb
+2
-2
user_project_integrator.rb
lib/cocoapods/installer/user_project_integrator.rb
+2
-2
path_list.rb
lib/cocoapods/local_pod/path_list.rb
+26
-24
project.rb
lib/cocoapods/project.rb
+2
-2
resolver.rb
lib/cocoapods/resolver.rb
+5
-4
sandbox.rb
lib/cocoapods/sandbox.rb
+4
-5
source.rb
lib/cocoapods/source.rb
+6
-3
ui_pod.rb
lib/cocoapods/user_interface/ui_pod.rb
+0
-130
No files found.
CHANGELOG.md
View file @
042b51f9
## Branch 0.17
[
CocoaPods
](
https://github.com/CocoaPods/CocoaPods/compare/master...0.17
)
-
TODO: Dropped script for resources.
###### DSL Changes
...
...
@@ -13,12 +16,15 @@
###### Enhancements
-
Released
[
documentation
](
docs.cocoapods.org
)
.
-
Extrace models to
[
CocoaPods-Core
](
https://github.com/CocoaPods/Core
)
gem.
-
Major clean up and refactor to the code base.
-
Extracted command-line command & option handling into
[
CLAide
](
https://github.com/CocoaPods/CLAide
)
.
-
Added PathList class.
-
Added Podfile to the Pods project.
[
#476
](
https://github.com/CocoaPods/CocoaPods/issues/476
)
-
Extracted XCConfig generator.
## 0.16.0
[
CocoaPods
](
https://github.com/CocoaPods/CocoaPods/compare/0.16.0.rc5...master
)
...
...
lib/cocoapods/external_sources.rb
View file @
042b51f9
...
...
@@ -124,15 +124,17 @@ module Pod
# The contents of the specification (String) or the path to a
# podspec file (Pathname).
#
# TODO This could be done by the sandbox.
# TODO The check for the podspec string is a bit primitive.
# @todo This could be done by the sandbox.
# @todo Store all the specifications (including those not originating
# from external sources) so users can check them.
# @todo The check for the podspec string is a bit primitive.
#
def
store_podspec
(
sandbox
,
podspec
)
output_path
=
sandbox
.
root
+
"Local Podspecs/
#{
name
}
.podspec"
output_path
.
dirname
.
mkpath
if
podspec
.
is_a?
(
String
)
unless
podspec
.
include?
(
'Spec.new'
)
raise
Informative
,
"
No podspec found for `
#{
name
}
` in
#{
description
}
"
raise
Informative
,
"
The `
#{
name
}
.podspec` from `
#{
description
}
` appears to be invalid.
"
end
output_path
.
open
(
'w'
)
{
|
f
|
f
.
puts
(
podspec
)
}
else
...
...
@@ -217,19 +219,19 @@ module Pod
#
class
LocalSource
<
AbstractExternalSource
# @see AbstractExternalSource#copy_external_source_into_sandbox
# @see
AbstractExternalSource#copy_external_source_into_sandbox
#
def
copy_external_source_into_sandbox
(
sandbox
)
store_podspec
(
sandbox
,
pod_spec_path
)
end
# @see AbstractExternalSource#description
# @see
AbstractExternalSource#description
#
def
description
"from `
#{
@params
[
:local
]
}
`"
end
# @see AbstractExternalSource#specification_from_local
# @see
AbstractExternalSource#specification_from_local
#
# @note The LocalSource class always fetches podspecs from the external
# source to provide always the freshest specification. Otherwise,
...
...
@@ -240,7 +242,7 @@ module Pod
specification_from_external
(
sandbox
)
end
# @see AbstractExternalSource#specification_from_local
# @see
AbstractExternalSource#specification_from_local
#
# @note The LocalSource overrides the source of the specification to
# point to the local path.
...
...
lib/cocoapods/generator/prefix_header.rb
View file @
042b51f9
...
...
@@ -39,7 +39,7 @@ module Pod
#
# @return [String]
#
#
TODO:
Subspecs can specify prefix header information too.
#
@todo
Subspecs can specify prefix header information too.
#
def
generate
result
=
"#ifdef __OBJC__
\n
"
...
...
lib/cocoapods/generator/xcconfig.rb
View file @
042b51f9
...
...
@@ -40,10 +40,10 @@ module Pod
#
# @return [Xcodeproj::Config]
#
#
TODO What is the need of having a custom PODS_HEADERS_SEARCH_PATHS
#
instead of using PODS_HEADERS_SEARCH_PATHS?
#
@note The value `PODS_HEADERS_SEARCH_PATHS` is used to store the headers
#
so xcconfig can reference the variable.
#
#
TODO
Add Xcodeproj::Config#[]
#
@todo
Add Xcodeproj::Config#[]
#
def
generate
ld_flags
=
'-ObjC'
...
...
lib/cocoapods/installer.rb
View file @
042b51f9
...
...
@@ -55,24 +55,20 @@ module Pod
include
Config
::
Mixin
# @return [Sandbox]
# the sandbox where the Pods should be installed.
# @return [Sandbox] The sandbox where the Pods should be installed.
#
attr_reader
:sandbox
# @return [Podfile]
# the Podfile specification that contains the information of the Pods
# that should be installed.
# @return [Podfile] The Podfile specification that contains the information
# of the Pods that should be installed.
#
attr_reader
:podfile
# @return [Lockfile]
# the Lockfile that stores the information about the Pods previously
# installed on any machine.
# @return [Lockfile] The Lockfile that stores the information about the
# Pods previously installed on any machine.
#
attr_reader
:lockfile
# @param [Sandbox] sandbox @see sandbox
# @param [Podfile] podfile @see podfile
# @param [Lockfile] lockfile @see lockfile
...
...
@@ -84,10 +80,9 @@ module Pod
@lockfile
=
lockfile
end
# @return [Bool]
# whether the installer is in update mode. In update mode the contents of
# the Lockfile are not taken into account for deciding what Pods to
# install.
# @return [Bool] Whether the installer is in update mode. In update mode
# the contents of the Lockfile are not taken into account for
# deciding what Pods to install.
#
attr_accessor
:update_mode
...
...
@@ -96,15 +91,15 @@ module Pod
# The installation process of is mostly linear with few minor complications
# to keep in mind:
#
#
- The stored podspecs need to be cleaned before the resolution step
#
otherwise the sandbox might return an old podspec and not download
#
the new one from an external source.
#
- The resolver might trigger the download of Pods from external sources
#
necessary to retrieve their podspec (unless it is instructed not to
#
do it).
# - The stored podspecs need to be cleaned before the resolution step
# otherwise the sandbox might return an old podspec and not download
# the new one from an external source.
# - The resolver might trigger the download of Pods from external sources
# necessary to retrieve their podspec (unless it is instructed not to
# do it).
#
# @note The order of the steps is very important and should be changed
# carefully.
# @note
The order of the steps is very important and should be changed
#
carefully.
#
# @return [void]
#
...
...
@@ -120,7 +115,6 @@ module Pod
integrate_user_project
end
# <<<<<<< HEAD
# Performs only the computation parts of an installation.
#
# It is used by the `outdated` subcommand.
...
...
@@ -225,9 +219,9 @@ module Pod
#
# @return [void]
#
#
TODO:
If there is not Lockfile all the Pods should be marked as added.
#
@todo
If there is not Lockfile all the Pods should be marked as added.
#
#
TODO:
Once the manifest.lock is implemented only the unchanged pods
#
@todo
Once the manifest.lock is implemented only the unchanged pods
# should be tracked.
#
def
generate_pods_by_podfile_state
...
...
@@ -260,18 +254,20 @@ module Pod
pods_unchanged_from_the_lockfile
.
each
{
|
pod
|
UI
.
message
(
"-"
+
"
#{
pod
}
"
,
''
,
2
)
}
end
#
@return [void] Lazily updates the source repositories. The update is
#
triggered if:
#
- There are pods that changed in the Podfile.
#
- The lockfile is missing.
#
- The installer is in update_mode.
#
Lazily updates the source repositories. The update is triggered if:
#
# - There are pods that changed in the Podfile.
# - The lockfile is missing.
# - The installer is in update_mode.
#
#
TODO:
Remove the lockfile condition once compare_podfile_and_lockfile
#
@todo
Remove the lockfile condition once compare_podfile_and_lockfile
# is updated.
#
#
TODO:
Lazy resolution can't be done if we want to fully support detection
#
@todo
Lazy resolution can't be done if we want to fully support detection
# of changes in specifications checksum.
#
# @return [void]
#
def
update_repositories_if_needed
return
if
config
.
skip_repo_update?
changed_pods
=
(
pods_changed_from_the_lockfile
+
pods_deleted_from_the_lockfile
)
...
...
@@ -300,14 +296,14 @@ module Pod
# Converts the Podfile in a list of specifications grouped by target.
#
# @note As some dependencies might have external sources the resolver is
# aware of the {Sandbox} and interacts with it to download the
# podspecs of the external sources. This is necessary because the
# resolver needs the specifications to analyze their dependencies
# (which might be from external sources).
# @note
As some dependencies might have external sources the resolver is
#
aware of the {Sandbox} and interacts with it to download the
#
podspecs of the external sources. This is necessary because the
#
resolver needs the specifications to analyze their dependencies
#
(which might be from external sources).
#
# @note
In update mode the resolver is set to always update the specs from
# external sources.
# @note
In update mode the resolver is set to always update the specs
#
from
external sources.
#
# @return [void]
#
...
...
@@ -333,9 +329,9 @@ module Pod
#
# @return [void]
#
#
TODO:
Use {Sandbox} manifest.
#
@todo
Use {Sandbox} manifest.
#
#
TODO:
[#534] Detect if the folder of a Pod is empty.
#
@todo
[#534] Detect if the folder of a Pod is empty.
#
def
generate_pods_that_should_be_installed
changed_pods_names
=
[]
...
...
@@ -366,7 +362,7 @@ module Pod
#
# @return [void]
#
#
TODO:
[#535] Pods should be accumulated per Target, also in the Local
#
@todo
[#535] Pods should be accumulated per Target, also in the Local
# Pod class. The Local Pod class should have a method to add itself
# to a given project so it can use the sources of all the activated
# podspecs across all targets. Also cleaning should take into account
...
...
@@ -385,24 +381,6 @@ module Pod
end
@local_pods
=
local_pods_by_target
.
values
.
flatten
.
uniq
.
sort_by
{
|
pod
|
pod
.
name
.
downcase
}
# =======
# def project
# return @project if @project
# @project = Pod::Project.new(sandbox)
# # TODO
# # @project.user_build_configurations = @podfile.user_build_configurations
# pods.each { |p| p.add_file_references_to_project(@project) }
# pods.each { |p| p.link_headers }
# @project.add_podfile(config.project_podfile)
# @project
# end
#
# def target_installers
# @target_installers ||= @podfile.target_definitions.values.map do |definition|
# pods_for_target = pods_by_target[definition]
# TargetInstaller.new(project, definition, pods_for_target) unless definition.empty?
# end.compact
# >>>>>>> core-extraction
end
#---------------------------------------------------------------------------#
...
...
@@ -426,7 +404,7 @@ module Pod
# @return [void] In this step we clean all the folders that will be
# regenerated from scratch and any file which might not be overwritten.
#
# @
TODO:
Clean the podspecs of all the pods that aren't unchanged so the
# @
todo
Clean the podspecs of all the pods that aren't unchanged so the
# resolution process doesn't get confused by them.
#
def
clean_global_support_files
...
...
@@ -436,8 +414,8 @@ module Pod
# @return [void] In this step we clean all the files related to the removed
# Pods.
#
# @
TODO:
Use the local pod implode.
# @
TODO:
[#534] Clean all the Pods folder that are not unchanged?
# @
todo
Use the local pod implode.
# @
todo
[#534] Clean all the Pods folder that are not unchanged?
#
def
clean_removed_pods
UI
.
section
"Removing deleted dependencies"
do
...
...
@@ -454,7 +432,7 @@ module Pod
# installed. We clean the files that might affect the resolution process
# and the files that might not be overwritten.
#
# @
TODO:
[#247] Clean the headers of only the pods to install.
# @
todo
[#247] Clean the headers of only the pods to install.
#
def
clean_pods_to_install
...
...
@@ -486,7 +464,7 @@ module Pod
# @note In this step we clean also the Pods that have been pre-downloaded
# in AbstractExternalSource#specification_from_sandbox.
#
#
TODO:
[#529] Podspecs should not be preserved anymore to prevent user
#
@todo
[#529] Podspecs should not be preserved anymore to prevent user
# confusion. Currently we are copying the ones form external sources
# in `Local Podspecs` and this feature is not needed anymore.
# I think that copying all the used podspecs would be helpful for
...
...
@@ -501,8 +479,9 @@ module Pod
pod
.
clean!
if
config
.
clean?
end
# @return [void] Downloads a Pod forcing the `bleeding edge' version if
# requested.
# Downloads a Pod forcing the `bleeding edge' version if requested.
#
# @return [void]
#
def
download_pod
(
pod
)
downloader
=
Downloader
.
for_pod
(
pod
)
...
...
@@ -520,8 +499,10 @@ module Pod
pod
.
downloaded
=
true
end
# @return [void] Generates the documentation of a Pod unless it exists
# for a given version.
# Generates the documentation of a Pod unless it exists for a given
# version.
#
# @return [void]
#
def
generate_docs_if_needed
(
pod
)
doc_generator
=
Generator
::
Documentation
.
new
(
pod
)
...
...
@@ -535,8 +516,8 @@ module Pod
# Creates and populates the targets of the pods project.
#
# @note
Post install hooks run _before_ saving of project, so that they can
#
alter it before saving
.
# @note
Post install hooks run _before_ saving of project, so that they
#
can alter it before it is writtent to the disk
.
#
# @return [void]
#
...
...
@@ -554,14 +535,15 @@ module Pod
# Creates the Pods project from scratch if it doesn't exists.
#
# TODO clean and modify the project if it exists.
# @todo Restore the build configuration support.
# @todo Clean and modify the project if it exists.
#
# @return [void]
#
def
prepare_pods_project
UI
.
message
"- Creating Pods project"
do
@pods_project
=
Pod
::
Project
.
new
(
config
.
sandbox
)
# TODO
@pods_project
.
add_podfile
(
config
.
project_podfile
)
# pods_project.user_build_configurations = podfile.user_build_configurations
end
end
...
...
@@ -574,7 +556,6 @@ module Pod
@target_installers
=
podfile
.
target_definitions
.
values
.
map
do
|
definition
|
pods_for_target
=
local_pods_by_target
[
definition
]
TargetInstaller
.
new
(
pods_project
,
definition
,
pods_for_target
)
unless
definition
.
empty?
# TargetInstaller.new(podfile, pods_project, definition) unless definition.empty?
end
.
compact
end
...
...
@@ -586,24 +567,25 @@ module Pod
#
# @return [void]
#
# TODO Clean the groups of the deleted Pods and add only the Pods that
# should be installed.
#
# TODO [#588] Add file references for the resources of the Pods as well so
# they are visible for the user.
# @todo Clean the groups of the deleted Pods and add only the Pods that
# should be installed.
# @todo [#588] Add file references for the resources of the Pods as well
# so they are visible for the user.
#
def
add_source_files_to_pods_project
UI
.
message
"- Adding source files to Pods project"
do
local_pods
.
each
{
|
p
|
p
.
add_file_references_to_project
(
pods_project
)
}
local_pods
.
each
{
|
p
|
p
.
link_headers
}
end
# <<<<<<< HEAD
# =======
#
# UserProjectIntegrator.new(@podfile).integrate! if config.integrate_targets?
# >>>>>>> core-extraction
end
# Runs the pre install hooks of the installed specs and of the Podfile.
#
# @todo Run the hooks only for the installed pods.
# @todo Print a messsage with the names of the specs.
#
# @return [void]
#
def
run_pre_install_hooks
UI
.
message
"- Running pre install hooks"
do
local_pods_by_target
.
each
do
|
target_definition
,
pods
|
...
...
@@ -615,10 +597,15 @@ module Pod
end
end
# Runs the post install hooks of the installed specs and of the Podfile.
#
# @todo Run the hooks only for the installed pods.
# @todo Print a messsage with the names of the specs.
#
# @return [void]
#
def
run_post_install_hooks
UI
.
message
"- Running post install hooks"
do
# we loop over target installers instead of pods, because we yield the
# target installer to the spec post install hook.
target_installers
.
each
do
|
target_installer
|
specs_by_target
[
target_installer
.
target_definition
].
each
do
|
spec
|
spec
.
post_install!
(
target_installer
)
...
...
@@ -628,12 +615,16 @@ module Pod
end
end
# Installs the targets of the Pods projects and generates their support
# files.
#
# @todo Move the acknowledgements to the target installer?
#
def
generate_target_support_files
UI
.
message
"- Installing targets"
do
target_installers
.
each
do
|
target_installer
|
pods_for_target
=
local_pods_by_target
[
target_installer
.
target_definition
]
target_installer
.
install!
# TODO
acknowledgements_path
=
target_installer
.
library
.
acknowledgements_path
Generator
::
Acknowledgements
.
new
(
target_installer
.
target_definition
,
pods_for_target
).
save_as
(
acknowledgements_path
)
...
...
@@ -642,6 +633,11 @@ module Pod
end
end
# Generates a dummy source file for each target so libraries that contain
# only cathegories build.
#
# @todo Move to the target installer?
#
def
generate_dummy_source
(
target_installer
)
class_name_identifier
=
target_installer
.
target_definition
.
label
dummy_source
=
Generator
::
DummySource
.
new
(
class_name_identifier
)
...
...
@@ -666,7 +662,7 @@ module Pod
#
# @return [void]
#
#
TODO: [#552] Implement
#
@todo [#552] Implement manifest.
#
def
write_lockfiles
@lockfile
=
Lockfile
.
generate
(
podfile
,
specs_by_target
.
values
.
flatten
)
...
...
@@ -688,10 +684,10 @@ module Pod
#
# @return [void]
#
#
TODO:
[#397] The libraries should be cleaned and the re-added on every
#
@todo
[#397] The libraries should be cleaned and the re-added on every
# installation. Maybe a clean_user_project phase should be added.
#
#
TODO:
[#588] The resources should be added through a build phase instead
#
@todo
[#588] The resources should be added through a build phase instead
# of using a script.
#
def
integrate_user_project
...
...
lib/cocoapods/installer/target_installer.rb
View file @
042b51f9
...
...
@@ -47,7 +47,7 @@ module Pod
create_copy_resources_script
end
#
TODO:
This has to be removed, but this means the specs have to be
#
@todo
This has to be removed, but this means the specs have to be
# updated if they need a reference to the prefix header.
#
def
prefix_header_filename
...
...
@@ -166,7 +166,7 @@ module Pod
# Creates a script that copies the resources to the bundle of the client
# target.
#
#
TODO:
This should be replaced by an Xcode copy resources build phase.
#
@todo
This should be replaced by an Xcode copy resources build phase.
#
# @return [void]
#
...
...
lib/cocoapods/installer/user_project_integrator.rb
View file @
042b51f9
...
...
@@ -25,7 +25,7 @@ module Pod
# @return [Pathname] the path of the installation.
#
#
TODO:
This is only used to compute the workspace path in case that it
#
@todo
This is only used to compute the workspace path in case that it
# should be inferred by the project. If the workspace should be in
# the same dir of the project, this could be removed.
#
...
...
@@ -212,7 +212,7 @@ module Pod
# configurations overrides the `xcconfig` file and warns the
# user.
#
#
TODO:
If the xcconfig is already set don't override it and inform
#
@todo
If the xcconfig is already set don't override it and inform
# the user.
#
# @return [void]
...
...
lib/cocoapods/local_pod/path_list.rb
View file @
042b51f9
module
Pod
class
LocalPod
# The
{PathList}
class is designed to perform multiple glob matches against
#
a given directory. Basically, it generates a list of all the children
#
paths and matches the globs patterns against them, resulting in just
#
one
access to the file system.
# The
PathList
class is designed to perform multiple glob matches against
# a given directory. Basically, it generates a list of all the children
#
paths and matches the globs patterns against them, resulting in just one
# access to the file system.
#
# @note
A {PathList}
once it has generated the list of the paths this is
# updated only if explicitly requested by calling
#
{PathList
#read_file_system}
# @note
A PathList
once it has generated the list of the paths this is
#
updated only if explicitly requested by calling
#
{
#read_file_system}
#
class
PathList
# @return [Pathname] The root of the list whose files and directories
# are used to perform the matching operations.
#
are used to perform the matching operations.
#
attr_accessor
:root
# @param [Pathname] root The root of the PathList.
# @param
[Pathname] root The root of the PathList.
#
def
initialize
(
root
)
@root
=
root
end
# @return [Array<String>] The list of absolute the path of all the files
# contained in {root}.
#
contained in {root}.
#
def
files
read_file_system
unless
@files
...
...
@@ -32,7 +32,7 @@ module Pod
end
# @return [Array<String>] The list of absolute the path of all the
# directories contained in {root}.
#
directories contained in {root}.
#
def
dirs
read_file_system
unless
@dirs
...
...
@@ -40,7 +40,7 @@ module Pod
end
# @return [void] Reads the file system and populates the files and paths
# lists.
#
lists.
#
def
read_file_system
root_length
=
root
.
to_s
.
length
+
1
...
...
@@ -53,22 +53,22 @@ module Pod
end
# @return [Array<Pathname>] Similar to {glob} but returns the absolute
# paths.
#
paths.
#
def
glob
(
patterns
,
dir_pattern
=
nil
,
exclude_patterns
=
nil
)
relative_glob
(
patterns
,
dir_pattern
,
exclude_patterns
).
map
{
|
p
|
root
+
p
}
end
# @return [Array<Pathname>] The list of relative paths that are case
# insensitively matched by a given pattern. This method emulates
# {Dir#glob} with the {File::FNM_CASEFOLD} option.
#
insensitively matched by a given pattern. This method emulates
#
{Dir#glob} with the {File::FNM_CASEFOLD} option.
#
# @param
[String,Array<String>] patterns A signle {Dir#glob} like
#
pattern, or a list of patterns.
# @param
[String,Array<String>] patterns
#
A signle {Dir#glob} like
pattern, or a list of patterns.
#
# @param
[String] dir_pattern An optional pattern to append to a
#
pattern, if it is the path to a
#
directory.
# @param
[String] dir_pattern
#
An optional pattern to append to a pattern, if it is the path
#
to a
directory.
#
def
relative_glob
(
patterns
,
dir_pattern
=
nil
,
exclude_patterns
=
nil
)
return
[]
if
patterns
.
empty?
...
...
@@ -94,9 +94,10 @@ module Pod
end
# @return [Bool] Wether a path is a directory. The result of this method
# computed without accessing the file system and is case insensitive.
# computed without accessing the file system and is case
# insensitive.
#
# @param [String, Pathname] sub_path The path that could be a directory.
# @param
[String, Pathname] sub_path The path that could be a directory.
#
def
directory?
(
sub_path
)
sub_path
=
sub_path
.
to_s
.
downcase
.
sub
(
/\/$/
,
''
)
...
...
@@ -104,8 +105,9 @@ module Pod
end
# @return [Array<String>] An array of patterns converted from a
# {Dir.glob} pattern to patterns that {File.fnmatch} can handle. This
# is used by the {#relative_glob} method to emulate {Dir.glob}.
# {Dir.glob} pattern to patterns that {File.fnmatch} can handle.
# This is used by the {#relative_glob} method to emulate
# {Dir.glob}.
#
# The expansion provides support for:
#
...
...
lib/cocoapods/project.rb
View file @
042b51f9
...
...
@@ -322,7 +322,7 @@ module Pod
# @return [Pathname] the folder where to store the support files of this
# library.
#
#
TODO: each library should have a folder
for its support files
#
@todo each library should have a group
for its support files
#
def
support_files_root
project
.
sandbox
.
root
...
...
@@ -409,7 +409,7 @@ module Pod
support_files_root
+
bridge_support_name
end
#
TODO
#
@todo
#
def
acknowledgements_path
support_files_root
+
"
#{
label
}
-Acknowledgements"
...
...
lib/cocoapods/resolver.rb
View file @
042b51f9
...
...
@@ -35,7 +35,7 @@ module Pod
#
# @note This option is used by `pod outdated`.
#
# @
TODO
: This implementation is not clean, because if the spec doesn't
# @
todo
: This implementation is not clean, because if the spec doesn't
# exists the sandbox will actually download and modify the
# installation.
#
...
...
@@ -112,7 +112,7 @@ module Pod
# @return [Source::Aggregate] A cache of the sources needed to find the
# podspecs.
#
#
TODO:
Cache the sources globally?
#
@todo
Cache the sources globally?
#
attr_accessor
:cached_sources
...
...
@@ -155,8 +155,9 @@ module Pod
# dependency of the specification. In this way it is possible to
# not updated the installed pods without without introducing
# dependencies in other target definitions.
# TODO: Just add the requirement to the set?
# TODO: Use root name?
#
# @todo Just add the requirement to the set?
# @todo Use root name?
#
# @note The recursive process checks if a dependency has already been
# loaded to prevent an infinite loop. For this reason the
...
...
lib/cocoapods/sandbox.rb
View file @
042b51f9
...
...
@@ -10,8 +10,6 @@ module Pod
#
class
Sandbox
# TODO the headers should be stored in a `Headers` folder.
# The path of the build headers directory relative to the root.
#
BUILD_HEADERS_DIR
=
"BuildHeaders"
...
...
@@ -34,6 +32,8 @@ module Pod
# @param [String, Pathname] root @see root
#
# @todo the headers should be stored in a `Headers` folder.
#
def
initialize
(
root
)
@root
=
Pathname
.
new
(
root
)
@build_headers
=
HeadersDirectory
.
new
(
self
,
BUILD_HEADERS_DIR
)
...
...
@@ -85,7 +85,7 @@ module Pod
public
# @
TODO
refactor the pods from a local source should not be cached by the
# @
todo
refactor the pods from a local source should not be cached by the
# sandbox
#
# @return [LocalPod]
...
...
@@ -142,7 +142,7 @@ module Pod
# @return [Array<String>] the names of the pods that have been
# pre-downloaded from an external source.
#
#
TODO:
the installer needs to be aware of it.
#
@todo
the installer needs to be aware of it.
#
attr_reader
:predownloaded_pods
...
...
@@ -202,7 +202,6 @@ module Pod
public
#
#
def
add_file
(
namespace_path
,
relative_header_path
)
...
...
lib/cocoapods/source.rb
View file @
042b51f9
...
...
@@ -4,7 +4,6 @@ module Pod
include
Config
::
Mixin
# TODO: Move exceptions to clients?
# @return [Array<Source>] the list of all the sources known to this
# installation of CocoaPods.
...
...
@@ -26,6 +25,8 @@ module Pod
# {Source} that contain the Pod. If no sources containing the
# Pod where found it returns nil.
#
# @todo Move exceptions to clients?
#
# @raise If no source including the set can be found.
#
def
search
(
dependency
)
...
...
@@ -46,8 +47,10 @@ module Pod
#
# @raises If no source including the set can be found.
#
# @note Full text search requires to load the specification for each pod,
# hence is considerably slower.
# @note Full text search requires to load the specification for each
# pod, hence is considerably slower.
#
# @todo Move exceptions to clients?
#
# @return [Array<Set>] The sets that contain the search term.
#
...
...
lib/cocoapods/user_interface/ui_pod.rb
deleted
100644 → 0
View file @
faa726a3
require
'active_support/core_ext/array/conversions'
module
Pod
module
UserInterface
class
UIPod
attr_accessor
:set
def
initialize
(
set
)
@set
=
set
end
# set information
def
name
@set
.
name
end
def
version
@set
.
versions
.
first
end
def
versions
@set
.
versions
.
sort
.
reverse
end
def
verions_by_source
result
=
[]
@set
.
versions_by_source
.
each
do
|
source
,
versions
|
result
<<
"
#{
versions
.
map
(
&
:to_s
)
*
', '
}
[
#{
source
.
name
}
repo]"
end
result
*
' - '
end
# @return [Array<String>]
#
def
sources
@set
.
sources
.
map
(
&
:name
).
sort
end
# specification information
def
spec
@set
.
specification
end
def
authors
spec
.
authors
?
spec
.
authors
.
keys
.
to_sentence
:
''
end
def
homepage
spec
.
homepage
end
def
description
spec
.
description
end
def
summary
spec
.
summary
end
def
source_url
spec
.
source
.
reject
{
|
k
,
_
|
k
==
:commit
||
k
==
:tag
}.
values
.
first
end
def
platform
spec
.
available_platforms
.
sort
{
|
a
,
b
|
a
.
to_s
.
downcase
<=>
b
.
to_s
.
downcase
}.
join
(
' - '
)
end
def
license
spec
.
license
[
:type
]
if
spec
.
license
end
# will return array of all subspecs (recursevly) or nil
def
subspecs
(
spec
.
recursive_subspecs
.
any?
&&
spec
.
recursive_subspecs
)
||
nil
end
# Statistics information
def
creation_date
Pod
::
Specification
::
Statistics
.
instance
.
creation_date
(
@set
)
end
def
github_watchers
Pod
::
Specification
::
Statistics
.
instance
.
github_watchers
(
@set
)
end
def
github_forks
Pod
::
Specification
::
Statistics
.
instance
.
github_forks
(
@set
)
end
def
github_last_activity
distance_from_now_in_words
(
Pod
::
Specification
::
Statistics
.
instance
.
github_pushed_at
(
@set
))
end
def
==
(
other
)
self
.
class
===
other
&&
@set
==
other
.
set
end
def
eql?
(
other
)
self
.
class
===
other
&&
name
.
eql?
(
other
.
name
)
end
def
hash
name
.
hash
end
private
def
distance_from_now_in_words
(
from_time
)
return
nil
unless
from_time
from_time
=
Time
.
parse
(
from_time
)
to_time
=
Time
.
now
distance_in_days
=
(((
to_time
-
from_time
).
abs
)
/
60
/
60
/
24
).
round
case
distance_in_days
when
0
..
7
"less than a week ago"
when
8
..
29
"
#{
distance_in_days
}
days ago"
when
30
..
45
"1 month ago"
when
46
..
365
"
#{
(
distance_in_days
.
to_f
/
30
).
round
}
months ago"
else
"more than a year ago"
end
end
end
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