git-gems 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -1
- data/Rakefile +0 -4
- data/git-gems.gemspec +1 -2
- data/lib/git/gems/cli.rb +14 -5
- data/lib/git/gems/version.rb +1 -1
- data/spec/lib/git/gems/cli_spec.rb +34 -20
- metadata +4 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03091c622aa850c1dd94b9bbda9dcf00c33471aa
|
4
|
+
data.tar.gz: b1095adc5998c637d36e828a50cad9176bbb3e40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60260dcbbd8ccf22380b6cdb21f34347060e2da9cd295e448c41a42a94cb0cb0e5565521292f69eab45335ef0c1fc7801c79b59e76d103cacc0d54814e373e70
|
7
|
+
data.tar.gz: 35a96d3a69d96d5cc7ba2d3bdaa58a011267251e8b6ceb34c1cac0d8882ed84794b9d145dbdeb7b4d7d36227a60b2f558f0f04d2afd62eaa275280e84353245e
|
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
[![Build Status](https://travis-ci.org/magicdrive/ruby-git-gems.svg?branch=feature%2Frspec)](https://travis-ci.org/magicdrive/ruby-git-gems)
|
2
|
+
[![Build Status](https://drone.io/github.com/magicdrive/ruby-git-gems/status.png)](https://drone.io/github.com/magicdrive/ruby-git-gems/latest)
|
2
3
|
# Git::Gems
|
3
4
|
|
4
5
|
my bundler and git wrapper. (thor based)
|
@@ -47,7 +48,12 @@ The runs are passed to the bundle exec option if it does not support came over.
|
|
47
48
|
git gems [command]
|
48
49
|
# or
|
49
50
|
git gems exec [command]
|
50
|
-
|
51
|
+
|
52
|
+
`update` command:
|
53
|
+
Do the `bundle update`
|
54
|
+
|
55
|
+
git gems update
|
56
|
+
|
51
57
|
|
52
58
|
|
53
59
|
|
data/Rakefile
CHANGED
data/git-gems.gemspec
CHANGED
@@ -18,10 +18,9 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_runtime_dependency "thor", "~> 0.
|
21
|
+
spec.add_runtime_dependency "thor", "~> 0.18.1"
|
22
22
|
spec.add_runtime_dependency "bundler", "~> 1.0"
|
23
23
|
spec.add_development_dependency "rspec", "~> 3.0"
|
24
|
-
spec.add_development_dependency "rr", "~> 1.1.2"
|
25
24
|
spec.add_development_dependency "pry"
|
26
25
|
spec.add_development_dependency "rake"
|
27
26
|
end
|
data/lib/git/gems/cli.rb
CHANGED
@@ -28,14 +28,18 @@ module Git
|
|
28
28
|
option :binstubs, :default => default_binstubs_path
|
29
29
|
option :"no-binstubs", type: :boolean, default: false
|
30
30
|
option :"no-path", type: :boolean, default: false
|
31
|
-
|
32
|
-
|
31
|
+
option :global, type: :boolean, default: false
|
32
|
+
option :production, type: :boolean, default: false
|
33
|
+
desc "bundler [OPTIONS]","do bundle install."
|
34
|
+
def bundler(*args)
|
35
|
+
options[:"no-path"], options[:"no-binstubs"] = true if options[:global]
|
36
|
+
group_opt = options[:production] ? "--without development test" : %{}
|
33
37
|
path_opt = options[:"no-path"] ? %{} : "--path=#{options[:path]}"
|
34
38
|
binstubs_opt = options[:"no-binstubs"] ? %{} : "--binstubs=#{options[:binstubs]}"
|
35
39
|
|
36
|
-
exec_cmd "bundle install #{path_opt} #{binstubs_opt} #{args.join(%{ })}"
|
40
|
+
exec_cmd "bundle install #{path_opt} #{binstubs_opt} #{group_opt} #{args.join(%{ })}"
|
37
41
|
end
|
38
|
-
default_task :
|
42
|
+
default_task :bundler
|
39
43
|
|
40
44
|
desc 'exec [COMMAND] [OPTIONS]','do bundle exec .'
|
41
45
|
def exec(cmd, *args)
|
@@ -45,7 +49,7 @@ module Git
|
|
45
49
|
desc 'init','initilalize ruby project'
|
46
50
|
def init()
|
47
51
|
%w(Rakefile Gemfile README.md).each do |f|
|
48
|
-
exec_cmd "cp -a #{File.expand_path("
|
52
|
+
exec_cmd "cp -a #{File.expand_path("../../../fixtures/#{f}.template", File.dirname(__FILE__))} ./#{f}"
|
49
53
|
end
|
50
54
|
exec_cmd "mkdir -p lib spec"
|
51
55
|
exec_cmd "touch lib/.keep spec/.keep"
|
@@ -60,6 +64,11 @@ module Git
|
|
60
64
|
exec_cmd "git push origin --tags" if options[:push]
|
61
65
|
end
|
62
66
|
|
67
|
+
desc 'update', 'update bundled gems'
|
68
|
+
def update(*args)
|
69
|
+
exec_cmd "bundle update #{args.join(%{ })}"
|
70
|
+
end
|
71
|
+
|
63
72
|
private
|
64
73
|
def exec_cmd(command)
|
65
74
|
pid = spawn(command.to_s)
|
data/lib/git/gems/version.rb
CHANGED
@@ -8,56 +8,62 @@ describe Git::Gems::CLI do
|
|
8
8
|
describe "#install" do
|
9
9
|
it do
|
10
10
|
expect(capture(:stdout) {
|
11
|
-
@instance.invoke(:
|
12
|
-
}).to eq("bundle install --path=./.bundle --binstubs=./.bundle/bin
|
11
|
+
@instance.invoke(:bundler, [], {})
|
12
|
+
}.strip).to eq("bundle install --path=./.bundle --binstubs=./.bundle/bin")
|
13
13
|
end
|
14
14
|
|
15
15
|
it do
|
16
16
|
expect(capture(:stdout) {
|
17
|
-
@instance.invoke(:
|
18
|
-
}).to eq("bundle install --path=./hoge --binstubs=./binhoge
|
17
|
+
@instance.invoke(:bundler, [["--test", 'fuga']], {:path => "./hoge", :binstubs => "./binhoge"})
|
18
|
+
}.strip).to eq("bundle install --path=./hoge --binstubs=./binhoge --test fuga")
|
19
19
|
end
|
20
20
|
|
21
21
|
it do
|
22
22
|
expect(capture(:stdout) {
|
23
|
-
@instance.invoke(:
|
24
|
-
}).to eq("bundle install
|
23
|
+
@instance.invoke(:bundler, [], {:"production" => true})
|
24
|
+
}.strip).to eq("bundle install --path=./.bundle --binstubs=./.bundle/bin --without development test")
|
25
25
|
end
|
26
26
|
|
27
27
|
it do
|
28
28
|
expect(capture(:stdout) {
|
29
|
-
@instance.invoke(:
|
30
|
-
}).to eq("bundle install
|
29
|
+
@instance.invoke(:bundler, [], {:"no-path" => true})
|
30
|
+
}.strip).to eq("bundle install --binstubs=./.bundle/bin")
|
31
31
|
end
|
32
32
|
|
33
33
|
it do
|
34
34
|
expect(capture(:stdout) {
|
35
|
-
@instance.invoke(:
|
36
|
-
}).to eq("bundle install
|
35
|
+
@instance.invoke(:bundler, [], {:"no-binstubs" => true})
|
36
|
+
}.strip).to eq("bundle install --path=./.bundle")
|
37
37
|
end
|
38
38
|
|
39
39
|
it do
|
40
40
|
expect(capture(:stdout) {
|
41
|
-
@instance.invoke(:
|
42
|
-
}).to eq("bundle install
|
41
|
+
@instance.invoke(:bundler, [], {:"no-binstubs" => true, :"no-path" => true})
|
42
|
+
}.strip).to eq("bundle install")
|
43
43
|
end
|
44
44
|
|
45
45
|
it do
|
46
46
|
expect(capture(:stdout) {
|
47
|
-
@instance.invoke(:
|
48
|
-
}).to eq("bundle install
|
47
|
+
@instance.invoke(:bundler, [], {path: "test", :"no-path" => true})
|
48
|
+
}.strip).to eq("bundle install --binstubs=./.bundle/bin")
|
49
49
|
end
|
50
50
|
|
51
51
|
it do
|
52
52
|
expect(capture(:stdout) {
|
53
|
-
@instance.invoke(:
|
54
|
-
}).to eq("bundle install
|
53
|
+
@instance.invoke(:bundler, [], {binstubs: "test", :"no-binstubs" => true})
|
54
|
+
}.strip).to eq("bundle install --path=./.bundle")
|
55
55
|
end
|
56
56
|
|
57
57
|
it do
|
58
58
|
expect(capture(:stdout) {
|
59
|
-
@instance.invoke(:
|
60
|
-
}).to eq("bundle install
|
59
|
+
@instance.invoke(:bundler, [], {binstubs: "test", :"no-path" => true})
|
60
|
+
}.strip).to eq("bundle install --binstubs=test")
|
61
|
+
end
|
62
|
+
|
63
|
+
it do
|
64
|
+
expect(capture(:stdout) {
|
65
|
+
@instance.invoke(:bundler, [], {path: "test", :"no-binstubs" => true})
|
66
|
+
}.strip).to eq("bundle install --path=test")
|
61
67
|
end
|
62
68
|
end
|
63
69
|
|
@@ -65,7 +71,7 @@ describe Git::Gems::CLI do
|
|
65
71
|
it do
|
66
72
|
expect(capture(:stdout) {
|
67
73
|
@instance.invoke(:exec, ['test', ["--hoge", "bar"]], {})
|
68
|
-
}).to eq("bundle exec test --hoge bar
|
74
|
+
}.strip).to eq("bundle exec test --hoge bar")
|
69
75
|
end
|
70
76
|
end
|
71
77
|
|
@@ -93,7 +99,7 @@ git init
|
|
93
99
|
it do
|
94
100
|
expect(capture(:stdout) {
|
95
101
|
@instance.invoke(:release, [], {:version => 'hoge'})
|
96
|
-
}).to eq("git tag -a 'release-hoge'
|
102
|
+
}.strip).to eq("git tag -a 'release-hoge'")
|
97
103
|
end
|
98
104
|
it do
|
99
105
|
expect(capture(:stdout) {
|
@@ -106,4 +112,12 @@ git push origin --tags
|
|
106
112
|
end
|
107
113
|
|
108
114
|
end
|
115
|
+
describe "#install" do
|
116
|
+
it do
|
117
|
+
expect(capture(:stdout) {
|
118
|
+
@instance.invoke(:release, [], {})
|
119
|
+
}).to eq('bundle update')
|
120
|
+
end
|
121
|
+
|
122
|
+
end
|
109
123
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-gems
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hiroshi IKEGAMI
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.18.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.18.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,20 +52,6 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rr
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 1.1.2
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: 1.1.2
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: pry
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|