lib/arachni/mixins/terminal.rb in arachni-0.4.0.4 vs lib/arachni/mixins/terminal.rb in arachni-0.4.1

- old
+ new

@@ -1,13 +1,19 @@ =begin - Arachni - Copyright (c) 2010-2012 Tasos "Zapotek" Laskos <tasos.laskos@gmail.com> + Copyright 2010-2012 Tasos Laskos <tasos.laskos@gmail.com> - This is free software; you can copy and distribute and modify - this program under the term of the GPL v2.0 License - (See LICENSE file for details) + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. =end module Arachni module Mixins @@ -25,20 +31,20 @@ # # include Terminal # include ProgressBar # # # clear the screen -# clear_screen! +# clear_screen # # start_time = Time.now # # MAX = 5000 # (1..MAX).each { # |i| # # # move the cursor to its home, top-left of the screen. -# move_to_home! +# move_to_home # # prog = i / Float( MAX ) * 100 # # reputs "Counting to #{MAX}..." # reputs "Progress: #{prog}%" @@ -48,11 +54,11 @@ # reprint eta( prog, start_time ) + " " # reputs progress_bar( prog.ceil ) # # # # make sure that everything is sent out on time -# flush! +# flush # sleep 0.003 # } # module Terminal @@ -79,24 +85,24 @@ end # # Clear the bottom of the screen # - def clear_screen! + def clear_screen print "\e[2J" end # # Moves cursor top left to its home # - def move_to_home! + def move_to_home print "\e[H" end # # Flushes the STDOUT buffer # - def flush! + def flush $stdout.flush end extend self end