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
6bedfe0b
Commit
6bedfe0b
authored
Apr 15, 2012
by
Victor Ilyukevich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added subspecs into pod presenter [#164]
parent
17728443
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
3 deletions
+39
-3
presenter.rb
lib/cocoapods/command/presenter.rb
+12
-3
cocoa_pod.rb
lib/cocoapods/command/presenter/cocoa_pod.rb
+5
-0
specification.rb
lib/cocoapods/specification.rb
+16
-0
presenter_spec.rb
spec/functional/command/presenter_spec.rb
+6
-0
No files found.
lib/cocoapods/command/presenter.rb
View file @
6bedfe0b
...
@@ -29,6 +29,7 @@ module Pod
...
@@ -29,6 +29,7 @@ module Pod
result
<<
detail
(
'License'
,
pod
.
license
)
if
@stats
result
<<
detail
(
'License'
,
pod
.
license
)
if
@stats
result
<<
detail
(
'Watchers'
,
pod
.
github_watchers
)
if
@stats
result
<<
detail
(
'Watchers'
,
pod
.
github_watchers
)
if
@stats
result
<<
detail
(
'Forks'
,
pod
.
github_forks
)
if
@stats
result
<<
detail
(
'Forks'
,
pod
.
github_forks
)
if
@stats
result
<<
detail
(
'Sub specs'
,
pod
.
subspecs
)
result
result
end
end
...
@@ -40,12 +41,20 @@ module Pod
...
@@ -40,12 +41,20 @@ module Pod
txt
.
strip
.
gsub
(
/(.{1,
#{
col
}
})( +|$)\n?|(.{
#{
col
}
})/
,
indent
+
"
\\
1
\\
3
\n
"
)
txt
.
strip
.
gsub
(
/(.{1,
#{
col
}
})( +|$)\n?|(.{
#{
col
}
})/
,
indent
+
"
\\
1
\\
3
\n
"
)
end
end
def
detail
(
title
,
string
,
preferred_indentation
=
8
)
def
detail
(
title
,
value
,
preferred_indentation
=
8
)
# 8 is the length of Homepage
# 8 is the length of Homepage
return
''
if
!
string
return
''
if
!
value
number_of_spaces
=
((
preferred_indentation
-
title
.
length
)
>
0
)
?
(
preferred_indentation
-
title
.
length
)
:
0
number_of_spaces
=
((
preferred_indentation
-
title
.
length
)
>
0
)
?
(
preferred_indentation
-
title
.
length
)
:
0
spaces
=
' '
*
number_of_spaces
spaces
=
' '
*
number_of_spaces
" -
#{
title
}
:
#{
spaces
+
string
}
\n
"
''
.
tap
do
|
t
|
t
<<
" -
#{
title
}
:"
if
value
.
class
==
Array
separator
=
"
\n
- "
t
<<
separator
+
value
.
join
(
separator
)
else
t
<<
"
#{
spaces
+
value
}
\n
"
end
end
end
end
end
end
end
end
...
...
lib/cocoapods/command/presenter/cocoa_pod.rb
View file @
6bedfe0b
...
@@ -52,6 +52,11 @@ module Pod
...
@@ -52,6 +52,11 @@ module Pod
spec
.
license
[
:type
]
if
spec
.
license
spec
.
license
[
:type
]
if
spec
.
license
end
end
# will return array of all subspecs (recursevly) or nil
def
subspecs
(
spec
.
recursive_subspecs
.
any?
&&
spec
.
recursive_subspecs
)
||
nil
end
# Statistics information
# Statistics information
def
creation_date
def
creation_date
Pod
::
Specification
::
Statistics
.
instance
.
creation_date
(
@set
)
Pod
::
Specification
::
Statistics
.
instance
.
creation_date
(
@set
)
...
...
lib/cocoapods/specification.rb
View file @
6bedfe0b
...
@@ -129,6 +129,22 @@ module Pod
...
@@ -129,6 +129,22 @@ module Pod
end
end
attr_reader
:subspecs
attr_reader
:subspecs
def
recursive_subspecs
unless
@recursive_subspecs
begin
mapper
=
lambda
do
|
spec
|
spec
.
subspecs
.
map
do
|
subspec
|
[
subspec
,
*
mapper
.
call
(
subspec
)]
end
.
flatten
end
@recursive_subspecs
=
mapper
.
call
self
rescue
StandardError
@recursive_subspecs
=
[]
end
end
@recursive_subspecs
end
### Attributes **with** multiple platform support
### Attributes **with** multiple platform support
class
PlatformProxy
class
PlatformProxy
...
...
spec/functional/command/presenter_spec.rb
View file @
6bedfe0b
...
@@ -32,5 +32,11 @@ describe Pod::Command::Presenter do
...
@@ -32,5 +32,11 @@ describe Pod::Command::Presenter do
output
.
should
.
include?
'Watchers: 318'
output
.
should
.
include?
'Watchers: 318'
output
.
should
.
include?
'Forks: 42'
output
.
should
.
include?
'Forks: 42'
end
end
it
"should print at least one subspec"
do
presenter
=
Presenter
.
new
(
argv
())
output
=
presenter
.
describe
(
Pod
::
Spec
::
Set
.
new
(
fixture
(
'spec-repos/master/RestKit'
)))
output
.
should
.
include?
"RestKit/Network"
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