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
fd03adf9
Commit
fd03adf9
authored
Oct 10, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Linter/Push] Properly singularize words in output.
Closes #550.
parent
e05f59fc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
push.rb
lib/cocoapods/command/push.rb
+10
-3
spec.rb
lib/cocoapods/command/spec.rb
+3
-1
No files found.
lib/cocoapods/command/push.rb
View file @
fd03adf9
require
'fileutils'
require
'fileutils'
require
'active_support/core_ext/string/inflections'
module
Pod
module
Pod
class
Command
class
Command
...
@@ -66,12 +67,18 @@ module Pod
...
@@ -66,12 +67,18 @@ module Pod
def
podspec_files
def
podspec_files
files
=
Pathname
.
glob
(
@podspec
||
"*.podspec"
)
files
=
Pathname
.
glob
(
@podspec
||
"*.podspec"
)
raise
Informative
,
"[!] Couldn't find .podspec file in current directory"
.
red
if
files
.
empty?
raise
Informative
,
"[!] Couldn't find
any
.podspec file in current directory"
.
red
if
files
.
empty?
files
files
end
end
# @return [Integer] The number of the podspec files to push.
#
def
count
podspec_files
.
count
end
def
validate_podspec_files
def
validate_podspec_files
UI
.
puts
"
\n
Validating
specs
"
.
yellow
unless
config
.
silent
UI
.
puts
"
\n
Validating
#{
'spec'
.
pluralize
(
count
)
}
"
.
yellow
unless
config
.
silent
lint_argv
=
[
"lint"
]
lint_argv
=
[
"lint"
]
lint_argv
<<
"--only-errors"
if
@allow_warnings
lint_argv
<<
"--only-errors"
if
@allow_warnings
lint_argv
<<
"--silent"
if
config
.
silent
lint_argv
<<
"--silent"
if
config
.
silent
...
@@ -82,7 +89,7 @@ module Pod
...
@@ -82,7 +89,7 @@ module Pod
end
end
def
add_specs_to_repo
def
add_specs_to_repo
UI
.
puts
"
\n
Adding the
specs to the
#{
@repo
}
repo
\n
"
.
yellow
unless
config
.
silent
UI
.
puts
"
\n
Adding the
#{
'spec'
.
pluralize
(
count
)
}
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
)
...
...
lib/cocoapods/command/spec.rb
View file @
fd03adf9
# encoding: utf-8
# encoding: utf-8
require
'active_support/core_ext/string/inflections'
module
Pod
module
Pod
class
Command
class
Command
class
Spec
<
Command
class
Spec
<
Command
...
@@ -104,8 +106,8 @@ module Pod
...
@@ -104,8 +106,8 @@ module Pod
UI
.
puts
unless
config
.
silent?
UI
.
puts
unless
config
.
silent?
end
end
UI
.
puts
"Analyzed
#{
podspecs_to_lint
.
count
}
podspecs files.
\n\n
"
unless
config
.
silent?
count
=
podspecs_to_lint
.
count
count
=
podspecs_to_lint
.
count
UI
.
puts
"Analyzed
#{
count
}
#{
'podspec'
.
pluralize
(
count
)
}
.
\n\n
"
unless
config
.
silent?
if
invalid_count
==
0
if
invalid_count
==
0
lint_passed_message
=
count
==
1
?
"
#{
podspecs_to_lint
.
first
.
basename
}
passed validation."
:
"All the specs passed validation."
lint_passed_message
=
count
==
1
?
"
#{
podspecs_to_lint
.
first
.
basename
}
passed validation."
:
"All the specs passed validation."
UI
.
puts
lint_passed_message
.
green
<<
"
\n\n
"
unless
config
.
silent?
UI
.
puts
lint_passed_message
.
green
<<
"
\n\n
"
unless
config
.
silent?
...
...
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