Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow parentheses in gemfile gemspec method calls

  • Loading branch information...
commit f6376e36030351595b2d585d1b9ce76aa13cacea 1 parent 13854f8
@laserlemon laserlemon authored
View
2  lib/gemnasium/parser/patterns.rb
@@ -29,7 +29,7 @@ module Patterns
PATH_CALL = /^(?<i1>\s*)path[\s\(].*?do\s*?\n(?<blk>.*?)\n^\k<i1>end\s*$/m
- GEMSPEC_CALL = /^\s*gemspec(?:\s+(?<opts>#{OPTIONS}))?\s*$/
+ GEMSPEC_CALL = /^\s*gemspec(?:\(?\s*(?<opts>#{OPTIONS}))?\s*\)?\s*$/
ADD_DEPENDENCY_CALL = /^\s*\w+\.add(?<type>_runtime|_development)?_dependency\(?\s*(?<q1>["'])(?<name>#{GEM_NAME})\k<q1>(?:\s*,\s*#{REQUIREMENTS})?\s*\)?\s*$/
View
5 spec/gemnasium/parser/gemfile_spec.rb
@@ -86,6 +86,11 @@ def reset
gemfile.gemspec.should == "lib/gemnasium/parser.gemspec"
end
+ it "parses gemspecs with parentheses" do
+ content(%(gemspec(:name => "gemnasium-parser")))
+ gemfile.should be_gemspec
+ end
+
it "parses gems of a type" do
content(%(gem "rake"))
dependency.type.should == :runtime
Please sign in to comment.
Something went wrong with that request. Please try again.