Sha256: 3ceb2f3ca56c4f5bcd98403fd781d381827d5b5b9622c29b021af4e9c84ae331

Contents?: true

Size: 450 Bytes

Versions: 47

Compression:

Stored size: 450 Bytes

Contents

module Ruboto
  module Util
    module LogAction
      ###########################################################################
      #
      # log_action: put text to stdout around the execution of a block
      #
      
      def log_action(initial_text, final_text="Done.", &block)
        $stdout.sync = true

        print initial_text, "..."
        result = yield
        puts final_text
        
        result
      end
    end
  end
end

Version data entries

47 entries across 47 versions & 2 rubygems

Version Path
ruboto-0.5.2 lib/ruboto/util/log_action.rb
ruboto-core-0.5.1 lib/ruboto/util/log_action.rb
ruboto-core-0.4.1.rc.4 lib/ruboto/util/log_action.rb
ruboto-core-0.4.0 lib/ruboto/util/log_action.rb
ruboto-core-0.3.3 lib/ruboto/util/log_action.rb
ruboto-core-0.2.1 lib/ruboto/util/log_action.rb
ruboto-core-0.1.0 lib/ruboto/util/log_action.rb