Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Nested config applies defaults even when specified

#27
  • nested configs initialize with defaults and then are reconfigured, evidently. this means incorrect defaults cannot be used: Given this task:
  require 'tap/task'

  # Request::task
  class Request < Tap::Task
    nest :a do
      config :b, nil, &c.integer
    end
  
    def process
      puts a.b
    end
  end

This will result

% rap request --a:b 1
expected [Integer] but was: nil

Normally if a switch is specified on the command line, the default will not be applied. This allows the rare case where you want an invalid default. Evidently nested configs initialize with defaults and then are reconfigured, and this should not be the case.

Reported by bahuvrihi · July 14th, 2009 @ 08:26 PM

State: new
Milestone: none
Assigned to: nobody

Activity

No comments yet.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.