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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
LC_ALL: en_US.UTF-8

strategy:
matrix: { ruby: ['3.3', '3.3', '3.4', '4.0'] }
matrix: { ruby: ['3.3', '3.4', '4.0'] }

steps:
- name: Checkout code
Expand Down
2 changes: 1 addition & 1 deletion lib/bashly/libraries/settings/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ env: development
# - always # render this feature in any environment
# - never # do not render this feature
enable_header_comment: always
enable_bash3_bouncer: always
enable_bash_version_bouncer: always
enable_completions: never
enable_view_markers: development
enable_inspect_args: development
Expand Down
2 changes: 1 addition & 1 deletion lib/bashly/script/wrapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def header!

def default_header
result = render 'header'
result += render('bash3_bouncer') unless function_name || !Settings.enabled?(:bash3_bouncer)
result += render('bash_version_bouncer') unless function_name || !Settings.enabled?(:bash_version_bouncer)
result
end

Expand Down
6 changes: 3 additions & 3 deletions lib/bashly/settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class << self
:compact_short_flags,
:conjoined_flag_args,
:config_path,
:enable_bash3_bouncer,
:enable_bash_version_bouncer,
:enable_completions,
:enable_deps_array,
:enable_env_var_names_array,
Expand Down Expand Up @@ -65,8 +65,8 @@ def enabled?(feature)
(send(:"enable_#{feature}") == 'development' && !production?)
end

def enable_bash3_bouncer
@enable_bash3_bouncer ||= get :enable_bash3_bouncer
def enable_bash_version_bouncer
@enable_bash_version_bouncer ||= get :enable_bash_version_bouncer
end

def enable_completions
Expand Down
6 changes: 3 additions & 3 deletions schemas/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@
],
"default": "always"
},
"enable_bash3_bouncer": {
"title": "enable_bash3_bouncer",
"description": "Whether to include the code snippet that aborts when an old version of bash is detected in the generated script\nhttps://bashly.dev/usage/settings/#enable_bash3_bouncer",
"enable_bash_version_bouncer": {
"title": "enable_bash_version_bouncer",
"description": "Whether to include the code snippet that aborts when an old version of bash is detected in the generated script\nhttps://bashly.dev/usage/settings/#enable_bash_version_bouncer",
"type": "string",
"enum": [
"development",
Expand Down
2 changes: 1 addition & 1 deletion spec/approvals/script/wrapper/code
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This script was generated by bashly ... (https://bashly.dev)
# Modifying it manually is not recommended

# :wrapper.bash3_bouncer
# :wrapper.bash_version_bouncer
if ((BASH_VERSINFO[0] < 4 || (BASH_VERSINFO[0] == 4 && BASH_VERSINFO[1] < 2))); then
printf "bash version 4.2 or higher is required\n" >&2
exit 1
Expand Down
2 changes: 1 addition & 1 deletion spec/bashly/commands/generate_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
cp 'lib/bashly/templates/bashly.yml', "#{source_dir}/bashly.yml"
end

it 'generates the cli script wrapped in a function without bash3 bouncer' do
it 'generates the cli script wrapped in a function without bash version bouncer' do
expect { subject.execute %w[generate --wrap function] }.to output_approval('cli/generate/wrap-function')
expect(File).to exist(cli_script)
lines = File.readlines cli_script
Expand Down
2 changes: 1 addition & 1 deletion spec/bashly/script/wrapper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
context 'with function name' do
subject { described_class.new command, 'my_super_function' }

it 'returns the complete script wrapped in a function without a bash3 bouncer' do
it 'returns the complete script wrapped in a function without a bash version bouncer' do
lines = subject.code.split "\n"
expect(lines[0..13].join("\n")).to match_approval('script/wrapper/code-wrapped')
.except(/\d+\.\d+\.\d+(\.rc\d)?/)
Expand Down
6 changes: 3 additions & 3 deletions support/schema/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,11 @@ properties:
- always
- never
default: always
enable_bash3_bouncer:
title: enable_bash3_bouncer
enable_bash_version_bouncer:
title: enable_bash_version_bouncer
description: |-
Whether to include the code snippet that aborts when an old version of bash is detected in the generated script
https://bashly.dev/usage/settings/#enable_bash3_bouncer
https://bashly.dev/usage/settings/#enable_bash_version_bouncer
type: string
enum: *feature_toggles
default: always
Expand Down