Skip to content

Commit

Permalink
Support exclamation marks in Gemfile.lock (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
lackstein authored and elldritch committed Aug 24, 2018
1 parent 8e28232 commit 7d8509c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions buildtools/bundler/lockfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ func (r *Requirement) String() string {
return s
}

// ^(leading whitespace)(name)(optional: space + (version specifier) within parentheses)$
var requirementsRegex = regexp.MustCompile("^( *?)(\\S+?)( \\((.*?)\\))?$")
// ^(leading whitespace)(name)(optional: exclamation mark or (space + (version specifier) within parentheses (optional: exclamation mark)))$
var requirementsRegex = regexp.MustCompile("^( *?)(\\S+?)(?:\\!?|( \\((.*?)\\)\\!?)?)$")

// TODO: actually parse these. We ignore them right now, so I haven't bothered
// implementing parsing logic.
Expand Down
4 changes: 2 additions & 2 deletions buildtools/bundler/testdata/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ GEM
concurrent-ruby (1.0.5)
concurrent-ruby (1.0.5-java)
connection_pool (2.2.2)
cookiejar (0.3.3)
cookiejar (0.3.3)!
crass (1.0.4)
curses (1.0.2)
daemons (1.2.6)
Expand Down Expand Up @@ -289,7 +289,7 @@ GEM
jwt (2.1.0)
kindlerb (1.2.0)
mustache
nokogiri
nokogiri!
libxml-ruby (3.1.0)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
Expand Down

0 comments on commit 7d8509c

Please sign in to comment.