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
fb8684c0
Commit
fb8684c0
authored
Nov 19, 2011
by
Eloy Duran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve `pod spec create' stub. Closes #71.
parent
40dcc859
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
10 deletions
+71
-10
spec.rb
lib/cocoapods/command/spec.rb
+69
-6
command_spec.rb
spec/functional/command_spec.rb
+2
-4
No files found.
lib/cocoapods/command/spec.rb
View file @
fb8684c0
...
...
@@ -31,24 +31,87 @@ module Pod
author
=
`git config --get user.name`
.
strip
email
=
`git config --get user.email`
.
strip
spec
=
<<-
SPEC
.
gsub
(
/^ /
,
''
)
#
# Be sure to run `pod lint
#{
@name
}
.podspec' to ensure this is a
# valid spec.
#
# Remove all comments before submitting the spec.
#
Pod::Spec.new do |s|
s.name = '
#{
@name
}
'
s.version = '1.0.0'
s.license = 'MIT'
s.summary = 'A short description of
#{
@name
}
.'
s.homepage = 'http://
example.com
/
#{
@name
}
'
s.homepage = 'http://
EXAMPLE
/
#{
@name
}
'
s.author = { '
#{
author
}
' => '
#{
email
}
' }
s.source = { :git => 'http://example.com/
#{
@name
}
.git', :tag => '1.0.0' }
# Specify the location from where the source should be retreived.
#
s.source = { :git => 'http://EXAMPLE/
#{
@name
}
.git', :tag => '1.0.0' }
# s.source = { :svn => 'http://EXAMPLE/
#{
@name
}
/tags/1.0.0' }
# s.source = { :hg => 'http://EXAMPLE/
#{
@name
}
', :revision => '1.0.0' }
s.description = 'An optional longer description of
#{
@name
}
.'
# A list of file patterns. If the pattern is a directory then the path will
# automatically have '*.{h,m,mm,c,cpp}' appended.
# If this Pod runs only on iOS or OS X, then specify that with one of
# these, or none if it runs on both platforms.
#
# s.platform = :ios
# s.platform = :osx
# A list of file patterns which select the source files that should be
# added to the Pods project. If the pattern is a directory then the
# path will automatically have '*.{h,m,mm,c,cpp}' appended.
#
# Alternatively, you can use the FileList class for even more control
# over the selected files.
# (See http://rake.rubyforge.org/classes/Rake/FileList.html.)
#
s.source_files = 'Classes', 'Classes/**/*.{h,m}'
s.framework = 'SomeRequiredFramework'
# A list of resources included with the Pod. These are copied into the
# target bundle with a build phase script.
#
# Also allows the use of the FileList class like `source_files does.
#
# s.resource = "icon.png"
# s.resources = "Resources/*.png"
# A list of paths to remove after installing the Pod without the
# `--no-clean' option. These can be examples, docs, and any other type
# of files that are not needed to build the Pod.
#
# *NOTE*: Never remove license and README files.
#
# Also allows the use of the FileList class like `source_files does.
#
# s.clean_path = "examples"
# s.clean_paths = "examples", "doc"
# Specify a list of frameworks that the application needs to link
# against for this Pod to work.
#
# s.framework = 'SomeFramework'
# s.frameworks = 'SomeFramework', 'AnotherFramework'
# Specify a list of libraries that the application needs to link
# against for this Pod to work.
#
# s.library = 'iconv'
# s.libraries = 'iconv', 'xml2'
# If this Pod uses ARC, specify it like so.
#
# s.requires_arc = true
# If you need to specify any other build settings, add them to the
# xcconfig hash.
#
# s.xcconfig = { 'HEADER_SEARCH_PATHS' => '$(SDKROOT)/usr/include/libxml2' }
s.dependency 'SomeLibraryThat
#{
@name
}
DependsOn', '>= 1.0.0'
# Finally, specify any Pods that this Pod depends on.
#
# s.dependency 'JSONKit', '~> 1.4'
end
SPEC
(
Pathname
.
pwd
+
"
#{
@name
}
.podspec"
).
open
(
'w'
)
{
|
f
|
f
<<
spec
}
...
...
spec/functional/command_spec.rb
View file @
fb8684c0
...
...
@@ -56,13 +56,11 @@ describe "Pod::Command" do
spec
.
license
.
should
==
'MIT'
spec
.
version
.
should
==
Pod
::
Version
.
new
(
'1.0.0'
)
spec
.
summary
.
should
==
'A short description of Bananas.'
spec
.
homepage
.
should
==
'http://
example.com
/Bananas'
spec
.
homepage
.
should
==
'http://
EXAMPLE
/Bananas'
spec
.
authors
.
should
==
{
`git config --get user.name`
.
strip
=>
`git config --get user.email`
.
strip
}
spec
.
source
.
should
==
{
:git
=>
'http://
example.com
/Bananas.git'
,
:tag
=>
'1.0.0'
}
spec
.
source
.
should
==
{
:git
=>
'http://
EXAMPLE
/Bananas.git'
,
:tag
=>
'1.0.0'
}
spec
.
description
.
should
==
'An optional longer description of Bananas.'
spec
.
source_files
.
should
==
[
'Classes'
,
'Classes/**/*.{h,m}'
]
spec
.
xcconfig
.
to_hash
.
should
==
{
'OTHER_LDFLAGS'
=>
'-framework SomeRequiredFramework'
}
spec
.
dependencies
.
should
==
[
Pod
::
Dependency
.
new
(
'SomeLibraryThatBananasDependsOn'
,
'>= 1.0.0'
)]
end
before
do
...
...
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