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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4cf7c981117b706fd9a44ef2ae1d585cc7eb96af
4
- data.tar.gz: 5c8513dc7059518c8fdcaa4ee96ac09dff20bf5a
3
+ metadata.gz: 8e0a972f9e33ddfc8f931222b36f405c4c81fc75
4
+ data.tar.gz: d2e844f4de8f99132095fffaee3094f72b13a206
5
5
  SHA512:
6
- metadata.gz: 2ce380df0255aa22e3750fd90025755766f62c18cfef4a9a2c28f6ba09de01fd0ab71fca76676c9cd146cb88fd4efbdc9b70a98976315b20fb70bb4ce232842b
7
- data.tar.gz: 6d1b56c35a0a377f4c96c6043a7ca0a72ca0613c62f497a1a1a17562d324b7001e28ee90c30da3ef089a2abe6fb5650e46650a7af7be531fc4be3eca947625f1
6
+ metadata.gz: 7943c7e6e35d79ad540235251ea4bcb8cd5465c3c2385d9c3c99be88f1dc44ca2c8d9622995cdc75a9750aaea6d89cc724ee575348bf0ab30552da403e3a55b6
7
+ data.tar.gz: d8badc8d9645df6dbf440b1441d0ab03947abfbf71ad52ea4fab9704e5a91261655dc15dd18e445073111a53ecaa74390fd06b75f61003fa1d5a5d338ee95541
data/Gemfile CHANGED
@@ -1,3 +1,3 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gemspec
3
+ gemspec
data/Gemfile.lock CHANGED
@@ -1,26 +1,36 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bundler_bash_completion (0.3.0)
4
+ bundler_bash_completion (0.3.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- diff-lcs (1.2.4)
10
- rake (10.1.0)
11
- rspec (2.14.1)
12
- rspec-core (~> 2.14.0)
13
- rspec-expectations (~> 2.14.0)
14
- rspec-mocks (~> 2.14.0)
15
- rspec-core (2.14.3)
16
- rspec-expectations (2.14.0)
17
- diff-lcs (>= 1.1.3, < 2.0)
18
- rspec-mocks (2.14.1)
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
- rake (~> 10.1.0)
26
- rspec (~> 2.14.0)
34
+ byebug (~> 3.1.0)
35
+ rake (~> 10.3.0)
36
+ rspec (~> 3.0.0)
data/Rakefile CHANGED
@@ -7,4 +7,4 @@ desc 'Default: runs specs.'
7
7
  task :default => :spec
8
8
 
9
9
  desc 'Run all specs in spec directory.'
10
- RSpec::Core::RakeTask.new(:spec)
10
+ RSpec::Core::RakeTask.new(:spec)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
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(File.dirname(__FILE__) + '/../lib/bundler_bash_completion')
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.expand_path(File.dirname(__FILE__) + '/VERSION')).strip
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 'rake', '~> 10.1.0'
20
- s.add_development_dependency 'rspec', '~> 2.14.0'
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
@@ -214,4 +214,4 @@ class BundlerBashCompletion
214
214
  bundle_command? && completion_step > 1 && TASKS.key?(task)
215
215
  end
216
216
 
217
- end
217
+ end
@@ -8,34 +8,31 @@ describe BundlerBashCompletion do
8
8
 
9
9
  describe '#arguments' do
10
10
 
11
- it 'is given line splitted by whitespaces' do
12
- completion('bundle exec rails s').arguments.should == ['bundle', 'exec', 'rails', 's']
13
- end
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
- it 'is installed binaries' do
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 'includes ruby' do
25
- completion.bins.should include('ruby')
26
- end
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.should == 'bundle'
34
- completion('rake').command.should == 'rake'
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.should == ''
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
- it 'is an empty array' do
48
- completion('foo').complete.should == []
49
- end
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
- it 'is an empty array' do
56
- completion('bundle').complete.should == []
57
- end
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
- it 'is all tasks' do
64
- completion('bundle ').complete.should include('check', 'outdated', 'list', 'show')
65
- end
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
- it 'is all tasks' do
72
- completion('bundle ').complete.should include('check', 'outdated', 'list', 'show')
73
- end
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
- it 'is "init" & "install" tasks' do
80
- completion('bundle in').complete.should == ['init', 'install']
81
- end
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
- it 'is an empty array' do
88
- completion('bundle in ').complete.should == []
89
- end
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
- it 'is an empty array' do
96
- completion('bundle foo').complete.should == []
97
- end
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
- it 'is an empty array' do
104
- completion('bundle foo ').complete.should == []
105
- end
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
- it 'is "--local", "--path", "--verbose", "--without", etc.' do
112
- completion('bundle install ').complete.should include('--local', '--path', '--verbose', '--without')
113
- end
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
- it 'is "--path"' do
120
- completion('bundle install --p').complete.should == ['--path']
121
- end
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
- it 'is an empty array' do
128
- completion('bundle install --path ').complete.should == []
129
- end
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
- it 'is "--local", "--path", "--without", etc.' do
136
- completion('bundle install ').complete.should include('--local', '--path', '--without')
137
- end
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
- it 'is "init" and "install"' do
144
- completion('bundle help in').complete.should == ['init', 'install']
145
- end
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
- it 'is an empty array' do
152
- completion('bundle help install ').complete.should == []
153
- end
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
- it 'is gems and "--verbose", etc.' do
160
- completion('bundle show ').complete.should include('diff-lcs', 'rake', 'rspec', '--verbose')
161
- end
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
- it 'is "--paths", "--no-color" and "--verbose"' do
168
- completion('bundle show rspec ').complete.should == ['--no-color', '--paths', '--verbose']
169
- end
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
- it 'is "--paths", "--no-color" and "--verbose"' do
176
- completion('bundle show foo ').complete.should == ['--no-color', '--paths', '--verbose']
177
- end
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
- it 'is gems and "--verbose", etc.' do
184
- completion('bundle update ').complete.should include('diff-lcs', 'rake', 'rspec', '--verbose')
185
- end
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
- it 'is gems (without rake & rspec) and "--verbose", etc.' do
192
- completion('bundle update rake rspec ').complete.should include('bundler', 'diff-lcs', 'rspec-core', '--verbose')
193
- completion('bundle update rake rspec ').complete.should_not include('rake', 'rspec')
194
- end
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
- it 'is bins' do
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 'includes gem & ruby commands' do
206
- completion('bundle exec ').complete.should include('gem', 'ruby')
207
- end
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
- it 'is an empty array' do
214
- completion('bundle exec foo ').complete.should == []
215
- end
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
- it 'is an empty array' do
222
- completion('bundle exec rake ').complete.should == []
223
- end
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.should == 'instal'
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.should == ''
237
- completion('bundle install ').completion_word.should == ''
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
- it 'is installed gems' do
245
- completion.gems.should include('bundler', 'rake', 'rspec', 'rspec-core', 'rspec-expectations')
246
- completion.gems.should_not include('rails')
247
- end
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.should == 'hello'
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.should == 'hello'
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.should == 'hello'
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.should == 'hello '
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.should == ''
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.should == 'install'
285
- completion('bundle foo ').task.should == 'foo'
286
- completion('bundle help install ').task.should == 'help'
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.should == []
295
- completion('bundle install ').task_options.should == []
296
- completion('bundle install --path fo').task_options.should == ['--path']
297
- completion('bundle install --path fo ').task_options.should == ['--path', 'fo']
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
@@ -1,4 +1,6 @@
1
- require File.dirname(__FILE__) + '/../lib/bundler_bash_completion'
1
+ require File.expand_path("#{__dir__}/../lib/bundler_bash_completion")
2
+ require 'byebug'
2
3
 
3
4
  RSpec.configure do |config|
4
- end
5
+ config.raise_errors_for_deprecations!
6
+ end
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.0
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: 2013-07-15 00:00:00.000000000 Z
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.1.0
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.1.0
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: 2.14.0
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: 2.14.0
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.0.3
95
+ rubygems_version: 2.2.2
82
96
  signing_key:
83
97
  specification_version: 4
84
98
  summary: Bundler bash completion