git-gems 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eeafeea9ec6890bd57104dabaf87927cfca03f3f
4
- data.tar.gz: 571d871b2e71ca1785f57309ddbcfd56aa993ac0
3
+ metadata.gz: 03091c622aa850c1dd94b9bbda9dcf00c33471aa
4
+ data.tar.gz: b1095adc5998c637d36e828a50cad9176bbb3e40
5
5
  SHA512:
6
- metadata.gz: 0f8a1f6fe1a3bdce2de5eb54c52d4ed381acfc08b82cf13c4c59ecab0ef71f11087d7db706d2c07e3f74ba2550d78f8796d411ded340e4371846f272ac0ddd65
7
- data.tar.gz: 9c238b17dd11a3b4593816a9de30cd3a43cf6a4b1154ed4da328124fd90083bdd9c7cee40ebd737bb1fff35fbcaa62723f78b8b060985003796eb1fa4c988965
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
@@ -12,9 +12,5 @@ begin
12
12
  t.rspec_opts = ['-c', '-f progress', '-r ./spec/spec_helper.rb']
13
13
  t.pattern = 'spec/**/*_spec.rb'
14
14
  end
15
- RSpec.configure do |config|
16
- config.mock_with :rr
17
- # config.mock_with RR::Adapters::Rspec
18
- end
19
15
  rescue LoadError => e
20
16
  end
@@ -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.19.1"
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
@@ -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
- desc "install [OPTIONS]","do bundle install."
32
- def install(*args)
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 :install
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("../../../../fixtures/#{f}.template", __FILE__)} ./#{f}"
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)
@@ -1,5 +1,5 @@
1
1
  module Git
2
2
  module Gems
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
@@ -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(:install, [], {})
12
- }).to eq("bundle install --path=./.bundle --binstubs=./.bundle/bin \n")
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(:install, [["--test", 'fuga']], {:path => "./hoge", :binstubs => "./binhoge"})
18
- }).to eq("bundle install --path=./hoge --binstubs=./binhoge --test fuga\n")
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(:install, [], {:"no-path" => true})
24
- }).to eq("bundle install --binstubs=./.bundle/bin \n")
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(:install, [], {:"no-binstubs" => true})
30
- }).to eq("bundle install --path=./.bundle \n")
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(:install, [], {:"no-binstubs" => true, :"no-path" => true})
36
- }).to eq("bundle install \n")
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(:install, [], {path: "test", :"no-path" => true})
42
- }).to eq("bundle install --binstubs=./.bundle/bin \n")
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(:install, [], {binstubs: "test", :"no-binstubs" => true})
48
- }).to eq("bundle install --path=./.bundle \n")
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(:install, [], {binstubs: "test", :"no-path" => true})
54
- }).to eq("bundle install --binstubs=test \n")
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(:install, [], {path: "test", :"no-binstubs" => true})
60
- }).to eq("bundle install --path=test \n")
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\n")
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'\n")
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.1.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-09-17 00:00:00.000000000 Z
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.1
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.19.1
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