grill 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -44,6 +44,22 @@ Or, more handy way to use as below (since v0.2.1):
44
44
  # ...
45
45
  end
46
46
 
47
+ You can multiple implant as below (since v0.3.0):
48
+
49
+ # these args will be combined one file.
50
+ # so if first arg define "source" and second is not,
51
+ # second arg's `gem` is affected by that
52
+
53
+ Grill.implant <<-FOO, <<-BAR, :commontools
54
+ source :rubygems
55
+ gem "typhoeus"
56
+ gem "nokogiri"
57
+ FOO
58
+ gem "rack"
59
+ BAR
60
+
61
+ # You got typhoeus, nokogiri, rack, and :commontools
62
+
47
63
  # Compatibility of Gemfile
48
64
 
49
65
  It is completely compatible (you installed version) Bundler's Gemfile so you can use [full spec of it](http://gembundler.com/gemfile.html) for version fixation, `:require`, `:path`, etc.
@@ -12,11 +12,15 @@ module Grill
12
12
  home
13
13
  end
14
14
 
15
- def implant(gems_or_sym)
16
- if gems_or_sym.class == Symbol
17
- gems = File.read(File.join(home, gems_or_sym.to_s))
18
- else
19
- gems = gems_or_sym
15
+ def implant(*args)
16
+ gems = ""
17
+ args.each do |arg|
18
+ if arg.class == Symbol
19
+ gems << File.read(File.join(home, arg.to_s))
20
+ else
21
+ gems << arg
22
+ end
23
+ gems << "\n"
20
24
  end
21
25
 
22
26
  fullpath = File.expand_path($0)
@@ -1,3 +1,3 @@
1
1
  module Grill
2
- VERSION = "0.2.1"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -52,6 +52,22 @@ describe Grill do
52
52
  end
53
53
  end
54
54
 
55
+ it "#implant multiple" do
56
+ cleanroom do
57
+ defined?(Dummy).should be_nil
58
+ defined?(Dummy2).should be_nil
59
+
60
+ Grill.implant <<-FOO, <<-BAR
61
+ gem "dummy", :path => "#{File.expand_path(".././support", __FILE__)}"
62
+ FOO
63
+ gem "dummy2", :path => "#{File.expand_path(".././support", __FILE__)}"
64
+ BAR
65
+
66
+ defined?(Dummy).should_not be_nil
67
+ defined?(Dummy2).should_not be_nil
68
+ end
69
+ end
70
+
55
71
  it "separete Gemfile different contants" do
56
72
  Grill.implant(<<-GEM)
57
73
  gem "bundler"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grill
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
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-09-18 00:00:00.000000000 Z
12
+ date: 2012-10-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler