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
deb70fb0
Commit
deb70fb0
authored
Apr 23, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Pod::Command::Push] --allow-warnings option
parent
f014c9d6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
14 deletions
+16
-14
push.rb
lib/cocoapods/command/push.rb
+14
-12
spec.rb
lib/cocoapods/command/spec.rb
+2
-2
No files found.
lib/cocoapods/command/push.rb
View file @
deb70fb0
...
@@ -6,24 +6,29 @@ module Pod
...
@@ -6,24 +6,29 @@ module Pod
def
self
.
banner
def
self
.
banner
%{Pushing new specifications to a spec-repo:
%{Pushing new specifications to a spec-repo:
$ pod push [REPO]
$ pod push [REPO]
Validates `*.podspec' in the current working dir, updates
Validates `*.podspec' in the current working dir, updates
the local copy of the repository named REPO, adds specifications
the local copy of the repository named REPO, adds specifications
to REPO, and finally it pushes REPO to its remote.}
to REPO, and finally it pushes REPO to its remote.}
end
def
self
.
options
[[
"--allow-warnings"
,
"Allows to push if warnings are not evitable"
]].
concat
(
super
)
end
end
extend
Executable
extend
Executable
executable
:git
executable
:git
def
initialize
(
argv
)
def
initialize
(
argv
)
@allow_warnings
=
argv
.
option
(
'--allow-warnings'
)
@repo
=
argv
.
shift_argument
@repo
=
argv
.
shift_argument
super
unless
argv
.
empty?
&&
@repo
super
unless
argv
.
empty?
&&
@repo
end
end
def
run
def
run
validate_podspec_files
!
validate_podspec_files
check_repo_status
!
check_repo_status
update_repo
update_repo
add_specs_to_repo
add_specs_to_repo
push_repo
push_repo
...
@@ -48,7 +53,7 @@ module Pod
...
@@ -48,7 +53,7 @@ module Pod
dir
dir
end
end
def
check_repo_status
!
def
check_repo_status
# TODO: add specs for staged and unstaged files (tested manually)
# TODO: add specs for staged and unstaged files (tested manually)
status
=
Dir
.
chdir
(
repo_dir
)
{
`git status --porcelain`
}
==
''
status
=
Dir
.
chdir
(
repo_dir
)
{
`git status --porcelain`
}
==
''
raise
Informative
,
"[!] `
#{
@repo
}
' repo not clean"
.
red
unless
status
raise
Informative
,
"[!] `
#{
@repo
}
' repo not clean"
.
red
unless
status
...
@@ -60,22 +65,19 @@ module Pod
...
@@ -60,22 +65,19 @@ module Pod
files
files
end
end
def
validate_podspec_files
!
def
validate_podspec_files
puts
"
\n
Validating specs"
.
yellow
unless
config
.
silent
puts
"
\n
Validating specs"
.
yellow
unless
config
.
silent
lint_argv
=
[
"lint"
]
lint_argv
=
[
"lint"
]
lint_argv
<<
"--only-errors"
if
@allow_warnings
lint_argv
<<
"--silent"
if
config
.
silent
lint_argv
<<
"--silent"
if
config
.
silent
all_valid
=
Spec
.
new
(
ARGV
.
new
(
lint_argv
)).
run
all_valid
=
Spec
.
new
(
ARGV
.
new
(
lint_argv
)).
run
raise
Informative
,
"[!] All specs must pass validation before push"
.
red
unless
all_valid
end
end
def
add_specs_to_repo
def
add_specs_to_repo
puts
"
\n
Adding the specs to the
#{
@repo
}
repo
\n
"
.
yellow
unless
config
.
silent
puts
"
\n
Adding the specs to the
#{
@repo
}
repo
\n
"
.
yellow
unless
config
.
silent
podspec_files
.
each
do
|
spec_file
|
podspec_files
.
each
do
|
spec_file
|
spec
=
Pod
::
Specification
.
from_file
(
spec_file
)
spec
=
Pod
::
Specification
.
from_file
(
spec_file
)
output_path
=
File
.
join
(
repo_dir
,
spec
.
name
,
spec
.
version
.
to_s
)
output_path
=
File
.
join
(
repo_dir
,
spec
.
name
,
spec
.
version
.
to_s
)
if
Pathname
.
new
(
output_path
).
exist?
if
Pathname
.
new
(
output_path
).
exist?
message
=
"[Fix]
#{
spec
}
"
message
=
"[Fix]
#{
spec
}
"
elsif
Pathname
.
new
(
File
.
join
(
repo_dir
,
spec
.
name
)).
exist?
elsif
Pathname
.
new
(
File
.
join
(
repo_dir
,
spec
.
name
)).
exist?
...
...
lib/cocoapods/command/spec.rb
View file @
deb70fb0
...
@@ -20,8 +20,8 @@ module Pod
...
@@ -20,8 +20,8 @@ module Pod
def
self
.
options
def
self
.
options
[
[
"--no-install"
,
"
l
int skips checks that would require to donwload the spec"
],
[
[
"--no-install"
,
"
L
int skips checks that would require to donwload the spec"
],
[
"--only-errors"
,
"
l
int validates even if warnings are present"
]
].
concat
(
super
)
[
"--only-errors"
,
"
L
int validates even if warnings are present"
]
].
concat
(
super
)
end
end
def
initialize
(
argv
)
def
initialize
(
argv
)
...
...
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