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
fb637f2f
Commit
fb637f2f
authored
Apr 26, 2012
by
Will Pragnell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed all single quotes to double quotes (OCD?)
parent
b72322f3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
24 deletions
+24
-24
acknowledgements.rb
lib/cocoapods/generator/acknowledgements.rb
+11
-11
acknowledgements_spec.rb
spec/unit/generator/acknowledgements_spec.rb
+13
-13
No files found.
lib/cocoapods/generator/acknowledgements.rb
View file @
fb637f2f
...
...
@@ -2,7 +2,7 @@ module Pod
module
Generator
class
Acknowledgements
require
'xcodeproj/xcodeproj_ext'
require
"xcodeproj/xcodeproj_ext"
def
initialize
(
target_definition
,
pods
)
@target_definition
,
@pods
=
target_definition
,
pods
...
...
@@ -14,8 +14,8 @@ module Pod
def
plist
{
:Title
=>
'Acknowledgements'
,
:StringsTable
=>
'Acknowledgements'
,
:Title
=>
"Acknowledgements"
,
:StringsTable
=>
"Acknowledgements"
,
:PreferenceSpecifiers
=>
licenses
}
end
...
...
@@ -29,18 +29,18 @@ module Pod
def
hash_for_pod
(
pod
)
if
(
license
=
pod
.
license
)
license_hash
=
{
:Type
=>
'PSGroupSpecifier'
,
:Type
=>
"PSGroupSpecifier"
,
:Title
=>
pod
.
name
,
:FooterText
=>
license
[
:text
]
}
else
puts
'[!] No licence for #{pod.name}'
puts
"[!] No licence for
#{
pod
.
name
}
"
end
end
def
header
{
:Type
=>
'PSGroupSpecifier'
,
:Type
=>
"PSGroupSpecifier"
,
:Title
=>
header_title
,
:FooterText
=>
header_text
}
...
...
@@ -48,26 +48,26 @@ module Pod
def
footnote
{
:Type
=>
'PSGroupSpecifier'
,
:Type
=>
"PSGroupSpecifier"
,
:Title
=>
footnote_title
,
:FooterText
=>
footnote_text
}
end
def
header_title
'Acknowledgements'
"Acknowledgements"
end
def
header_text
'This application uses the following third party software:'
"This application uses the following third party software:"
end
def
footnote_title
''
""
end
def
footnote_text
'Generated by CocoaPods'
"Generated by CocoaPods"
end
end
end
...
...
spec/unit/generator/acknowledgements_spec.rb
View file @
fb637f2f
require
File
.
expand_path
(
'../../../spec_helper'
,
__FILE__
)
require
File
.
expand_path
(
"../../../spec_helper"
,
__FILE__
)
describe
Pod
::
Generator
::
Acknowledgements
do
before
do
@podfile
=
Pod
::
Podfile
.
new
do
platform
:ios
xcodeproj
'dummy'
xcodeproj
"dummy"
end
@target_definition
=
@podfile
.
target_definitions
[
:default
]
@sandbox
=
temporary_sandbox
@pods
=
[
Pod
::
LocalPod
.
new
(
fixture_spec
(
'banana-lib/BananaLib.podspec'
),
@sandbox
,
Pod
::
Platform
.
ios
)]
copy_fixture_to_pod
(
'banana-lib'
,
@pods
[
0
])
@pods
=
[
Pod
::
LocalPod
.
new
(
fixture_spec
(
"banana-lib/BananaLib.podspec"
),
@sandbox
,
Pod
::
Platform
.
ios
)]
copy_fixture_to_pod
(
"banana-lib"
,
@pods
[
0
])
@acknowledgements
=
Pod
::
Generator
::
Acknowledgements
.
new
(
@target_definition
,
@pods
)
end
it
'returns the corrent number of licenses (including headera and footnote)'
do
it
"returns the corrent number of licenses (including headera and footnote)"
do
@acknowledgements
.
licenses
.
count
.
should
==
3
end
it
'returns a correctly formed license hash for each pod'
do
it
"returns a correctly formed license hash for each pod"
do
@acknowledgements
.
hash_for_pod
(
@pods
[
0
]).
should
==
{
:Type
=>
'PSGroupSpecifier'
,
:Title
=>
'BananaLib'
,
:FooterText
=>
'Permission is hereby granted ...'
:Type
=>
"PSGroupSpecifier"
,
:Title
=>
"BananaLib"
,
:FooterText
=>
"Permission is hereby granted ..."
}
end
it
'returns a plist containg the licenses'
do
it
"returns a plist containg the licenses"
do
@acknowledgements
.
plist
.
should
==
{
:Title
=>
'Acknowledgements'
,
:StringsTable
=>
'Acknowledgements'
,
:Title
=>
"Acknowledgements"
,
:StringsTable
=>
"Acknowledgements"
,
:PreferenceSpecifiers
=>
@acknowledgements
.
licenses
}
end
it
'writes a plist to disk'
do
it
"writes a plist to disk"
do
@acknowledgements
.
save_as
(
@sandbox
.
root
+
'test.plist'
).
should
.
be
.
true
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