lib/teapot/context.rb in teapot-0.7.3 vs lib/teapot/context.rb in teapot-0.7.5
- old
+ new
@@ -53,11 +53,10 @@
# Load the root package:
defined = load(root_package)
# Find the default configuration, if it exists:
-
@default_configuration = defined.default_configuration
if options[:configuration]
@configuration = @configurations[options[:configuration]]
else
@@ -116,10 +115,11 @@
when Generator
AlreadyDefinedError.check(definition, @generators)
@generators[definition.name] = definition
when Configuration
- if definition.public?
+ # We define configurations in two cases, if they are public, or if they are part of the root package of this context.
+ if definition.public? or definition.package == @root_package
# The root package implicitly defines the default configuration.
if definition.name == DEFAULT_CONFIGURATION_NAME
raise AlreadyDefinedError.new(definition, root_package)
end