sdbcli 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/bin/sdbcli +3 -2
  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.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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sdbcli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: