Sha256: 9066195bf075a0b1f96bcc1b67b38a2e620e6ebca93b649d069493ca51465231

Contents?: true

Size: 605 Bytes

Versions: 5

Compression:

Stored size: 605 Bytes

Contents

module Saber
  # Usage
  # 
  #   require "saber/task/make"
  #   Saber::Task["make"].invoke
  #
  # Define a new task
  #
  #   class HelloWorld < Task::Base
  #     def invoke(*args, &blk)
  #       p args
  #     end
  #   end
  #
  #   Task.hello_world(1, 2)   ->  [1, 2]
  module Task 
    autoload :Base, "saber/task/base"
    autoload :Clean, "saber/task/clean"
    autoload :Make, "saber/task/make"
    autoload :Upload, "saber/task/upload"

    @@tasks = {}

    # a list of all tasks 
    mattr_reader :tasks

    class << self
      def [](name)
        tasks[name]
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
saber-1.1.1 lib/saber/task.rb
saber-1.1.0 lib/saber/task.rb
saber-1.0.2 lib/saber/task.rb
saber-1.0.1 lib/saber/task.rb
saber-1.0.0 lib/saber/task.rb