lib/gemsmith/cli/parsers/build.rb in gemsmith-17.0.1 vs lib/gemsmith/cli/parsers/build.rb in gemsmith-18.0.0
- old
+ new
@@ -5,31 +5,35 @@
module Gemsmith
module CLI
module Parsers
# Handles parsing of Command Line Interface (CLI) build options.
class Build
+ include Import[:colorizer]
+
using Refinements::Structs
def self.call(...) = new(...).call
def initialize configuration = Container[:configuration],
client: Parser::CLIENT,
- container: Container
+ **dependencies
+
+ super(**dependencies)
+
@configuration = configuration
@client = client
- @container = container
end
def call arguments = []
add_cli
client.parse arguments
configuration
end
private
- attr_reader :configuration, :client, :container
+ attr_reader :configuration, :client
def add_cli
client.on(
"--[no-]cli",
"Add command line interface. #{default __method__}."
@@ -44,11 +48,9 @@
.sub("add_", "build_")
.then { |attribute| configuration.public_send attribute }
.then { |boolean| boolean ? colorizer.green(boolean) : colorizer.red(boolean) }
.then { |colored_boolean| "Default: #{colored_boolean}" }
end
-
- def colorizer = container[__method__]
end
end
end
end