Sha256: 09dc9e48788be878bdd90ccf759aa248f0df0d2035ada4bfa35f9efb5528334e
Contents?: true
Size: 1.42 KB
Versions: 22
Compression:
Stored size: 1.42 KB
Contents
require 'rake' require 'rake/tasklib' # :nodoc: module Prmd # :nodoc: module RakeTasks # Common class for Prmd rake tasks # # @api private class Base < Rake::TaskLib # The name of the task # @return [String] the task name attr_accessor :name # Options to pass to command # @return [Hash<Symbol, Object>] the options passed to the Prmd command attr_accessor :options # Creates a new task with name +name+. # # @param [Hash<Symbol, Object>] options # .option [String, Symbol] name the name of the rake task # .option [String, Symbol] options options to pass to the Prmd command def initialize(options = {}) @name = options.fetch(:name, default_name) @options = options.fetch(:options) { {} } yield self if block_given? define end private # This method will be removed in the future # @api private def legacy_parameters(*args) if args.size == 0 return {} else arg, = *args case arg when String, Symbol warn "#{self.class}.new(name) has been deprecated, use .new(name: name) instead" return { name: arg } else return arg end end end # Default name of the rake task # # @return [Symbol] def default_name :base end end end end
Version data entries
22 entries across 22 versions & 1 rubygems