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
eed0a91f
Commit
eed0a91f
authored
Sep 17, 2011
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add simple command executer.
parent
71fc2bbf
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
24 additions
and
14 deletions
+24
-14
TODO
TODO
+1
-0
Podfile
examples/Podfile
+1
-1
cocoa_pods.rb
lib/cocoa_pods.rb
+1
-1
command.rb
lib/cocoa_pods/command.rb
+2
-0
repo.rb
lib/cocoa_pods/command/repo.rb
+1
-2
downloader.rb
lib/cocoa_pods/downloader.rb
+4
-8
executable.rb
lib/cocoa_pods/executable.rb
+13
-0
git.rb
spec/spec_helper/git.rb
+1
-2
No files found.
TODO
0 → 100644
View file @
eed0a91f
* Check exit statuses of commands performed and raise when necessary.
examples/Podfile
View file @
eed0a91f
...
...
@@ -2,7 +2,7 @@
dependency
'SSZipArchive'
,
'>= 1'
#dependency 'ASIHTTPRequest', '1.8'
#
dependency 'ASIWebPageRequest', '= 1.8'
dependency
'ASIWebPageRequest'
,
'= 1.8'
# is part of ASIHTTPRequest 1.8 and 1.8.1
dependency
'Reachability'
#, '>= 2.0'
...
...
lib/cocoa_pods.rb
View file @
eed0a91f
...
...
@@ -6,6 +6,7 @@ module Pod
autoload
:Config
,
'cocoa_pods/config'
autoload
:Dependency
,
'cocoa_pods/dependency'
autoload
:Downloader
,
'cocoa_pods/downloader'
autoload
:Executable
,
'cocoa_pods/executable'
autoload
:Installer
,
'cocoa_pods/installer'
autoload
:Resolver
,
'cocoa_pods/resolver'
autoload
:Source
,
'cocoa_pods/source'
...
...
@@ -19,7 +20,6 @@ module Pod
end
autoload
:Pathname
,
'pathname'
autoload
:Executioner
,
'executioner'
end
class
Pathname
...
...
lib/cocoa_pods/command.rb
View file @
eed0a91f
...
...
@@ -40,6 +40,7 @@ module Pod
def
self
.
options
" --help Show help information
\n
"
+
" --silent Print nothing
\n
"
+
" --verbose Print more information while working"
end
...
...
@@ -59,6 +60,7 @@ module Pod
def
self
.
parse
(
*
argv
)
argv
=
ARGV
.
new
(
argv
)
show_help
=
argv
.
option
(
'--help'
)
Config
.
instance
.
silent
=
argv
.
option
(
'--silent'
)
Config
.
instance
.
verbose
=
argv
.
option
(
'--verbose'
)
command_class
=
case
argv
.
shift_argument
...
...
lib/cocoa_pods/command/repo.rb
View file @
eed0a91f
require
'executioner'
require
'fileutils'
module
Pod
...
...
@@ -23,7 +22,7 @@ module Pod
Changes the current working dir to the local spec-repo `NAME'.}
end
include
Executioner
extend
Executable
executable
:git
def
initialize
(
argv
)
...
...
lib/cocoa_pods/downloader.rb
View file @
eed0a91f
...
...
@@ -16,11 +16,7 @@ module Pod
end
class
Git
<
Downloader
require
'executioner'
include
Executioner
# TODO make Executioner:
# * not raise when there's output to either stdout/stderr, but check exit status
# * sync output
extend
Executable
executable
:git
def
download
...
...
@@ -38,16 +34,16 @@ module Pod
Dir
.
chdir
(
@pod_root
)
do
git
"init"
git
"remote add origin '
#{
@url
}
'"
git
"fetch origin tags/
#{
@options
[
:tag
]
}
2>&1
"
git
"fetch origin tags/
#{
@options
[
:tag
]
}
"
git
"reset --hard FETCH_HEAD"
git
"checkout -b activated-pod-commit
2>&1
"
git
"checkout -b activated-pod-commit"
end
end
def
download_commit
git
"clone '
#{
@url
}
' '
#{
@pod_root
}
'"
Dir
.
chdir
(
@pod_root
)
do
git
"checkout -b activated-pod-commit
#{
@options
[
:commit
]
}
2>&1
"
git
"checkout -b activated-pod-commit
#{
@options
[
:commit
]
}
"
end
end
...
...
lib/cocoa_pods/executable.rb
0 → 100644
View file @
eed0a91f
module
Pod
module
Executable
def
executable
(
name
)
define_method
(
name
)
do
|
command
|
if
Config
.
instance
.
verbose?
`
#{
name
}
#{
command
}
1>&2`
else
`
#{
name
}
#{
command
}
2> /dev/null`
end
end
end
end
end
spec/spec_helper/git.rb
View file @
eed0a91f
require
'spec_helper/temporary_directory'
require
'executioner'
module
SpecHelper
def
self
.
tmp_repos_path
...
...
@@ -16,7 +15,7 @@ module SpecHelper
tmp_repos_path
+
'master'
end
include
Executioner
extend
Pod
::
Executable
executable
:git
alias_method
:git_super
,
:git
...
...
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