lib/gemsmith/templates/%project_name%/lib/%project_path%/container.rb.erb in gemsmith-21.4.0 vs lib/gemsmith/templates/%project_name%/lib/%project_path%/container.rb.erb in gemsmith-21.5.0
- old
+ new
@@ -1,31 +1,28 @@
require "cogger"
-require "dry/container"
+require "containable"
require "etcher"
require "runcom"
require "spek"
<% namespace do %>
# Provides a global gem container for injection into other objects.
module Container
- extend Dry::Container::Mixin
+ extend Containable
- register :configuration, memoize: true do
+ register :configuration do
self[:defaults].add_loader(Etcher::Loaders::YAML.new(self[:xdg_config].active))
.then { |registry| Etcher.call registry }
end
- register :defaults, memoize: true do
+ register :defaults do
Etcher::Registry.new(contract: Configuration::Contract, model: Configuration::Model)
.add_loader(Etcher::Loaders::YAML.new(self[:defaults_path]))
end
- register :specification, memoize: true do
- Spek::Loader.call "#{__dir__}/<%= Array.new(2 + configuration.project_levels, "../").join %><%= configuration.project_name %>.gemspec"
- end
-
- register(:defaults_path, memoize: true) { Pathname(__dir__).join("configuration/defaults.yml") }
- register(:xdg_config, memoize: true) { Runcom::Config.new "<%= configuration.project_path %>/configuration.yml" }
- register(:logger, memoize: true) { Cogger.new id: "<%= configuration.project_name %>" }
+ register(:specification) { Spek::Loader.call "#{__dir__}/<%= Array.new(2 + configuration.project_levels, "../").join %><%= configuration.project_name %>.gemspec" }
+ register(:defaults_path) { Pathname(__dir__).join("configuration/defaults.yml") }
+ register(:xdg_config) { Runcom::Config.new "<%= configuration.project_path %>/configuration.yml" }
+ register(:logger) { Cogger.new id: "<%= configuration.project_name %>" }
register :kernel, Kernel
end
<% end %>