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
1997d9bc
Commit
1997d9bc
authored
Apr 14, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed spec and other minor fixes for pod spec create
parent
20613c18
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
spec.rb
lib/cocoapods/command/spec.rb
+4
-5
command_spec.rb
spec/functional/command_spec.rb
+3
-3
No files found.
lib/cocoapods/command/spec.rb
View file @
1997d9bc
require
'net/https'
require
'net/https'
require
'uri'
require
'uri'
require
'octokit'
require
'octokit'
require
'awesome_print'
require
'json'
require
'json'
module
Pod
module
Pod
...
@@ -36,7 +35,7 @@ module Pod
...
@@ -36,7 +35,7 @@ module Pod
end
end
def
create
def
create
if
repo_id
=
@name_or_url
[
/github.com\/(
.*\/.*)
/
,
1
]
if
repo_id
=
@name_or_url
[
/github.com\/(
[^\/]*\/[^\/]*).*
/
,
1
]
data
=
github_data_for_template
(
repo_id
)
data
=
github_data_for_template
(
repo_id
)
puts
semantic_versioning_notice
(
repo_id
,
data
[
:name
])
if
data
[
:tag
]
==
'HEAD'
puts
semantic_versioning_notice
(
repo_id
,
data
[
:name
])
if
data
[
:tag
]
==
'HEAD'
else
else
...
@@ -74,8 +73,8 @@ module Pod
...
@@ -74,8 +73,8 @@ module Pod
clean_tag
=
tag
.
gsub
(
/^v(er)? ?/
,
''
)
clean_tag
=
tag
.
gsub
(
/^v(er)? ?/
,
''
)
versions_tags
[
Gem
::
Version
.
new
(
clean_tag
)]
=
tag
if
Gem
::
Version
.
correct?
(
clean_tag
)
versions_tags
[
Gem
::
Version
.
new
(
clean_tag
)]
=
tag
if
Gem
::
Version
.
correct?
(
clean_tag
)
end
end
version
=
versions_tags
.
keys
.
sort
.
last
||
'
HEAD
'
version
=
versions_tags
.
keys
.
sort
.
last
||
'
0.0.1
'
tag
=
version
==
'
HEAD'
?
'0.0.1
'
:
versions_tags
[
version
]
tag
=
version
==
'
0.0.1'
?
'HEAD
'
:
versions_tags
[
version
]
[
tag
,
version
.
to_s
]
[
tag
,
version
.
to_s
]
end
end
...
@@ -102,7 +101,7 @@ module Pod
...
@@ -102,7 +101,7 @@ module Pod
data
=
{}
data
=
{}
data
[
:name
]
=
name
data
[
:name
]
=
name
data
[
:version
]
=
'0.0.1'
data
[
:version
]
=
'0.0.1'
data
[
:summary
]
=
'A short description of #{name}.'
data
[
:summary
]
=
"A short description of
#{
name
}
."
data
[
:homepage
]
=
"http://EXAMPLE/
#{
name
}
"
data
[
:homepage
]
=
"http://EXAMPLE/
#{
name
}
"
data
[
:author_name
]
=
`git config --get user.name`
.
strip
data
[
:author_name
]
=
`git config --get user.name`
.
strip
data
[
:author_email
]
=
`git config --get user.email`
.
strip
data
[
:author_email
]
=
`git config --get user.email`
.
strip
...
...
spec/functional/command_spec.rb
View file @
1997d9bc
...
@@ -54,11 +54,11 @@ describe "Pod::Command" do
...
@@ -54,11 +54,11 @@ describe "Pod::Command" do
spec
=
Pod
::
Specification
.
from_file
(
path
)
spec
=
Pod
::
Specification
.
from_file
(
path
)
spec
.
name
.
should
==
'Bananas'
spec
.
name
.
should
==
'Bananas'
spec
.
license
.
should
==
{
:type
=>
"MIT"
,
:file
=>
"LICENSE"
}
spec
.
license
.
should
==
{
:type
=>
"MIT"
,
:file
=>
"LICENSE"
}
spec
.
version
.
should
==
Pod
::
Version
.
new
(
'
1.0.0
'
)
spec
.
version
.
should
==
Pod
::
Version
.
new
(
'
0.0.1
'
)
spec
.
summary
.
should
==
'A short description of Bananas.'
spec
.
summary
.
should
==
'A short description of Bananas.'
spec
.
homepage
.
should
==
'http://EXAMPLE/Bananas'
spec
.
homepage
.
should
==
'http://EXAMPLE/Bananas'
spec
.
authors
.
should
==
{
`git config --get user.name`
.
strip
=>
`git config --get user.email`
.
strip
,
"other author"
=>
"and email address"
}
spec
.
authors
.
should
==
{
`git config --get user.name`
.
strip
=>
`git config --get user.email`
.
strip
}
spec
.
source
.
should
==
{
:git
=>
'http://EXAMPLE/Bananas.git'
,
:tag
=>
'
1.0.0
'
}
spec
.
source
.
should
==
{
:git
=>
'http://EXAMPLE/Bananas.git'
,
:tag
=>
'
0.0.1
'
}
spec
.
description
.
should
==
'An optional longer description of Bananas.'
spec
.
description
.
should
==
'An optional longer description of Bananas.'
spec
.
source_files
.
should
==
[
'Classes'
,
'Classes/**/*.{h,m}'
]
spec
.
source_files
.
should
==
[
'Classes'
,
'Classes/**/*.{h,m}'
]
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