gemnasium-parser 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,5 +15,5 @@ Gem::Specification.new do |gem|
15
15
  gem.version = Gemnasium::Parser::VERSION
16
16
 
17
17
  gem.add_development_dependency "rake", ">= 0.8.7"
18
- gem.add_development_dependency "rspec", "~> 2.7"
18
+ gem.add_development_dependency "rspec", "~> 2.4"
19
19
  end
@@ -2,6 +2,7 @@ module Gemnasium
2
2
  module Parser
3
3
  module Patterns
4
4
  GEM_NAME = /[a-zA-Z0-9\-_]+/
5
+ QUOTED_GEM_NAME = /(?:(?<gq>["'])(?<name>#{GEM_NAME})\k<gq>|%q<(?<name>#{GEM_NAME})>)/
5
6
 
6
7
  MATCHER = /(?:=|!=|>|<|>=|<=|~>)/
7
8
  VERSION = /[0-9]+(?:\.[a-zA-Z0-9]+)*/
@@ -21,7 +22,7 @@ module Gemnasium
21
22
  OPTIONS = /#{PAIR}(?:[ \t]*,[ \t]*#{PAIR})*/
22
23
  COMMENT = /(#[^\n]*)?/
23
24
 
24
- GEM_CALL = /^[ \t]*gem\(?[ \t]*(?<q1>["'])(?<name>#{GEM_NAME})\k<q1>(?:[ \t]*,[ \t]*#{REQUIREMENT_LIST})?(?:[ \t]*,[ \t]*(?<opts>#{OPTIONS}))?[ \t]*\)?[ \t]*#{COMMENT}$/
25
+ GEM_CALL = /^[ \t]*gem\(?[ \t]*#{QUOTED_GEM_NAME}(?:[ \t]*,[ \t]*#{REQUIREMENT_LIST})?(?:[ \t]*,[ \t]*(?<opts>#{OPTIONS}))?[ \t]*\)?[ \t]*#{COMMENT}$/
25
26
 
26
27
  SYMBOLS = /#{SYMBOL}([ \t]*,[ \t]*#{SYMBOL})*/
27
28
  GROUP_CALL = /^(?<i1>[ \t]*)group\(?[ \t]*(?<grps>#{SYMBOLS})[ \t]*\)?[ \t]+do[ \t]*?\n(?<blk>[^\n]*?)\n^\k<i1>end[ \t]*$/m
@@ -32,7 +33,7 @@ module Gemnasium
32
33
 
33
34
  GEMSPEC_CALL = /^[ \t]*gemspec(?:\(?[ \t]*(?<opts>#{OPTIONS}))?[ \t]*\)?[ \t]*$/
34
35
 
35
- ADD_DEPENDENCY_CALL = /^[ \t]*\w+\.add(?<type>_runtime|_development)?_dependency\(?[ \t]*(?<q1>["'])(?<name>#{GEM_NAME})\k<q1>(?:[ \t]*,[ \t]*#{REQUIREMENTS})?[ \t]*\)?[ \t]*#{COMMENT}$/
36
+ ADD_DEPENDENCY_CALL = /^[ \t]*\w+\.add(?<type>_runtime|_development)?_dependency\(?[ \t]*#{QUOTED_GEM_NAME}(?:[ \t]*,[ \t]*#{REQUIREMENTS})?[ \t]*\)?[ \t]*#{COMMENT}$/
36
37
 
37
38
  def self.options(string)
38
39
  {}.tap do |hash|
@@ -1,5 +1,5 @@
1
1
  module Gemnasium
2
2
  module Parser
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.4"
4
4
  end
5
5
  end
@@ -248,4 +248,9 @@ describe Gemnasium::Parser::Gemfile do
248
248
  dependency.name.should == "rake"
249
249
  dependency.requirement.should == ">= 0.8.7"
250
250
  end
251
+
252
+ it "parses oddly quoted gems" do
253
+ content(%(gem %q<rake>))
254
+ dependency.name.should == "rake"
255
+ end
251
256
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gemnasium-parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-26 00:00:00.000000000Z
12
+ date: 2012-03-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
- requirement: &70152881719700 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,18 +21,28 @@ dependencies:
21
21
  version: 0.8.7
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70152881719700
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 0.8.7
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: rspec
27
- requirement: &70152881719200 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ~>
31
36
  - !ruby/object:Gem::Version
32
- version: '2.7'
37
+ version: '2.4'
33
38
  type: :development
34
39
  prerelease: false
35
- version_requirements: *70152881719200
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '2.4'
36
46
  description: Safely parse Gemfiles and gemspecs
37
47
  email: steve.richert@gmail.com
38
48
  executables: []
@@ -76,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
86
  version: '0'
77
87
  requirements: []
78
88
  rubyforge_project:
79
- rubygems_version: 1.8.15
89
+ rubygems_version: 1.8.21
80
90
  signing_key:
81
91
  specification_version: 3
82
92
  summary: Safely parse Gemfiles and gemspecs