Sha256: b43ca21214e69152a66a9f7d569129f3867da0ae3830581d89bea3c577491efd

Contents?: true

Size: 739 Bytes

Versions: 5

Compression:

Stored size: 739 Bytes

Contents

require 'leeroy/task'

module Leeroy
  module Task
    class Stub < Leeroy::Task::Base

      def perform(args = self.args, options = self.options, global_options = self.global_options)
        super

        begin
          message = self.state.message

          increment = self.options[:increment].to_i
          logger.debug "increment: #{increment}"

          logger.info "old message: #{message}"

          if message.nil?
            message = increment
          else
            message = message.to_i + increment
          end

          state.message = message

          logger.info "new message: #{message}"

          dump_state

        rescue StandardError => e
          raise e
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
leeroy_app-0.5.4 lib/leeroy/task/stub.rb
leeroy_app-0.4.0 lib/leeroy/task/stub.rb
leeroy_app-0.3.1 lib/leeroy/task/stub.rb
leeroy_app-0.3.0 lib/leeroy/task/stub.rb
leeroy_app-0.2.1 lib/leeroy/task/stub.rb