Sha256: 5074516135028784b2a50163e06a2cd7028a562a5c0e0df6a7711765a141c9f9

Contents?: true

Size: 442 Bytes

Versions: 5

Compression:

Stored size: 442 Bytes

Contents

require "active_support/core_ext/string/inflections"

module Saber 
  module Task
    class Base < Thor
      class << self
        def inherited(child)
          Task.tasks[child.name.demodulize.underscore] = child
        end

        # delegate to #invoke
        def invoke(*args)
          new.invoke(*args)
        end
      end

      def initialize(*)
        super
        self.options = self.options.dup
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
saber-1.2.4 lib/saber/task/base.rb
saber-1.2.3 lib/saber/task/base.rb
saber-1.2.2 lib/saber/task/base.rb
saber-1.2.1 lib/saber/task/base.rb
saber-1.2.0 lib/saber/task/base.rb