Skip to content

Commit

Permalink
fixed regex for cases when ".freeze" is included
Browse files Browse the repository at this point in the history
  • Loading branch information
Serge Hänni committed Feb 2, 2017
1 parent e263079 commit 7f772d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/metric_fu/gem_version.rb
Expand Up @@ -12,7 +12,7 @@ class GemVersion
REQUIREMENT_LIST = /(?<qr1>["'])(?<req1>#{REQUIREMENT})\k<qr1>(?:[ \t]*,[ \t]*(?<qr2>["'])(?<req2>#{REQUIREMENT})\k<qr2>)?/
REQUIREMENTS = /(?:#{REQUIREMENT_LIST}|\[[ \t]*#{REQUIREMENT_LIST}[ \t]*\])/
COMMENT = /(#[^\n]*)?/
ADD_DEPENDENCY_CALL = /^[ \t]*\w+\.add(?<type>_runtime|_development)?_dependency\(?[ \t]*#{QUOTED_GEM_NAME}(?:[ \t]*,[ \t]*#{REQUIREMENTS})?[ \t]*\)?[ \t]*#{COMMENT}$/
ADD_DEPENDENCY_CALL = /^[ \t]*\w+\.add(?<type>_runtime|_development)?_dependency\(?[ \t]*#{QUOTED_GEM_NAME}(.freeze)?(?:[ \t]*,[ \t]*#{REQUIREMENTS})?[ \t]*\)?[ \t]*#{COMMENT}$/

def initialize
@gem_spec = File.open(gemspec, "rb") { |f| f.readlines }
Expand Down

0 comments on commit 7f772d6

Please sign in to comment.