Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.2
0.4.3
11 changes: 6 additions & 5 deletions exe/rbcli
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ end

Rbcli.command "portable" do
description 'Creates a portable Rbcli executable'
usage "(--(d)ocs|--use-(b)undler|--(f)orce) <application_name>"
usage "(--(a)nnotate|--use-(b)undler|--(f)orce) <application_name>"
helptext <<~HELPTEXT
This will initialize a portable Rbcli project in the current directory.

Expand Down Expand Up @@ -72,7 +72,7 @@ end

Rbcli.command "gem" do
description 'Creates an full Rbcli-based gem project'
usage "(--(f)orce) <application_name>"
usage "(--(a)nnotate|--(f)orce) <application_name>"
helptext <<~HELPTEXT
This will initialize an complete Rbcli project in the current directory.

Expand All @@ -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|
Expand All @@ -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')
Expand All @@ -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'))
Expand Down
3 changes: 2 additions & 1 deletion lib/rbcli/components/logger/logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/rbcli/util/string_compression.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)) } }
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)) } }
Loading