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
edea0a11
Commit
edea0a11
authored
Aug 10, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Version] Updated #to_s and added Version.from_s.
parent
584c2b3c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
9 deletions
+16
-9
specification.rb
lib/cocoapods/specification.rb
+1
-7
version.rb
lib/cocoapods/version.rb
+15
-2
No files found.
lib/cocoapods/specification.rb
View file @
edea0a11
...
@@ -447,13 +447,7 @@ module Pod
...
@@ -447,13 +447,7 @@ module Pod
end
end
def
to_s
def
to_s
if
!
version
version
?
"
#{
name
}
(
#{
version
}
)"
:
name
name
elsif
version
.
head?
"
#{
name
}
(HEAD from
#{
version
}
)"
else
"
#{
name
}
(
#{
version
}
)"
end
end
end
def
inspect
def
inspect
...
...
lib/cocoapods/version.rb
View file @
edea0a11
module
Pod
module
Pod
class
Version
<
Gem
::
Version
class
Version
<
Gem
::
Version
# @returns A Version described by its #to_s method.
#
def
self
.
from_s
(
string
)
match
=
string
.
match
(
/HEAD from (.*)/
)
string
=
match
[
1
]
if
match
vers
=
Version
.
new
(
string
)
vers
.
head
=
true
if
match
vers
end
attr_accessor
:head
attr_accessor
:head
alias_method
:head?
,
:head
alias_method
:head?
,
:head
def
to_s
head?
?
"HEAD from
#{
super
}
"
:
super
end
end
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