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-1.6.1 lib/ruboto/util/log_action.rb
ruboto-1.6.0 lib/ruboto/util/log_action.rb
ruboto-1.5.0 lib/ruboto/util/log_action.rb
ruboto-1.4.1 lib/ruboto/util/log_action.rb
ruboto-1.4.0 lib/ruboto/util/log_action.rb
ruboto-1.3.1 lib/ruboto/util/log_action.rb
ruboto-1.3.0 lib/ruboto/util/log_action.rb
ruboto-1.2.0 lib/ruboto/util/log_action.rb
ruboto-1.1.2 lib/ruboto/util/log_action.rb
ruboto-1.1.1 lib/ruboto/util/log_action.rb
ruboto-1.1.0 lib/ruboto/util/log_action.rb
ruboto-1.0.3 lib/ruboto/util/log_action.rb
ruboto-1.0.2 lib/ruboto/util/log_action.rb
ruboto-1.0.1 lib/ruboto/util/log_action.rb
ruboto-1.0.0 lib/ruboto/util/log_action.rb
ruboto-0.16.0 lib/ruboto/util/log_action.rb
ruboto-0.15.0 lib/ruboto/util/log_action.rb
ruboto-0.14.0 lib/ruboto/util/log_action.rb
ruboto-0.13.0 lib/ruboto/util/log_action.rb
ruboto-0.12.0 lib/ruboto/util/log_action.rb