Skip to content

Commit

Permalink
Merge pull request #291 from CocoaPods/seg-dependency-from-string-head
Browse files Browse the repository at this point in the history
[Dependency] Allow creating from a string that has HEAD info
  • Loading branch information
segiddins committed Jan 5, 2016
2 parents 4ea0658 + 1e6dc77 commit f1b6ae5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## Master

##### Enhancements

* Dependencies created from a string that use the `HEAD` specifier are properly
parsed, ignoring the obsolete specifier.
[Samuel Giddins](https://github.com/segiddins)
[CocoaPods#4710](https://github.com/CocoaPods/CocoaPods/issues/4710)

##### Bug Fixes

* Fix specifying `configuration(s)` for a pod inside a target block.
Expand Down
5 changes: 5 additions & 0 deletions lib/cocoapods-core/dependency.rb
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,8 @@ def to_s
# part by clients that need to create a dependency equal to the
# original one.
#
# @todo Remove the `HEAD` code once everyone has migrated past 1.0.
#
# @return [Dependency] the dependency described by the string.
#
def self.from_string(string)
Expand All @@ -348,6 +350,9 @@ def self.from_string(string)
version = match_data[2]
version = version.gsub(/[()]/, '') if version
case version
when ' HEAD'
CoreUI.warn "Ignoring obsolete `HEAD` specifier in `#{string}`"
Dependency.new(name)
when nil, /from `(.*)(`|')/
Dependency.new(name)
else
Expand Down

0 comments on commit f1b6ae5

Please sign in to comment.