Created
May 20, 2012 05:08
-
-
Save no6v/2749548 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Earthquake.init do | |
command :history_cleaner do |m| | |
re = Regexp.new(m[1]) | |
to_be_removed = [] | |
Readline::HISTORY.each_with_index do |entry, index| | |
if re === entry | |
puts "to be removed: #{entry}" | |
to_be_removed << index | |
end | |
end | |
if confirm("ok?", :y) | |
to_be_removed.reverse_each do |index| | |
Readline::HISTORY.delete_at(index) | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment