sdbcli 0.3.3 → 0.3.4
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.
- data/bin/sdbcli +3 -2
- metadata +1 -1
data/bin/sdbcli
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
$LOAD_PATH << File.join(File.expand_path(File.dirname(__FILE__)), '..', 'lib')
|
3
3
|
|
4
|
-
Version = '0.3.
|
4
|
+
Version = '0.3.4'
|
5
5
|
HISTORY_FILE = File.join((ENV['HOME'] || ENV['USERPROFILE'] || '.'), '.sdbcli_history')
|
6
|
+
HISTSIZE = 500
|
6
7
|
|
7
8
|
require 'rubygems'
|
8
9
|
require 'sdbcli'
|
@@ -140,7 +141,7 @@ end
|
|
140
141
|
at_exit do
|
141
142
|
unless Readline::HISTORY.empty?
|
142
143
|
open(HISTORY_FILE, 'wb') do |f|
|
143
|
-
Readline::HISTORY.each do |line|
|
144
|
+
Readline::HISTORY.to_a.slice(-(Readline::HISTORY.length < HISTSIZE ? Readline::HISTORY.length : HISTSIZE)..-1).each do |line|
|
144
145
|
next if /\A\s*\Z/ =~ line
|
145
146
|
f.puts line
|
146
147
|
end
|