lib/teapot/context.rb in teapot-3.0.0 vs lib/teapot/context.rb in teapot-3.1.0
- old
+ new
@@ -46,12 +46,12 @@
def repository
@repository ||= Rugged::Repository.new(@root.to_s)
end
- def select(names = [], configuration = @configuration)
- Select.new(self, configuration, names)
+ def select(names = nil, configuration = @configuration)
+ Select.new(self, configuration, names || [])
end
def substitutions
substitutions = Build::Text::Substitutions.new
@@ -67,10 +67,13 @@
substitutions['PROJECT_IDENTIFIER'] = name.identifier
# e.g. foo-bar, typically used for targets, executables
substitutions['PROJECT_TARGET_NAME'] = name.target
+ # e.g. foo_bar, typically used for variables.
+ substitutions['PROJECT_VARIABLE_NAME'] = name.key
+
substitutions['LICENSE'] = @project.license
end
# The user's current name:
substitutions['AUTHOR_NAME'] = repository.config['user.name']
@@ -103,13 +106,13 @@
private
def load_root_package(**options)
# Load the root package:
script = load(root_package)
-
+
# Find the default configuration, if it exists:
if configuration_name = options[:configuration]
- @configuration = @configurations[configuration_name]
+ @configuration = script.configurations[configuration_name]
else
@configuration = script.default_configuration
end
@project = script.default_project