bundler_bash_completion 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +23 -13
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/bin/complete_bundle_bash_command +1 -2
- data/bundler_bash_completion.gemspec +4 -3
- data/lib/bundler_bash_completion.rb +1 -1
- data/spec/bundler_bash_completion_spec.rb +97 -103
- data/spec/spec_helper.rb +4 -2
- metadata +29 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e0a972f9e33ddfc8f931222b36f405c4c81fc75
|
4
|
+
data.tar.gz: d2e844f4de8f99132095fffaee3094f72b13a206
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7943c7e6e35d79ad540235251ea4bcb8cd5465c3c2385d9c3c99be88f1dc44ca2c8d9622995cdc75a9750aaea6d89cc724ee575348bf0ab30552da403e3a55b6
|
7
|
+
data.tar.gz: d8badc8d9645df6dbf440b1441d0ab03947abfbf71ad52ea4fab9704e5a91261655dc15dd18e445073111a53ecaa74390fd06b75f61003fa1d5a5d338ee95541
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,26 +1,36 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
bundler_bash_completion (0.3.
|
4
|
+
bundler_bash_completion (0.3.1)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
rspec
|
17
|
-
|
18
|
-
|
9
|
+
byebug (3.1.2)
|
10
|
+
columnize (~> 0.8)
|
11
|
+
debugger-linecache (~> 1.2)
|
12
|
+
columnize (0.8.9)
|
13
|
+
debugger-linecache (1.2.0)
|
14
|
+
diff-lcs (1.2.5)
|
15
|
+
rake (10.3.2)
|
16
|
+
rspec (3.0.0)
|
17
|
+
rspec-core (~> 3.0.0)
|
18
|
+
rspec-expectations (~> 3.0.0)
|
19
|
+
rspec-mocks (~> 3.0.0)
|
20
|
+
rspec-core (3.0.1)
|
21
|
+
rspec-support (~> 3.0.0)
|
22
|
+
rspec-expectations (3.0.1)
|
23
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
24
|
+
rspec-support (~> 3.0.0)
|
25
|
+
rspec-mocks (3.0.1)
|
26
|
+
rspec-support (~> 3.0.0)
|
27
|
+
rspec-support (3.0.0)
|
19
28
|
|
20
29
|
PLATFORMS
|
21
30
|
ruby
|
22
31
|
|
23
32
|
DEPENDENCIES
|
24
33
|
bundler_bash_completion!
|
25
|
-
|
26
|
-
|
34
|
+
byebug (~> 3.1.0)
|
35
|
+
rake (~> 10.3.0)
|
36
|
+
rspec (~> 3.0.0)
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.1
|
@@ -3,7 +3,6 @@
|
|
3
3
|
if ARGV[0] == 'init'
|
4
4
|
puts "complete -C #{File.expand_path(__FILE__)} -o default bundle"
|
5
5
|
else
|
6
|
-
require File.expand_path(
|
7
|
-
|
6
|
+
require File.expand_path("#{__dir__}/../lib/bundler_bash_completion")
|
8
7
|
puts BundlerBashCompletion.new(ENV['COMP_LINE']).complete.sort.join("\n")
|
9
8
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'bundler_bash_completion'
|
3
|
-
s.version = File.read(File.
|
3
|
+
s.version = File.read("#{File.dirname(__FILE__)}/VERSION").strip
|
4
4
|
s.platform = Gem::Platform::RUBY
|
5
5
|
s.author = 'Alexis Toulotte'
|
6
6
|
s.email = 'al@alweb.org'
|
@@ -16,6 +16,7 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
17
17
|
s.require_paths = ['lib']
|
18
18
|
|
19
|
-
s.add_development_dependency '
|
20
|
-
s.add_development_dependency '
|
19
|
+
s.add_development_dependency 'byebug', '~> 3.1.0'
|
20
|
+
s.add_development_dependency 'rake', '~> 10.3.0'
|
21
|
+
s.add_development_dependency 'rspec', '~> 3.0.0'
|
21
22
|
end
|
@@ -8,34 +8,31 @@ describe BundlerBashCompletion do
|
|
8
8
|
|
9
9
|
describe '#arguments' do
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
subject { completion('bundle exec rails s').arguments }
|
12
|
+
|
13
|
+
it { should eq(['bundle', 'exec', 'rails', 's']) }
|
14
14
|
|
15
15
|
end
|
16
16
|
|
17
17
|
describe '#bins' do
|
18
18
|
|
19
|
-
|
20
|
-
completion.bins.should include('autospec', 'gem', 'ldiff', 'rake', 'rspec')
|
21
|
-
completion.bins.should_not include('rails')
|
22
|
-
end
|
19
|
+
subject { completion.bins }
|
23
20
|
|
24
|
-
it '
|
25
|
-
|
26
|
-
|
21
|
+
it { should include('gem', 'ldiff', 'rake', 'rspec') }
|
22
|
+
it { should_not include('rails') }
|
23
|
+
it { should include('ruby') }
|
27
24
|
|
28
25
|
end
|
29
26
|
|
30
27
|
describe '#command' do
|
31
28
|
|
32
29
|
it 'is first argument' do
|
33
|
-
completion('bundle exec').command.
|
34
|
-
completion('rake').command.
|
30
|
+
expect(completion('bundle exec').command).to eq('bundle')
|
31
|
+
expect(completion('rake').command).to eq('rake')
|
35
32
|
end
|
36
33
|
|
37
34
|
it 'is empty string if line is blank' do
|
38
|
-
completion(nil).command.
|
35
|
+
expect(completion(nil).command).to eq('')
|
39
36
|
end
|
40
37
|
|
41
38
|
end
|
@@ -44,183 +41,180 @@ describe BundlerBashCompletion do
|
|
44
41
|
|
45
42
|
context 'with "foo"' do
|
46
43
|
|
47
|
-
|
48
|
-
|
49
|
-
|
44
|
+
subject { completion('foo').complete }
|
45
|
+
|
46
|
+
it { should eq([]) }
|
50
47
|
|
51
48
|
end
|
52
49
|
|
53
50
|
context 'with "bundle"' do
|
54
51
|
|
55
|
-
|
56
|
-
|
57
|
-
|
52
|
+
subject { completion('bundle').complete }
|
53
|
+
|
54
|
+
it { should eq([]) }
|
58
55
|
|
59
56
|
end
|
60
57
|
|
61
58
|
context 'with "bundle "' do
|
62
59
|
|
63
|
-
|
64
|
-
|
65
|
-
|
60
|
+
subject { completion('bundle ').complete }
|
61
|
+
|
62
|
+
it { should include('check', 'outdated', 'list', 'show') }
|
66
63
|
|
67
64
|
end
|
68
65
|
|
69
66
|
context 'with "bundle "' do
|
70
67
|
|
71
|
-
|
72
|
-
|
73
|
-
|
68
|
+
subject { completion('bundle ').complete }
|
69
|
+
|
70
|
+
it { should include('check', 'outdated', 'list', 'show') }
|
74
71
|
|
75
72
|
end
|
76
73
|
|
77
74
|
context 'with "bundle in"' do
|
78
75
|
|
79
|
-
|
80
|
-
|
81
|
-
|
76
|
+
subject { completion('bundle in').complete }
|
77
|
+
|
78
|
+
it { should eq(['init', 'install']) }
|
82
79
|
|
83
80
|
end
|
84
81
|
|
85
82
|
context 'with "bundle in "' do
|
86
83
|
|
87
|
-
|
88
|
-
|
89
|
-
|
84
|
+
subject { completion('bundle in ').complete }
|
85
|
+
|
86
|
+
it { should eq([]) }
|
90
87
|
|
91
88
|
end
|
92
89
|
|
93
90
|
context 'with "bundle foo"' do
|
94
91
|
|
95
|
-
|
96
|
-
|
97
|
-
|
92
|
+
subject { completion('bundle foo').complete }
|
93
|
+
|
94
|
+
it { should eq([]) }
|
98
95
|
|
99
96
|
end
|
100
97
|
|
101
98
|
context 'with "bundle foo "' do
|
102
99
|
|
103
|
-
|
104
|
-
|
105
|
-
|
100
|
+
subject { completion('bundle foo ').complete }
|
101
|
+
|
102
|
+
it { should eq([]) }
|
106
103
|
|
107
104
|
end
|
108
105
|
|
109
106
|
context 'with "bundle install "' do
|
110
107
|
|
111
|
-
|
112
|
-
|
113
|
-
|
108
|
+
subject { completion('bundle install ').complete }
|
109
|
+
|
110
|
+
it { should include('--local', '--path', '--verbose', '--without') }
|
114
111
|
|
115
112
|
end
|
116
113
|
|
117
114
|
context 'with "bundle install --p"' do
|
118
115
|
|
119
|
-
|
120
|
-
|
121
|
-
|
116
|
+
subject { completion('bundle install --p').complete }
|
117
|
+
|
118
|
+
it { should eq(['--path']) }
|
122
119
|
|
123
120
|
end
|
124
121
|
|
125
122
|
context 'with "bundle install --path "' do
|
126
123
|
|
127
|
-
|
128
|
-
|
129
|
-
|
124
|
+
subject { completion('bundle install --path ').complete }
|
125
|
+
|
126
|
+
it { should eq([]) }
|
130
127
|
|
131
128
|
end
|
132
129
|
|
133
130
|
context 'with "bundle install --local "' do
|
134
131
|
|
135
|
-
|
136
|
-
|
137
|
-
|
132
|
+
subject { completion('bundle install ').complete }
|
133
|
+
|
134
|
+
it { should include('--local', '--path', '--without') }
|
138
135
|
|
139
136
|
end
|
140
137
|
|
141
138
|
context 'with "bundle help in"' do
|
142
139
|
|
143
|
-
|
144
|
-
|
145
|
-
|
140
|
+
subject { completion('bundle help in').complete }
|
141
|
+
|
142
|
+
it { should eq(['init', 'install']) }
|
146
143
|
|
147
144
|
end
|
148
145
|
|
149
146
|
context 'with "bundle help install "' do
|
150
147
|
|
151
|
-
|
152
|
-
|
153
|
-
|
148
|
+
subject { completion('bundle help install ').complete }
|
149
|
+
|
150
|
+
it { should eq([]) }
|
154
151
|
|
155
152
|
end
|
156
153
|
|
157
154
|
context 'with "bundle show "' do
|
158
155
|
|
159
|
-
|
160
|
-
|
161
|
-
|
156
|
+
subject { completion('bundle show ').complete }
|
157
|
+
|
158
|
+
it { should include('diff-lcs', 'rake', 'rspec', '--verbose') }
|
162
159
|
|
163
160
|
end
|
164
161
|
|
165
162
|
context 'with "bundle show rspec "' do
|
166
163
|
|
167
|
-
|
168
|
-
|
169
|
-
|
164
|
+
subject { completion('bundle show rspec ').complete }
|
165
|
+
|
166
|
+
it { should eq(['--no-color', '--paths', '--verbose']) }
|
170
167
|
|
171
168
|
end
|
172
169
|
|
173
170
|
context 'with "bundle show foo "' do
|
174
171
|
|
175
|
-
|
176
|
-
|
177
|
-
|
172
|
+
subject { completion('bundle show foo ').complete }
|
173
|
+
|
174
|
+
it { should eq(['--no-color', '--paths', '--verbose']) }
|
178
175
|
|
179
176
|
end
|
180
177
|
|
181
178
|
context 'with "bundle update "' do
|
182
179
|
|
183
|
-
|
184
|
-
|
185
|
-
|
180
|
+
subject { completion('bundle update ').complete }
|
181
|
+
|
182
|
+
it { should include('diff-lcs', 'rake', 'rspec', '--verbose') }
|
186
183
|
|
187
184
|
end
|
188
185
|
|
189
186
|
context 'with "bundle update rake rspec "' do
|
190
187
|
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
188
|
+
subject { completion('bundle update rake rspec ').complete }
|
189
|
+
|
190
|
+
it { should include('bundler', 'diff-lcs', 'rspec-core', '--verbose') }
|
191
|
+
it { should_not include('rake', 'rspec') }
|
195
192
|
|
196
193
|
end
|
197
194
|
|
198
195
|
context 'with "bundle exec "' do
|
199
196
|
|
200
|
-
|
201
|
-
completion('bundle exec ').complete.should include('ldiff', 'rake', 'rspec')
|
202
|
-
completion('bundle exec ').complete.should_not include('--verbose')
|
203
|
-
end
|
197
|
+
subject { completion('bundle exec ').complete }
|
204
198
|
|
205
|
-
it
|
206
|
-
|
207
|
-
|
199
|
+
it { should include('ldiff', 'rake', 'rspec') }
|
200
|
+
it { should_not include('--verbose') }
|
201
|
+
it { should include('gem', 'ruby') }
|
208
202
|
|
209
203
|
end
|
210
204
|
|
211
205
|
context 'with "bundle exec foo "' do
|
212
206
|
|
213
|
-
|
214
|
-
|
215
|
-
|
207
|
+
subject { completion('bundle exec foo ').complete }
|
208
|
+
|
209
|
+
it { should eq([]) }
|
216
210
|
|
217
211
|
end
|
218
212
|
|
219
213
|
context 'with "bundle exec rake "' do
|
220
214
|
|
221
|
-
|
222
|
-
|
223
|
-
|
215
|
+
subject { completion('bundle exec rake ').complete }
|
216
|
+
|
217
|
+
it { should eq([]) }
|
224
218
|
|
225
219
|
end
|
226
220
|
|
@@ -229,29 +223,29 @@ describe BundlerBashCompletion do
|
|
229
223
|
describe '#completion_word' do
|
230
224
|
|
231
225
|
it 'is last word on line' do
|
232
|
-
completion('bundle instal').completion_word.
|
226
|
+
expect(completion('bundle instal').completion_word).to eq('instal')
|
233
227
|
end
|
234
228
|
|
235
229
|
it 'is an empty string if line ends with a white space' do
|
236
|
-
completion('bundle install ').completion_word.
|
237
|
-
completion('bundle install ').completion_word.
|
230
|
+
expect(completion('bundle install ').completion_word).to eq('')
|
231
|
+
expect(completion('bundle install ').completion_word).to eq('')
|
238
232
|
end
|
239
233
|
|
240
234
|
end
|
241
235
|
|
242
236
|
describe '#gems' do
|
243
237
|
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
238
|
+
subject { completion.gems }
|
239
|
+
|
240
|
+
it { should include('bundler', 'rake', 'rspec', 'rspec-core', 'rspec-expectations') }
|
241
|
+
it { should_not include('rails') }
|
248
242
|
|
249
243
|
end
|
250
244
|
|
251
245
|
describe '#line' do
|
252
246
|
|
253
247
|
it 'is line given at initializion' do
|
254
|
-
completion('hello').line.
|
248
|
+
expect(completion('hello').line).to eq('hello')
|
255
249
|
end
|
256
250
|
|
257
251
|
it 'is frozen' do
|
@@ -261,15 +255,15 @@ describe BundlerBashCompletion do
|
|
261
255
|
end
|
262
256
|
|
263
257
|
it 'is converted to string' do
|
264
|
-
completion(:hello).line.
|
258
|
+
expect(completion(:hello).line).to eq('hello')
|
265
259
|
end
|
266
260
|
|
267
261
|
it 'first whitespaces are removed' do
|
268
|
-
completion(' hello').line.
|
262
|
+
expect(completion(' hello').line).to eq('hello')
|
269
263
|
end
|
270
264
|
|
271
265
|
it 'last whitespaces are preserved' do
|
272
|
-
completion('hello ').line.
|
266
|
+
expect(completion('hello ').line).to eq('hello ')
|
273
267
|
end
|
274
268
|
|
275
269
|
end
|
@@ -277,13 +271,13 @@ describe BundlerBashCompletion do
|
|
277
271
|
describe '#task' do
|
278
272
|
|
279
273
|
it 'is an empty string when not ending with a whitespace' do
|
280
|
-
completion('bundle install').task.
|
274
|
+
expect(completion('bundle install').task).to eq('')
|
281
275
|
end
|
282
276
|
|
283
277
|
it 'is task given by second argument if ending with a whitespace' do
|
284
|
-
completion('bundle install ').task.
|
285
|
-
completion('bundle foo ').task.
|
286
|
-
completion('bundle help install ').task.
|
278
|
+
expect(completion('bundle install ').task).to eq('install')
|
279
|
+
expect(completion('bundle foo ').task).to eq('foo')
|
280
|
+
expect(completion('bundle help install ').task).to eq('help')
|
287
281
|
end
|
288
282
|
|
289
283
|
end
|
@@ -291,10 +285,10 @@ describe BundlerBashCompletion do
|
|
291
285
|
describe '#task_options' do
|
292
286
|
|
293
287
|
it 'is correct' do
|
294
|
-
completion('bundle install --path').task_options.
|
295
|
-
completion('bundle install ').task_options.
|
296
|
-
completion('bundle install --path fo').task_options.
|
297
|
-
completion('bundle install --path fo ').task_options.
|
288
|
+
expect(completion('bundle install --path').task_options).to eq([])
|
289
|
+
expect(completion('bundle install ').task_options).to eq([])
|
290
|
+
expect(completion('bundle install --path fo').task_options).to eq(['--path'])
|
291
|
+
expect(completion('bundle install --path fo ').task_options).to eq(['--path', 'fo'])
|
298
292
|
end
|
299
293
|
|
300
294
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,43 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bundler_bash_completion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexis Toulotte
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: byebug
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 3.1.0
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 3.1.0
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: rake
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
16
30
|
requirements:
|
17
|
-
- - ~>
|
31
|
+
- - "~>"
|
18
32
|
- !ruby/object:Gem::Version
|
19
|
-
version: 10.
|
33
|
+
version: 10.3.0
|
20
34
|
type: :development
|
21
35
|
prerelease: false
|
22
36
|
version_requirements: !ruby/object:Gem::Requirement
|
23
37
|
requirements:
|
24
|
-
- - ~>
|
38
|
+
- - "~>"
|
25
39
|
- !ruby/object:Gem::Version
|
26
|
-
version: 10.
|
40
|
+
version: 10.3.0
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: rspec
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
|
-
- - ~>
|
45
|
+
- - "~>"
|
32
46
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
47
|
+
version: 3.0.0
|
34
48
|
type: :development
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
|
-
- - ~>
|
52
|
+
- - "~>"
|
39
53
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
54
|
+
version: 3.0.0
|
41
55
|
description: Provides bash completion for bundle command
|
42
56
|
email: al@alweb.org
|
43
57
|
executables:
|
@@ -45,8 +59,8 @@ executables:
|
|
45
59
|
extensions: []
|
46
60
|
extra_rdoc_files: []
|
47
61
|
files:
|
48
|
-
- .gitignore
|
49
|
-
- .rspec
|
62
|
+
- ".gitignore"
|
63
|
+
- ".rspec"
|
50
64
|
- Gemfile
|
51
65
|
- Gemfile.lock
|
52
66
|
- MIT-LICENSE
|
@@ -68,17 +82,17 @@ require_paths:
|
|
68
82
|
- lib
|
69
83
|
required_ruby_version: !ruby/object:Gem::Requirement
|
70
84
|
requirements:
|
71
|
-
- -
|
85
|
+
- - ">="
|
72
86
|
- !ruby/object:Gem::Version
|
73
87
|
version: '0'
|
74
88
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
89
|
requirements:
|
76
|
-
- -
|
90
|
+
- - ">="
|
77
91
|
- !ruby/object:Gem::Version
|
78
92
|
version: '0'
|
79
93
|
requirements: []
|
80
94
|
rubyforge_project: bundler_bash_completion
|
81
|
-
rubygems_version: 2.
|
95
|
+
rubygems_version: 2.2.2
|
82
96
|
signing_key:
|
83
97
|
specification_version: 4
|
84
98
|
summary: Bundler bash completion
|