lib/cli_spinnable.rb in cli_spinnable-0.1 vs lib/cli_spinnable.rb in cli_spinnable-0.2
- old
+ new
@@ -4,18 +4,26 @@
require 'cli_spinnable/line/sign'
require 'cli_spinnable/line'
require 'cli_spinnable/writer'
module CliSpinnable
- def with_spinner
- writer = Writer.new(STDOUT, Line.new)
- yield writer
- writer.finalize
- self
- rescue CliSpinnableError => e
- raise e
- rescue StandardError => e
- writer.failure
- writer.finalize
- raise e
+ module Methods
+ def with_spinner
+ writer = Writer.new(STDOUT, Line.new)
+ yield writer
+ writer.finalize
+ self
+ rescue CliSpinnableError => e
+ raise e
+ rescue StandardError => e
+ writer.failure
+ writer.finalize
+ raise e
+ end
+ end
+
+ include Methods
+
+ class << self
+ include Methods
end
end