diff --git a/CHANGELOG.md b/CHANGELOG.md index 9921a7c..211f2ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Rbcli Changelog +## 0.4.3 (Oct 22, 2025) + +### Improvements + +* Improved efficiency of string compression by using `Base64.strict_encode64` +* Added an option to write annotations to skeleton rbcli gems +* Added an option to exit when using Logger.fatal + +### Bugfixes + +* Fixed an error which caused the rbcli initializer not to generate skeleton projects + ## 0.4.2 (May 1, 2025) ### Features diff --git a/VERSION b/VERSION index f7abe27..70d5b25 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.4.2 \ No newline at end of file +0.4.3 \ No newline at end of file diff --git a/exe/rbcli b/exe/rbcli index beeb6ff..d202908 100755 --- a/exe/rbcli +++ b/exe/rbcli @@ -35,7 +35,7 @@ end Rbcli.command "portable" do description 'Creates a portable Rbcli executable' - usage "(--(d)ocs|--use-(b)undler|--(f)orce) " + usage "(--(a)nnotate|--use-(b)undler|--(f)orce) " helptext <<~HELPTEXT This will initialize a portable Rbcli project in the current directory. @@ -72,7 +72,7 @@ end Rbcli.command "gem" do description 'Creates an full Rbcli-based gem project' - usage "(--(f)orce) " + usage "(--(a)nnotate|--(f)orce) " helptext <<~HELPTEXT This will initialize an complete Rbcli project in the current directory. @@ -84,6 +84,7 @@ Rbcli.command "gem" do If you'd prefer a single-file executable script, run `rbcli portable --help` for more information. HELPTEXT + parameter :annotate, "Add annotations and examples for a more guided build" parameter :force, "Overwrite files without prompting" action do |opts, params, args, config, env| @@ -94,9 +95,9 @@ Rbcli.command "gem" do end vars = { appname: args.first, - use_bundler: params[:use_bundler], + use_bundler: false, development: env[:development], - showdocs: params[:docs] + showdocs: params[:annotate] } project_dir = File.join(Dir.getwd, vars[:appname]) config_dir = File.join(project_dir, 'lib', 'config') @@ -121,7 +122,7 @@ Rbcli.command "gem" do Rbcli.log.info "Running bundler gem", 'TOOL' `bundle gem --exe --coc #{vars[:appname]}` Rbcli.log.debug "Creating Rbcli project identifier", 'TOOL' - FileUtils.touch(File.join(project_dir), '.rbcli') + FileUtils.touch(File.join(project_dir, '.rbcli')) Rbcli.log.debug "Creating additional directories", 'TOOL' [config_dir, command_dir, scripts_dir].each { |dir| FileUtils.mkdir_p(dir) } FileUtils.touch(File.join(scripts_dir, '.keep')) diff --git a/lib/rbcli/components/logger/logger.rb b/lib/rbcli/components/logger/logger.rb index cd22449..be34298 100644 --- a/lib/rbcli/components/logger/logger.rb +++ b/lib/rbcli/components/logger/logger.rb @@ -89,8 +89,9 @@ def error message, progname = nil, &block self.add(Logger::ERROR, message, progname, &block) end - def fatal message, progname = nil, &block + def fatal message, progname = nil, exit_status: nil, &block self.add(Logger::FATAL, message, progname, &block) + Rbcli.exit(exit_status) unless exit_status.nil? end def unknown message, progname = nil, &block diff --git a/lib/rbcli/util/string_compression.rb b/lib/rbcli/util/string_compression.rb index e5dbc5a..1ec8275 100644 --- a/lib/rbcli/util/string_compression.rb +++ b/lib/rbcli/util/string_compression.rb @@ -6,5 +6,5 @@ require 'base64' require 'zlib' -String.instance_eval { define_method(:compress) { Base64.encode64(Zlib::Deflate.deflate(self)).chomp } } -String.instance_eval { define_method(:decompress) { Zlib::Inflate.inflate(Base64.decode64(self)) } } \ No newline at end of file +String.instance_eval { define_method(:compress) { Base64.strict_encode64(Zlib::Deflate.deflate(self)) } } +String.instance_eval { define_method(:decompress) { Zlib::Inflate.inflate(Base64.strict_decode64(self)) } } \ No newline at end of file