lib/serially/serially.rb
def serially(*args, &block)
        options = args[0] || {}
        invalid_options = Serially::GlobalOptions.validate(options)
        raise Serially::ConfigurationError.new("Serially received the following invalid options: #{invalid_options}") if invalid_options.present?

        # If TaskManager for current including class doesn't exist, create it
        Serially::TaskManager[self] ||= Serially::TaskManager.new(self, options)
        task_manager = Serially::TaskManager[self]

        # create a new base, and resolve DSL
        @serially = Serially::Base.new(task_manager)
        if block
          @serially.instance_eval(&block)
        else
          raise Serially::ConfigurationError.new("Serially is defined without a block of tasks definitions in class #{self}")
        end

        # return Serially::Base
        @serially
      end
# make sure inheritance works with Serially
make sure inheritance works with Serially
make sure inheritance works with Serially
def serially(*args, &block)
        options = args[0] || {}
        invalid_options = Serially::GlobalOptions.validate(options)
        raise Serially::ConfigurationError.new("Serially received the following invalid options: #{invalid_options}") if invalid_options.present?
        Serially::TaskManager[self] ||= Serially::TaskManager.new(self, options)
        task_manager = Serially::TaskManager[self]
        @serially = Serially::Base.new(task_manager)
        if block
          @serially.instance_eval(&block)
        else
          raise Serially::ConfigurationError.new("Serially is defined without a block of tasks definitions in class #{self}")
        end
        @serially
      end
def serially ( * args , & block ) options = args [ 0 ] || { } invalid_options = Serially :: GlobalOptions . validate ( options ) raise Serially :: ConfigurationError . new ( "Serially received the following invalid options: #{invalid_options}" ) if invalid_options . present? Serially :: TaskManager [ self ] ||= Serially :: TaskManager . new ( self , options ) task_manager = Serially :: TaskManager [ self ] @serially = Serially :: Base . new ( task_manager ) if block @serially . instance_eval ( & block ) else raise Serially :: ConfigurationError . new ( "Serially is defined without a block of tasks definitions in class #{self}" ) end @serially end
make sure inheritance works with Serially
make sure inheritance works with Serially
# If TaskManager for current including class doesn't exist, create it # create a new base, and resolve DSL # return Serially::Base
args
block