earthquake 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -191,9 +191,8 @@ The 'm' is a MatchData.
191
191
  TODO
192
192
  ----
193
193
 
194
- * more intelligent completion
195
- * spec
196
194
  * change the config dir by ARGV
195
+ * spec
197
196
 
198
197
  Copyright
199
198
  ----
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.1
1
+ 0.5.2
data/earthquake.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{earthquake}
8
- s.version = "0.5.1"
8
+ s.version = "0.5.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["jugyo"]
@@ -92,9 +92,16 @@ module Earthquake
92
92
  end
93
93
 
94
94
  completion do |text|
95
- if Readline.line_buffer =~ /^\s*#{Regexp.quote(text)}/
96
- command_names.grep /^#{Regexp.quote(text)}/
95
+ results = []
96
+ regexp = /^#{Regexp.quote(text)}/
97
+ if Readline.line_buffer =~ /^\s*:\w*$/
98
+ results += command_names.grep(regexp)
97
99
  end
100
+ range = Readline::HISTORY.count >= 100 ? -100..-1 : 0..-1
101
+ results += Readline::HISTORY.to_a[range].map { |line|
102
+ line.gsub(/^\s*:\w/, '').split(/\s+/)
103
+ }.flatten.grep(regexp)
104
+ results
98
105
  end
99
106
  end
100
107
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: earthquake
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.5.1
5
+ version: 0.5.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - jugyo