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
b3a77a6f
Commit
b3a77a6f
authored
Aug 05, 2014
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PrefixHeader] Style fixes
parent
2ef0db19
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
13 deletions
+15
-13
prefix_header.rb
lib/cocoapods/generator/prefix_header.rb
+14
-12
prefix_header_spec.rb
spec/unit/generator/prefix_header_spec.rb
+1
-1
No files found.
lib/cocoapods/generator/prefix_header.rb
View file @
b3a77a6f
...
...
@@ -9,18 +9,18 @@ module Pod
#
class
PrefixHeader
# @return [
Platform] the platform for which the prefix header will b
e
#
generated
.
# @return [
Array<FileAccessor>] The file accessors for which to generat
e
#
the prefix header
.
#
attr_reader
:file_accessors
attr_reader
:platform
# @return [
Array<LocalPod>] the LocalPod for the target for which th
e
#
prefix header needs to be
generated.
# @return [
Platform] the platform for which the prefix header will b
e
# generated.
#
# attr_reader :consumers
attr_reader
:platform
# @return [Array<String>] any header to import (with quotes).
# @return [Array<String>] The list of the headers to import (with
# quotes).
#
attr_reader
:imports
...
...
@@ -40,12 +40,14 @@ module Pod
# added to the top of the prefix header. For OS X `Cocoa/Cocoa.h`
# is imported.
#
# @note Only unique prefix_header_contents are added to the prefix header.
# @note Only unique prefix_header_contents are added to the prefix
# header.
#
# @return [String]
#
# @todo Subspecs can specify prefix header information too.
# @todo Check to see if we have a similar duplication issue with file_accessor.prefix_header.
# @todo Check to see if we have a similar duplication issue with
# file_accessor.prefix_header.
#
def
generate
result
=
"#ifdef __OBJC__
\n
"
...
...
@@ -59,14 +61,14 @@ module Pod
unique_prefix_header_contents
=
file_accessors
.
collect
do
|
file_accessor
|
file_accessor
.
spec_consumer
.
prefix_header_contents
end
.
compact
.
uniq
result
<<
"
\n
"
unique_prefix_header_contents
.
each
do
|
prefix_header_contents
|
result
<<
prefix_header_contents
result
<<
"
\n
"
end
file_accessors
.
each
do
|
file_accessor
|
if
prefix_header
=
file_accessor
.
prefix_header
result
<<
Pathname
(
prefix_header
).
read
...
...
spec/unit/generator/prefix_header_spec.rb
View file @
b3a77a6f
...
...
@@ -44,7 +44,7 @@ module Pod
@spec
.
subspec
'UI'
do
|
su
|
su
.
source_files
=
'Source/UI/*.{h,m}'
end
@spec
.
subspec
'Helpers'
do
|
sh
|
sh
.
source_files
=
'Source/Helpers/*.{h,m}'
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