Sha256: b48151a8dd0e89b5fc6acdc69569ce48dad4beea8f23b79d312ff18ebc028e4b

Contents?: true

Size: 1.02 KB

Versions: 13

Compression:

Stored size: 1.02 KB

Contents

class EcoRake
  module Options
    module DefaultLookup
      class << self
        def included(base)
          super(base)
          base.extend EcoRake::Base::MethodHelpers
          base.extend ClassMethods
        end
      end

      module ClassMethods
        # @note it extends `RakeCommander::Options`
        #   1. default can be re-configured via callback or constant
        # [ @see RakeCommander::Options::option ]
        def option(*args, default_lookup: :not_used, **kargs, &block)
          kargs.merge!(default: symbol_resolver(default_lookup, as: %i[method const])) unless default_lookup == :not_used
          super(*args, **kargs, &block)
        end

        # [ @see RakeCommander::Options::option_reopen ]
        def option_reopen(*args, default_lookup: :not_used, **kargs, &block)
          kargs.merge!(default: symbol_resolver(default_lookup, as: %i[method const])) unless default_lookup == :not_used
          super(*args, **kargs, &block)
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
eco-rake-0.2.6 lib/eco-rake/options/default_lookup.rb
eco-rake-0.2.5 lib/eco-rake/options/default_lookup.rb
eco-rake-0.2.4 lib/eco-rake/options/default_lookup.rb
eco-rake-0.2.3 lib/eco-rake/options/default_lookup.rb
eco-rake-0.2.2 lib/eco-rake/options/default_lookup.rb
eco-rake-0.2.1 lib/eco-rake/options/default_lookup.rb
eco-rake-0.2.0 lib/eco-rake/options/default_lookup.rb
eco-rake-0.1.6 lib/eco-rake/options/default_lookup.rb
eco-rake-0.1.5 lib/eco-rake/options/default_lookup.rb
eco-rake-0.1.4 lib/eco-rake/options/default_lookup.rb
eco-rake-0.1.3 lib/eco-rake/options/default_lookup.rb
eco-rake-0.1.2 lib/eco-rake/options/default_lookup.rb
eco-rake-0.1.1 lib/eco-rake/options/default_lookup.rb