bundler_bash_completion 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/.rspec CHANGED
@@ -1,2 +1,2 @@
1
1
  --colour
2
- --format progress
2
+ --order random
data/Gemfile.lock CHANGED
@@ -1,35 +1,35 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bundler_bash_completion (0.1.1)
4
+ bundler_bash_completion (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
8
8
  specs:
9
9
  columnize (0.3.6)
10
- debugger (1.1.3)
10
+ debugger (1.2.2)
11
11
  columnize (>= 0.3.1)
12
12
  debugger-linecache (~> 1.1.1)
13
- debugger-ruby_core_source (~> 1.1.2)
14
- debugger-linecache (1.1.1)
13
+ debugger-ruby_core_source (~> 1.1.5)
14
+ debugger-linecache (1.1.2)
15
15
  debugger-ruby_core_source (>= 1.1.1)
16
- debugger-ruby_core_source (1.1.2)
16
+ debugger-ruby_core_source (1.1.5)
17
17
  diff-lcs (1.1.3)
18
- rake (0.9.2.2)
19
- rspec (2.10.0)
20
- rspec-core (~> 2.10.0)
21
- rspec-expectations (~> 2.10.0)
22
- rspec-mocks (~> 2.10.0)
23
- rspec-core (2.10.0)
24
- rspec-expectations (2.10.0)
18
+ rake (10.0.2)
19
+ rspec (2.12.0)
20
+ rspec-core (~> 2.12.0)
21
+ rspec-expectations (~> 2.12.0)
22
+ rspec-mocks (~> 2.12.0)
23
+ rspec-core (2.12.0)
24
+ rspec-expectations (2.12.0)
25
25
  diff-lcs (~> 1.1.3)
26
- rspec-mocks (2.10.1)
26
+ rspec-mocks (2.12.0)
27
27
 
28
28
  PLATFORMS
29
29
  ruby
30
30
 
31
31
  DEPENDENCIES
32
32
  bundler_bash_completion!
33
- debugger (~> 1.1.0)
34
- rake (~> 0.9.2.2)
35
- rspec (~> 2.10.0)
33
+ debugger (~> 1.2.0)
34
+ rake (~> 10.0.0)
35
+ rspec (~> 2.12.0)
data/README.mdown CHANGED
@@ -6,7 +6,8 @@ Provides `bash` completion for [`bundle`](http://gembundler.com/) command.
6
6
 
7
7
  This will complete for all bundler commands (`install`, `outdated`, `show`,
8
8
  etc.). Completion is also made for installed gems and their binaries (for
9
- `bundle update`, `bundle exec`, etc.).
9
+ `bundle update`, `bundle exec`, etc.). [Rake](http://rake.rubyforge.org/)
10
+ tasks are also completed.
10
11
 
11
12
  ## Installation
12
13
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.2.0
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
15
15
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
16
16
  s.require_paths = ['lib']
17
17
 
18
- s.add_development_dependency 'debugger', '~> 1.1.0'
19
- s.add_development_dependency 'rake', '~> 0.9.2.2'
20
- s.add_development_dependency 'rspec', '~> 2.10.0'
18
+ s.add_development_dependency 'debugger', '~> 1.2.0'
19
+ s.add_development_dependency 'rake', '~> 10.0.0'
20
+ s.add_development_dependency 'rspec', '~> 2.12.0'
21
21
  end
@@ -114,8 +114,9 @@ class BundlerBashCompletion
114
114
  end
115
115
 
116
116
  def complete
117
- return tasks_completion if tasks_completion?
117
+ return rake_tasks_completion if rake_tasks_completion?
118
118
  return task_options_completion if task_options_completion?
119
+ return tasks_completion if tasks_completion?
119
120
  []
120
121
  end
121
122
 
@@ -137,6 +138,12 @@ class BundlerBashCompletion
137
138
  end
138
139
  end
139
140
 
141
+ def rake_tasks
142
+ @rake_tasks ||= `bundle exec rake -T`.split("\n").map { |line| line[/^rake (.+)\s+# /, 1].strip }
143
+ rescue
144
+ []
145
+ end
146
+
140
147
  def task
141
148
  @task ||= (completion_step > 1) ? arguments[1].to_s : ''
142
149
  end
@@ -177,6 +184,14 @@ class BundlerBashCompletion
177
184
  end
178
185
  end
179
186
 
187
+ def rake_tasks_completion
188
+ rake_tasks.select { |t| t.start_with?(completion_word) }
189
+ end
190
+
191
+ def rake_tasks_completion?
192
+ bundle_command? && completion_step == 3 && task == 'exec' && task_options == ['rake']
193
+ end
194
+
180
195
  def tasks_completion
181
196
  TASKS.keys.select { |t| t.start_with?(completion_word) }
182
197
  end
@@ -208,18 +208,26 @@ describe BundlerBashCompletion do
208
208
 
209
209
  end
210
210
 
211
- context 'with "bundle exec rake "' do
211
+ context 'with "bundle exec foo "' do
212
212
 
213
213
  it 'is an empty array' do
214
- completion('bundle exec rake ').complete.should == []
214
+ completion('bundle exec foo ').complete.should == []
215
215
  end
216
216
 
217
217
  end
218
218
 
219
- context 'with "bundle exec foo "' do
219
+ context 'with "bundle exec rake "' do
220
220
 
221
- it 'is an empty array' do
222
- completion('bundle exec foo ').complete.should == []
221
+ it 'is rake tasks' do
222
+ completion('bundle exec rake ').complete.should include('release', 'spec', 'build')
223
+ end
224
+
225
+ end
226
+
227
+ context 'with "bundle exec rake re"' do
228
+
229
+ it 'is ["release"]' do
230
+ completion('bundle exec rake re').complete.should == ['release']
223
231
  end
224
232
 
225
233
  end
@@ -274,6 +282,14 @@ describe BundlerBashCompletion do
274
282
 
275
283
  end
276
284
 
285
+ describe '#rake_tasks' do
286
+
287
+ it 'returns rake tasks' do
288
+ completion.rake_tasks.should include('default', 'install', 'build')
289
+ end
290
+
291
+ end
292
+
277
293
  describe '#task' do
278
294
 
279
295
  it 'is an empty string when not ending with a whitespace' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundler_bash_completion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,41 +9,56 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-29 00:00:00.000000000 Z
12
+ date: 2012-11-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: debugger
16
- requirement: &70322947658360 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 1.1.0
21
+ version: 1.2.0
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70322947658360
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 1.2.0
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: rake
27
- requirement: &70322947657840 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ~>
31
36
  - !ruby/object:Gem::Version
32
- version: 0.9.2.2
37
+ version: 10.0.0
33
38
  type: :development
34
39
  prerelease: false
35
- version_requirements: *70322947657840
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 10.0.0
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: rspec
38
- requirement: &70322947653000 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ~>
42
52
  - !ruby/object:Gem::Version
43
- version: 2.10.0
53
+ version: 2.12.0
44
54
  type: :development
45
55
  prerelease: false
46
- version_requirements: *70322947653000
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 2.12.0
47
62
  description: Provides bash completion for bundle command
48
63
  email: al@alweb.org
49
64
  executables:
@@ -78,7 +93,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
78
93
  version: '0'
79
94
  segments:
80
95
  - 0
81
- hash: -2345535026189476707
96
+ hash: 4263429861351600212
82
97
  required_rubygems_version: !ruby/object:Gem::Requirement
83
98
  none: false
84
99
  requirements:
@@ -87,10 +102,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
102
  version: '0'
88
103
  segments:
89
104
  - 0
90
- hash: -2345535026189476707
105
+ hash: 4263429861351600212
91
106
  requirements: []
92
107
  rubyforge_project: bundler_bash_completion
93
- rubygems_version: 1.8.17
108
+ rubygems_version: 1.8.23
94
109
  signing_key:
95
110
  specification_version: 3
96
111
  summary: Bundler bash completion