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
33262152
Commit
33262152
authored
Sep 13, 2011
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Work on the command help system.
parent
37f4f9bd
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
104 additions
and
62 deletions
+104
-62
command.rb
lib/cocoa_pods/command.rb
+41
-6
help.rb
lib/cocoa_pods/command/help.rb
+0
-55
install.rb
lib/cocoa_pods/command/install.rb
+10
-0
repo.rb
lib/cocoa_pods/command/repo.rb
+19
-0
setup.rb
lib/cocoa_pods/command/setup.rb
+10
-0
spec.rb
lib/cocoa_pods/command/spec.rb
+22
-0
config.rb
lib/cocoa_pods/config.rb
+2
-1
No files found.
lib/cocoa_pods/command.rb
View file @
33262152
module
Pod
class
Command
include
Config
::
Mixin
autoload
:Help
,
'cocoa_pods/command/help'
autoload
:Install
,
'cocoa_pods/command/install'
autoload
:Repo
,
'cocoa_pods/command/repo'
autoload
:Setup
,
'cocoa_pods/command/setup'
autoload
:Spec
,
'cocoa_pods/command/spec'
class
Help
def
initialize
(
command_class
,
argv
)
@command_class
,
@argv
=
command_class
,
argv
end
def
run
puts
@command_class
.
banner
puts
puts
"Options"
puts
"======="
puts
puts
@command_class
.
options
end
end
def
self
.
banner
"### Commands
\n
"
+
"
\n
"
+
" * setup
\n
"
+
" * install
\n
"
+
" * repo
\n
"
+
" * spec"
end
def
self
.
options
" --help Show help information
\n
"
+
" --verbose Print more information while working"
end
def
self
.
parse
(
*
argv
)
argv
=
argv
.
dup
command
=
case
argv
.
shift
when
'help'
then
Help
show_help
=
argv
.
delete
(
'--help'
)
Config
.
instance
.
verbose
=
!!
argv
.
delete
(
'--verbose'
)
command_class
=
case
argv
.
shift
when
'install'
then
Install
when
'repo'
then
Repo
when
'setup'
then
Setup
when
'spec'
then
Spec
end
command
.
new
(
*
argv
)
if
show_help
||
command_class
.
nil?
Help
.
new
(
command_class
||
self
,
argv
)
else
command_class
.
new
(
*
argv
)
end
end
include
Config
::
Mixin
def
initialize
(
*
argv
)
raise
ArgumentError
,
"unknown argument(s):
#{
argv
.
join
(
', '
)
}
"
unless
argv
.
empty?
end
...
...
lib/cocoa_pods/command/help.rb
deleted
100644 → 0
View file @
37f4f9bd
module
Pod
class
Command
class
Help
<
Command
def
run
puts
%{
### Setup
$ pod help setup
pod setup
Creates a directory at `~/.cocoa-pods' which will hold your spec-repos.
This is where it will create a clone of the public `master' spec-repo.
### Managing PodSpec files
$ pod help spec
pod spec create NAME
Creates a directory for your new pod, named `NAME', with a default
directory structure and accompanying `NAME.podspec'.
pod spec init NAME
Creates a PodSpec, in the current working dir, called `NAME.podspec'.
Use this for existing libraries.
pod spec lint NAME
Validates `NAME.podspec' from a local spec-repo. In case `NAME' is
omitted, it defaults to the PodSpec in the current working dir.
pod spec push REMOTE
Validates `NAME.podspec' in the current working dir, copies it to the
local clone of the `REMOTE' spec-repo, and pushes it to the `REMOTE'
spec-repo. In case `REMOTE' is omitted, it defaults to `master'.
### Managing spec-repos
$ pod help repo
pod repo add NAME URL
Clones `URL' in the local spec-repos directory at `~/.cocoa-pods'. The
remote can later be referred to by `NAME'.
pod repo update NAME
Updates the local clone of the spec-repo `NAME'.
pod repo change NAME URL
Changes the git remote of local spec-repo `NAME' to `URL'.
pod repo cd NAME
Changes the current working dir to the local spec-repo `NAME'.
}
end
end
end
end
lib/cocoa_pods/command/install.rb
View file @
33262152
module
Pod
class
Command
class
Install
<
Command
def
self
.
banner
'TODO'
end
def
self
.
options
" --no-clean Leave SCM dirs like `.git' and `.svn' in tact after downloading
\n
"
+
super
end
def
initialize
(
*
argv
)
config
.
clean
=
!
argv
.
delete
(
'--no-clean'
)
if
podspec
=
argv
.
shift
@podspec
=
Pathname
.
new
(
podspec
)
end
...
...
lib/cocoa_pods/command/repo.rb
View file @
33262152
...
...
@@ -4,6 +4,25 @@ require 'fileutils'
module
Pod
class
Command
class
Repo
<
Command
def
self
.
banner
%{### Managing spec-repos
$ pod help repo
pod repo add NAME URL
Clones `URL' in the local spec-repos directory at `~/.cocoa-pods'. The
remote can later be referred to by `NAME'.
pod repo update NAME
Updates the local clone of the spec-repo `NAME'.
pod repo change NAME URL
Changes the git remote of local spec-repo `NAME' to `URL'.
pod repo cd NAME
Changes the current working dir to the local spec-repo `NAME'.}
end
include
Executioner
executable
:git
...
...
lib/cocoa_pods/command/setup.rb
View file @
33262152
...
...
@@ -3,6 +3,16 @@ require 'cocoa_pods/command/repo'
module
Pod
class
Command
class
Setup
<
Command
def
self
.
banner
%{### Setup
$ pod help setup
pod setup
Creates a directory at `~/.cocoa-pods' which will hold your spec-repos.
This is where it will create a clone of the public `master' spec-repo.}
end
def
master_repo_url
'git://github.com/alloy/cocoa-pod-specs.git'
end
...
...
lib/cocoa_pods/command/spec.rb
View file @
33262152
module
Pod
class
Command
class
Spec
<
Command
def
self
.
banner
%{### Managing PodSpec files
$ pod help spec
pod spec create NAME
Creates a directory for your new pod, named `NAME', with a default
directory structure and accompanying `NAME.podspec'.
pod spec init NAME
Creates a PodSpec, in the current working dir, called `NAME.podspec'.
Use this for existing libraries.
pod spec lint NAME
Validates `NAME.podspec' from a local spec-repo. In case `NAME' is
omitted, it defaults to the PodSpec in the current working dir.
pod spec push REMOTE
Validates `NAME.podspec' in the current working dir, copies it to the
local clone of the `REMOTE' spec-repo, and pushes it to the `REMOTE'
spec-repo. In case `REMOTE' is omitted, it defaults to `master'.}
end
end
end
end
lib/cocoa_pods/config.rb
View file @
33262152
...
...
@@ -10,11 +10,12 @@ module Pod
@instance
=
instance
end
attr_accessor
:repos_dir
,
:clean
attr_accessor
:repos_dir
,
:clean
,
:verbose
def
initialize
@repos_dir
=
Pathname
.
new
(
File
.
expand_path
(
"~/.cocoa-pods"
))
@clean
=
true
@verbose
=
false
end
def
project_root
...
...
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