grill 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +9 -0
- data/README.md +1 -1
- data/ci/spec.rb +6 -0
- data/lib/grill.rb +15 -10
- data/lib/grill/version.rb +1 -1
- data/spec/grill_spec.rb +46 -43
- data/spec/spec_helper.rb +5 -2
- metadata +13 -17
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: dd6821a9d580419f09f82949382f45babb98c4c5
|
4
|
+
data.tar.gz: e7f6327d76814658addb2d19cf987bb62a875a29
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 59e97e6e823e0af002d312f2487fde7a7662aabb4db224d5ef61b5fa526bfe0cf2545b27c59433c5b47cc3daed95b6ede448b3182449e578c4be26ea76ce3dd4
|
7
|
+
data.tar.gz: 09e4febb19acf13497426258cd0d713316b60a350357c27b72a2c83948ff7953dd97cf4775720d9f689b190709ccade16e73931f70faa65deb23dbecb5103f9b
|
data/.travis.yml
ADDED
data/README.md
CHANGED
data/ci/spec.rb
ADDED
data/lib/grill.rb
CHANGED
@@ -23,16 +23,7 @@ module Grill
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def implant(*args)
|
26
|
-
gems =
|
27
|
-
args.each do |arg|
|
28
|
-
if arg.class == Symbol
|
29
|
-
gems << File.read(File.join(home, arg.to_s))
|
30
|
-
else
|
31
|
-
gems << arg
|
32
|
-
end
|
33
|
-
gems << "\n"
|
34
|
-
end
|
35
|
-
|
26
|
+
gems = build_gemfile(*args)
|
36
27
|
gemfile = gemfile_path(gems)
|
37
28
|
tmp = File.open(gemfile, "w")
|
38
29
|
tmp.puts gems
|
@@ -50,6 +41,20 @@ module Grill
|
|
50
41
|
Bundler.require
|
51
42
|
end
|
52
43
|
|
44
|
+
def build_gemfile(*args)
|
45
|
+
gems = ""
|
46
|
+
args.each do |arg|
|
47
|
+
if arg.class == Symbol
|
48
|
+
gems << File.read(File.join(home, arg.to_s))
|
49
|
+
else
|
50
|
+
gems << arg
|
51
|
+
end
|
52
|
+
gems << "\n"
|
53
|
+
end
|
54
|
+
gems = "source 'https://rubygems.org'\n#{gems}" unless gems[/^\s*source /]
|
55
|
+
gems
|
56
|
+
end
|
57
|
+
|
53
58
|
private
|
54
59
|
def ruby
|
55
60
|
"#{defined?(RUBY_ENGINE) ? RUBY_ENGINE : "ruby18"}-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"
|
data/lib/grill/version.rb
CHANGED
data/spec/grill_spec.rb
CHANGED
@@ -15,65 +15,68 @@ describe Grill do
|
|
15
15
|
Grill.home.should match %r!^#{ENV["GRILL_HOME"]}/.grill!
|
16
16
|
end
|
17
17
|
|
18
|
-
#
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
defined?(Bundler).should be_nil
|
23
|
-
defined?(Dummy).should be_nil
|
24
|
-
defined?(DummyGit).should be_nil
|
25
|
-
|
26
|
-
Grill.implant(<<-GEM)
|
27
|
-
gem "bundler"
|
28
|
-
gem "dummy", :path => "#{File.expand_path(".././support", __FILE__)}"
|
29
|
-
gem "dummy_git", :git => "file://#{File.expand_path(".././support/dummy_git", __FILE__)}"
|
30
|
-
GEM
|
31
|
-
defined?(Bundler).should_not be_nil
|
32
|
-
defined?(Dummy).should_not be_nil
|
33
|
-
defined?(DummyGit).should_not be_nil
|
34
|
-
end
|
35
|
-
end
|
18
|
+
describe "#implant" do
|
19
|
+
it "by String" do
|
20
|
+
cleanroom do
|
21
|
+
defined?(Dummy).should be_nil
|
36
22
|
|
37
|
-
|
38
|
-
|
39
|
-
name = :test
|
40
|
-
File.open("#{Grill.home}/#{name}", "w") do |f|
|
41
|
-
f.puts <<-GEM
|
42
|
-
gem "dummy", :path => "#{File.expand_path(".././support", __FILE__)}"
|
43
|
-
gem "dummy2", :path => "#{File.expand_path(".././support", __FILE__)}"
|
23
|
+
Grill.implant(<<-GEM)
|
24
|
+
gem "dummy", :path => "#{File.expand_path(".././support/dummy", __FILE__)}"
|
44
25
|
GEM
|
26
|
+
defined?(Dummy).should_not be_nil
|
45
27
|
end
|
46
|
-
|
47
|
-
|
28
|
+
end
|
29
|
+
|
30
|
+
it "multiple" do
|
31
|
+
cleanroom do
|
32
|
+
defined?(Dummy).should be_nil
|
33
|
+
defined?(Dummy2).should be_nil
|
48
34
|
|
49
|
-
|
50
|
-
|
51
|
-
|
35
|
+
Grill.implant <<-FOO, <<-BAR
|
36
|
+
gem "dummy", :path => "#{File.expand_path(".././support/dummy", __FILE__)}"
|
37
|
+
FOO
|
38
|
+
gem "dummy2", :path => "#{File.expand_path(".././support/dummy2", __FILE__)}"
|
39
|
+
BAR
|
40
|
+
|
41
|
+
defined?(Dummy).should_not be_nil
|
42
|
+
defined?(Dummy2).should_not be_nil
|
43
|
+
end
|
52
44
|
end
|
45
|
+
|
53
46
|
end
|
54
47
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
48
|
+
describe "#build_gemfile" do
|
49
|
+
|
50
|
+
it "auto completion `source` if lacked" do
|
51
|
+
gemfile = Grill.build_gemfile "gem 'rack'"
|
52
|
+
gemfile["source"].should_not be_nil
|
53
|
+
gemfile["https://rubygems.org"].should_not be_nil
|
54
|
+
end
|
59
55
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
56
|
+
it "can receive Symbol" do
|
57
|
+
name = :test
|
58
|
+
gemfile = <<-GEM
|
59
|
+
source "https://rubygems.org"
|
60
|
+
gem "dummy", :path => "#{File.expand_path(".././support/dummy", __FILE__)}"
|
61
|
+
gem "dummy2", :path => "#{File.expand_path(".././support/dummy2", __FILE__)}"
|
62
|
+
GEM
|
65
63
|
|
66
|
-
|
67
|
-
|
64
|
+
File.open("#{Grill.home}/#{name}", "w") do |f|
|
65
|
+
f.write gemfile
|
66
|
+
end
|
67
|
+
|
68
|
+
# strip \n for normalize
|
69
|
+
Grill.build_gemfile(name).rstrip.should == gemfile.rstrip
|
68
70
|
end
|
69
71
|
end
|
70
72
|
|
73
|
+
|
71
74
|
it "separete Gemfile different contants" do
|
72
|
-
gemfile1 = 'gem "
|
75
|
+
gemfile1 = 'gem "hogehoge"'
|
73
76
|
file1 = Grill.gemfile_path(gemfile1)
|
74
77
|
|
75
78
|
gemfile2 = <<-GEM
|
76
|
-
gem "dummy", :path => "#{File.expand_path(".././support", __FILE__)}"
|
79
|
+
gem "dummy", :path => "#{File.expand_path(".././support/dummy", __FILE__)}"
|
77
80
|
GEM
|
78
81
|
file2 = Grill.gemfile_path(gemfile2)
|
79
82
|
|
data/spec/spec_helper.rb
CHANGED
@@ -9,8 +9,11 @@ require "rspec/matchers/built_in/be"
|
|
9
9
|
RSpec.configure do |config|
|
10
10
|
# Bundler is a singleton, so we must isolate each test processes
|
11
11
|
def cleanroom(&block)
|
12
|
-
pending "unsupported `fork`" unless
|
13
|
-
|
12
|
+
pending "unsupported `fork`" unless Process.respond_to?(:fork)
|
13
|
+
Process.fork do
|
14
|
+
block.call
|
15
|
+
end
|
14
16
|
Process.waitall
|
17
|
+
$?.to_i.should == 0
|
15
18
|
end
|
16
19
|
end
|
metadata
CHANGED
@@ -1,46 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grill
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.5.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- uu59
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2013-07-10 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: bundler
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: 1.1.0
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - '>='
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: 1.1.0
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rspec
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - '>='
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - '>='
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
description: Implant Gemfile into your script
|
@@ -51,10 +46,12 @@ extensions: []
|
|
51
46
|
extra_rdoc_files: []
|
52
47
|
files:
|
53
48
|
- .gitignore
|
49
|
+
- .travis.yml
|
54
50
|
- Gemfile
|
55
51
|
- LICENSE.txt
|
56
52
|
- README.md
|
57
53
|
- Rakefile
|
54
|
+
- ci/spec.rb
|
58
55
|
- grill.gemspec
|
59
56
|
- lib/grill.rb
|
60
57
|
- lib/grill/version.rb
|
@@ -66,27 +63,26 @@ files:
|
|
66
63
|
- spec/support/dummy2/lib/dummy2.rb
|
67
64
|
homepage: https://github.com/uu59/grill
|
68
65
|
licenses: []
|
66
|
+
metadata: {}
|
69
67
|
post_install_message:
|
70
68
|
rdoc_options: []
|
71
69
|
require_paths:
|
72
70
|
- lib
|
73
71
|
required_ruby_version: !ruby/object:Gem::Requirement
|
74
|
-
none: false
|
75
72
|
requirements:
|
76
|
-
- -
|
73
|
+
- - '>='
|
77
74
|
- !ruby/object:Gem::Version
|
78
75
|
version: '0'
|
79
76
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
|
-
none: false
|
81
77
|
requirements:
|
82
|
-
- -
|
78
|
+
- - '>='
|
83
79
|
- !ruby/object:Gem::Version
|
84
80
|
version: '0'
|
85
81
|
requirements: []
|
86
82
|
rubyforge_project:
|
87
|
-
rubygems_version:
|
83
|
+
rubygems_version: 2.0.3
|
88
84
|
signing_key:
|
89
|
-
specification_version:
|
85
|
+
specification_version: 4
|
90
86
|
summary: Implant Gemfile into your script
|
91
87
|
test_files:
|
92
88
|
- spec/grill_spec.rb
|