lib/teapot/configuration.rb
# Merge an external configuration into this configuration. We won't override already defined packages.
Merge an external configuration into this configuration. We won't override already defined packages.
Merge an external configuration into this configuration . We won ' t override already defined packages .
def merge(configuration)
			configuration.packages.each do |package|
				unless @packages.include? package
					package = Package.new(packages_path + package.name, package.name, @options.merge(package.options))
					@packages << package
					yield package
				end
			end
			configuration.imports.each do |import|
				unless @imports.include? import
					@imports << Import.new(import.name, import.explicit, @options.merge(import.options))
				end
			end
			configuration.targets.each do |key, value|
				@targets[key] += value
			end
			return self
		end
def merge ( configuration ) configuration . packages . each do | package | unless @packages . include? package package = Package . new ( packages_path + package . name , package . name , @options . merge ( package . options ) ) @packages << package yield package end end configuration . imports . each do | import | unless @imports . include? import @imports << Import . new ( import . name , import . explicit , @options . merge ( import . options ) ) end end configuration . targets . each do | key , value | @targets [ key ] += value end return self end
Merge an external configuration into this configuration.
Merge an external configuration into this configuration .
# The top level configuration will override packages that are defined by imported configurations. This is desirable behaviour, as it allows us to flatten the configuration but provide overrides if required.
configuration