module Spark
Overview
Spark is a CLI Utility library that makes working with users on the command line simpler than ever.
Extended Modules
Defined in:
spark.crspark/file.cr
spark/file/create_file.cr
spark/prompt.cr
spark/prompt/confirmation_question.cr
spark/prompt/question.cr
spark/prompt/statement.cr
spark/shard.cr
spark/shard/shard_content.cr
spark/shard/shard_file.cr
spark/template.cr
Constant Summary
-
VERSION =
{{ (`shards version \"/srv/crystaldoc.info/github-stephendolan-spark-v1.15.0/src\"`).chomp.stringify }}
Instance Method Summary
-
#indent
Increase the indentation level for
Spark
output by one level. - #indent_level
-
#logger : Spark::Prompt
Which object to use for logging optional output to users.
-
#logger=(logger : Spark::Prompt)
Control which object is used to log optional output to users.
-
#outdent
Decrease the indentation level for
Spark
output by one level. -
#quiet(active : Bool = true, &)
Force a block of code to run in a temporary quiet mode setting.
-
#quiet=(quiet)
Control whether or not optional terminal output is displayed to users.
-
#quiet?
Whether or not to suppress optional terminal output to users.
-
#reset_indentation
Reset the Spark indentation level back to 0.
Instance Method Detail
Control which object is used to log optional output to users.
Example:
Spark.logger = Spark::Prompt.new(input: File.tempfile.open, output: File.tempfile.open)
Decrease the indentation level for Spark
output by one level.
Cannot be decreased below zero.
Force a block of code to run in a temporary quiet mode setting.
Example temporarily enabling:
Spark.quiet do
Spark::Prompt.new.log_action("TESTING")
end
# => ""
Example temporarily disabling:
Spark.quiet(false) do
Spark::Prompt.new.log_action("TESTING")
end
# => ""
Control whether or not optional terminal output is displayed to users.
Example:
Spark.logger.log_action("Testing") # => This will print something to the user
Spark.quiet = true
Spark.logger.log_action("Testing") # => Nothing will print to the user