spitball 0.7.3 → 0.7.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ext/bundler_fake_dsl.rb +8 -6
- data/lib/spitball/version.rb +1 -1
- data/spec/spitball_spec.rb +52 -0
- metadata +4 -4
data/lib/ext/bundler_fake_dsl.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Bundler
|
2
2
|
class FakeDsl
|
3
|
-
|
3
|
+
|
4
4
|
def initialize(file)
|
5
5
|
@groups = Hash.new{|h, k| h[k] = []}
|
6
6
|
@gems = []
|
@@ -19,10 +19,12 @@ module Bundler
|
|
19
19
|
__gems.map(&:first)
|
20
20
|
end
|
21
21
|
|
22
|
-
def group(
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
def group(*group_names, &blk)
|
23
|
+
group_names.each do |name|
|
24
|
+
@current_group = name.to_sym
|
25
|
+
instance_eval(&blk)
|
26
|
+
@current_group = nil
|
27
|
+
end
|
26
28
|
end
|
27
29
|
alias_method :groups, :group
|
28
30
|
|
@@ -30,7 +32,7 @@ module Bundler
|
|
30
32
|
@gems << args
|
31
33
|
@groups[@current_group] << args.first
|
32
34
|
end
|
33
|
-
|
35
|
+
|
34
36
|
def method_missing(*args)
|
35
37
|
end
|
36
38
|
end
|
data/lib/spitball/version.rb
CHANGED
data/spec/spitball_spec.rb
CHANGED
@@ -305,3 +305,55 @@ describe Spitball do
|
|
305
305
|
end
|
306
306
|
end
|
307
307
|
end
|
308
|
+
|
309
|
+
describe Bundler::FakeDsl do
|
310
|
+
it "should support a single group" do
|
311
|
+
gemfile = <<-end_gemfile
|
312
|
+
source :rubygems
|
313
|
+
gem "json_pure"
|
314
|
+
|
315
|
+
group :development do
|
316
|
+
gem 'rails'
|
317
|
+
gem 'json_pure'
|
318
|
+
end
|
319
|
+
end_gemfile
|
320
|
+
|
321
|
+
dsl = Bundler::FakeDsl.new(gemfile)
|
322
|
+
dsl.__groups[:development].should == ["rails", "json_pure"]
|
323
|
+
end
|
324
|
+
|
325
|
+
it "should support multiple groups in one line" do
|
326
|
+
gemfile = <<-end_gemfile
|
327
|
+
source :rubygems
|
328
|
+
gem "json_pure"
|
329
|
+
|
330
|
+
group :development, :test do
|
331
|
+
gem 'rails'
|
332
|
+
gem 'json_pure'
|
333
|
+
end
|
334
|
+
end_gemfile
|
335
|
+
|
336
|
+
dsl = Bundler::FakeDsl.new(gemfile)
|
337
|
+
dsl.__groups[:development].should == ["rails", "json_pure"]
|
338
|
+
dsl.__groups[:test].should == ["rails", "json_pure"]
|
339
|
+
end
|
340
|
+
|
341
|
+
it "should support multiple groups on several lines" do
|
342
|
+
gemfile = <<-end_gemfile
|
343
|
+
source :rubygems
|
344
|
+
gem "json_pure"
|
345
|
+
|
346
|
+
group :development do
|
347
|
+
gem 'rails'
|
348
|
+
end
|
349
|
+
|
350
|
+
group :test do
|
351
|
+
gem 'json_pure'
|
352
|
+
end
|
353
|
+
end_gemfile
|
354
|
+
|
355
|
+
dsl = Bundler::FakeDsl.new(gemfile)
|
356
|
+
dsl.__groups[:development].should == ["rails"]
|
357
|
+
dsl.__groups[:test].should == ["json_pure"]
|
358
|
+
end
|
359
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spitball
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 0.7.
|
9
|
+
- 4
|
10
|
+
version: 0.7.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Matt Freels
|
@@ -17,7 +17,7 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2014-
|
20
|
+
date: 2014-05-31 00:00:00 Z
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|