gemnasium-parser 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +1 -0
- data/gemnasium-parser.gemspec +12 -12
- data/lib/gemnasium/parser/patterns.rb +1 -1
- data/spec/gemnasium/parser/gemfile_spec.rb +22 -0
- metadata +2 -3
- data/lib/gemnasium/parser/version.rb +0 -5
data/.travis.yml
CHANGED
data/gemnasium-parser.gemspec
CHANGED
@@ -1,19 +1,19 @@
|
|
1
|
-
#
|
2
|
-
require File.expand_path('../lib/gemnasium/parser/version', __FILE__)
|
1
|
+
# encoding: utf-8
|
3
2
|
|
4
3
|
Gem::Specification.new do |gem|
|
5
|
-
gem.
|
6
|
-
gem.
|
7
|
-
gem.description = "Safely parse Gemfiles and gemspecs"
|
8
|
-
gem.summary = "Safely parse Gemfiles and gemspecs"
|
9
|
-
gem.homepage = "https://github.com/laserlemon/gemnasium-parser"
|
4
|
+
gem.name = "gemnasium-parser"
|
5
|
+
gem.version = "0.1.5"
|
10
6
|
|
11
|
-
gem.
|
12
|
-
gem.
|
13
|
-
gem.
|
14
|
-
gem.
|
15
|
-
gem.
|
7
|
+
gem.authors = "Steve Richert"
|
8
|
+
gem.email = "steve.richert@gmail.com"
|
9
|
+
gem.description = "Safely parse Gemfiles and gemspecs"
|
10
|
+
gem.summary = gem.description
|
11
|
+
gem.homepage = "https://github.com/laserlemon/gemnasium-parser"
|
16
12
|
|
17
13
|
gem.add_development_dependency "rake", ">= 0.8.7"
|
18
14
|
gem.add_development_dependency "rspec", "~> 2.4"
|
15
|
+
|
16
|
+
gem.files = `git ls-files`.split($\)
|
17
|
+
gem.test_files = gem.files.grep(/^spec\//)
|
18
|
+
gem.require_paths = ["lib"]
|
19
19
|
end
|
@@ -25,7 +25,7 @@ module Gemnasium
|
|
25
25
|
GEM_CALL = /^[ \t]*gem\(?[ \t]*#{QUOTED_GEM_NAME}(?:[ \t]*,[ \t]*#{REQUIREMENT_LIST})?(?:[ \t]*,[ \t]*(?<opts>#{OPTIONS}))?[ \t]*\)?[ \t]*#{COMMENT}$/
|
26
26
|
|
27
27
|
SYMBOLS = /#{SYMBOL}([ \t]*,[ \t]*#{SYMBOL})*/
|
28
|
-
GROUP_CALL = /^(?<i1>[ \t]*)group\(?[ \t]*(?<grps>#{SYMBOLS})[ \t]*\)?[ \t]+do[ \t]*?\n(?<blk
|
28
|
+
GROUP_CALL = /^(?<i1>[ \t]*)group\(?[ \t]*(?<grps>#{SYMBOLS})[ \t]*\)?[ \t]+do[ \t]*?\n(?<blk>.*?)\n^\k<i1>end[ \t]*$/m
|
29
29
|
|
30
30
|
GIT_CALL = /^(?<i1>[ \t]*)git[ \(][^\n]*?do[ \t]*?\n(?<blk>.*?)\n^\k<i1>end[ \t]*$/m
|
31
31
|
|
@@ -145,6 +145,28 @@ describe Gemnasium::Parser::Gemfile do
|
|
145
145
|
dependency.groups.should == [:development, :test]
|
146
146
|
end
|
147
147
|
|
148
|
+
it "parses multiple gems in a group" do
|
149
|
+
content(<<-EOF)
|
150
|
+
group :development do
|
151
|
+
gem "rake"
|
152
|
+
gem "sqlite3"
|
153
|
+
end
|
154
|
+
EOF
|
155
|
+
dependencies[0].groups.should == [:development]
|
156
|
+
dependencies[1].groups.should == [:development]
|
157
|
+
end
|
158
|
+
|
159
|
+
it "parses multiple gems in multiple groups" do
|
160
|
+
content(<<-EOF)
|
161
|
+
group :development, :test do
|
162
|
+
gem "rake"
|
163
|
+
gem "sqlite3"
|
164
|
+
end
|
165
|
+
EOF
|
166
|
+
dependencies[0].groups.should == [:development, :test]
|
167
|
+
dependencies[1].groups.should == [:development, :test]
|
168
|
+
end
|
169
|
+
|
148
170
|
it "ignores h4x" do
|
149
171
|
path = File.expand_path("../h4x.txt", __FILE__)
|
150
172
|
content(%(gem "h4x", :require => "\#{`touch #{path}`}"))
|
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.
|
4
|
+
version: 0.1.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-04-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -61,7 +61,6 @@ files:
|
|
61
61
|
- lib/gemnasium/parser/gemfile.rb
|
62
62
|
- lib/gemnasium/parser/gemspec.rb
|
63
63
|
- lib/gemnasium/parser/patterns.rb
|
64
|
-
- lib/gemnasium/parser/version.rb
|
65
64
|
- spec/gemnasium/parser/gemfile_spec.rb
|
66
65
|
- spec/gemnasium/parser/gemspec_spec.rb
|
67
66
|
- spec/gemnasium/parser_spec.rb
|