repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/integration/rendering_mandoc_spec.rb | spec/bashly/integration/rendering_mandoc_spec.rb | # This spec tests that the rendering using the libraries/render templates
# is generating the expected output.
describe 'rendering mandoc', :stable do
subject { Commands::Render.new }
let(:source_dir) { Settings.source_dir }
target = 'spec/tmp'
examples = %w[
catch-all-advanced
dependencies-alt
do... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/integration/examples_spec.rb | spec/bashly/integration/examples_spec.rb | # This spec tests that the generated bash scripts are actually doing
# what they are supposed to do, and running without errors.
# It will run several tests on all the configuration files in the examples
# folder
#
# To only test examples containing a certain string in their path, run:
# EXAMPLE=yaml bundle exec run sp... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/integration/bash_spec.rb | spec/bashly/integration/bash_spec.rb | describe 'bash' do
context 'when bash version is < 4', :noci, :slow, :stable do
before { system 'docker pull bash:3 >/dev/null' }
it 'errors gracefully' do
command = 'docker run --rm -v $PWD:/app bash:3 bash /app/cli'
Dir.chdir 'spec/fixtures/workspaces/bash-3-syntax' do
system 'bashly g... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/extensions/file_spec.rb | spec/bashly/extensions/file_spec.rb | describe File do
describe '::deep_write' do
it 'creates parent directories and writes a file' do
expect(FileUtils).to receive(:mkdir_p).with('some/path')
expect(described_class).to receive(:write).with('some/path/file.txt', 'text')
described_class.deep_write 'some/path/file.txt', 'text'
end
... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/extensions/string_spec.rb | spec/bashly/extensions/string_spec.rb | describe String do
describe '#sanitize_for_print' do
subject { "this is\na \"new line\" with `backticks` and % symbol" }
it 'escapes newlines and quotes' do
expect(subject.sanitize_for_print).to eq 'this is\\na \"new line\" with \`backticks\` and %% symbol'
end
end
describe '#for_markdown' do
... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/extensions/array_spec.rb | spec/bashly/extensions/array_spec.rb | describe Array do
describe '#indent' do
subject { ['root:', ' indented:'] }
it 'prepends each element with spaces' do
expect(subject.indent(2)).to eq [' root:', ' indented:']
end
context 'when offset is 0' do
it 'returns the array as is' do
expect(subject.indent(0)).to eq su... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/extensions/yaml_spec.rb | spec/bashly/extensions/yaml_spec.rb | describe YAML do
describe '::load_erb_file' do
let(:path) { 'spec/fixtures/erb/simple.yml' }
it 'pre-processes the loaded YAML file with ERB' do
expect(described_class.load_erb_file(path).to_yaml).to match_approval('extensions/yaml/load-erb-file')
end
end
end
| ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/commands/preview_spec.rb | spec/bashly/commands/preview_spec.rb | describe Commands::Preview do
subject { described_class.new }
let(:source_dir) { Settings.source_dir }
describe 'preview --help' do
it 'shows long usage' do
expect { subject.execute %w[preview --help] }.to output_approval('cli/preview/help')
end
end
describe 'preview' do
before do
r... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/commands/completions_spec.rb | spec/bashly/commands/completions_spec.rb | describe Commands::Completions do
subject { described_class.new }
let(:leeway) { RUBY_VERSION < '3.2.0' ? 0 : 5 }
let(:completions_path) { File.expand_path 'lib/bashly/completions/bashly-completions.bash' }
let(:completions_script) { File.read completions_path }
let :mock_installer do
instance_double Com... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/commands/generate_spec.rb | spec/bashly/commands/generate_spec.rb | describe Commands::Generate, :slow do
subject { described_class.new }
let(:source_dir) { Settings.source_dir }
let(:target_dir) { Settings.target_dir }
let(:cli_script_content) { File.read cli_script }
describe 'generate --help' do
it 'shows long usage' do
expect { subject.execute %w[generate --he... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/commands/render_spec.rb | spec/bashly/commands/render_spec.rb | describe Commands::Render do
subject { described_class.new }
let(:leeway) { RUBY_VERSION < '3.2.0' ? 0 : 5 }
let(:source_dir) { Settings.source_dir }
let(:target) { 'spec/tmp' }
let(:mock_render_source) { double RenderSource, readme: '# Heading' }
describe 'render --help' do
it 'shows long usage' do
... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/commands/shell_spec.rb | spec/bashly/commands/shell_spec.rb | describe Commands::Shell do
subject { described_class.new }
describe 'shell --help' do
it 'shows long usage' do
expect { subject.execute %w[shell --help] }.to output_approval('cli/shell/help')
end
end
describe 'shell' do
let(:terminal_double) { instance_double MisterBin::Terminal, start: nil... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/commands/validate_spec.rb | spec/bashly/commands/validate_spec.rb | describe Commands::Validate do
subject { described_class.new }
let(:source_dir) { Settings.source_dir }
describe 'validate --help' do
it 'shows long usage' do
expect { subject.execute %w[validate --help] }.to output_approval('cli/validate/help')
end
end
describe 'validate' do
before do
... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/commands/add_spec.rb | spec/bashly/commands/add_spec.rb | describe Commands::Add do
subject { described_class.new }
let(:source_dir) { Settings.source_dir }
let(:target_dir) { Settings.target_dir }
describe 'add --help' do
it 'shows long usage' do
expect { subject.execute %w[add --help] }.to output_approval('cli/add/help')
end
end
describe 'add' d... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/commands/init_spec.rb | spec/bashly/commands/init_spec.rb | describe Commands::Init do
subject { described_class.new }
let(:src_dir) { Settings.source_dir }
describe 'init --help' do
it 'shows long usage' do
expect { subject.execute %w[init --help] }.to output_approval('cli/init/help')
end
end
describe 'init' do
before { reset_tmp_dir }
let(:... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/commands/doc_spec.rb | spec/bashly/commands/doc_spec.rb | describe Commands::Doc do
subject { described_class.new }
describe 'doc --help' do
it 'shows long usage' do
expect { subject.execute %w[doc --help] }.to output_approval('cli/doc/help')
end
end
describe 'doc' do
it 'shows all the help data' do
expect { subject.execute %w[doc] }.to outpu... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/script/dependency_spec.rb | spec/bashly/script/dependency_spec.rb | describe Script::Dependency do
subject do
options = load_fixture('script/commands')[fixture]
Script::Command.new(options).dependencies.first
end
let(:fixture) { :dependencies }
describe '::from_config' do
context 'with an unrecognized configuration' do
it 'returns an empty instahnce' do
... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/script/flag_spec.rb | spec/bashly/script/flag_spec.rb | describe Script::Flag do
subject do
options = load_fixture('script/flags')[fixture]
described_class.new options
end
let(:fixture) { :basic_flag }
describe 'composition' do
it 'includes the necessary modules' do
modules = [
Script::Introspection::Visibility, Script::Introspection::Val... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/script/formatter_spec.rb | spec/bashly/script/formatter_spec.rb | describe Script::Formatter do
subject { described_class.new script, mode: mode }
let(:script) { File.read "spec/fixtures/formatter/#{script_id}.sh" }
let(:script_id) { :simple }
let(:mode) { nil }
describe '#formatted_script' do
it 'formats the script using the internal formatter' do
expect(subjec... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/script/wrapper_spec.rb | spec/bashly/script/wrapper_spec.rb | describe Script::Wrapper do
subject { described_class.new command }
let(:command) { Script::Command.new config }
let(:config) { load_fixture('script/commands')[fixture] }
let(:fixture) { :basic_command }
describe '#code' do
context 'without function name' do
it 'returns the complete script' do
... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/script/command_spec.rb | spec/bashly/script/command_spec.rb | describe Script::Command do
subject do
result = described_class.new fixtures[fixture]
result.parents = result.options['parents']
result
end
let(:fixtures) { load_fixture 'script/commands' }
let(:fixture) { :basic_command }
describe 'composition' do
it 'includes the necessary modules' do
... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/script/argument_spec.rb | spec/bashly/script/argument_spec.rb | describe Script::Argument do
subject do
options = load_fixture('script/arguments')[fixture]
described_class.new options
end
let(:fixture) { :basic_argument }
describe 'composition' do
it 'includes the necessary modules' do
modules = [Script::Introspection::Validate]
expect(described_cl... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/script/base_spec.rb | spec/bashly/script/base_spec.rb | describe Script::Base do
subject { described_class.new options }
let(:options) { { 'name' => 'file', 'help' => "line one\nline two" } }
describe '::option_keys' do
it 'returns an empty array' do
expect(described_class.option_keys).to eq []
end
end
describe '#initialize' do
context 'with i... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/script/environment_variable_spec.rb | spec/bashly/script/environment_variable_spec.rb | describe Script::EnvironmentVariable do
subject do
options = load_fixture('script/env_vars')[fixture]
described_class.new options
end
let(:fixture) { :basic_env_var }
describe 'composition' do
it 'includes the necessary modules' do
modules = [Script::Introspection::Visibility, Script::Intros... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/script/catch_all_spec.rb | spec/bashly/script/catch_all_spec.rb | describe Script::CatchAll do
subject do
options = load_fixture('script/commands')[fixture]
Script::Command.new(options).catch_all
end
let(:fixture) { :basic_command }
describe '#label' do
context 'when catch_all is disabled' do
it 'returns nil' do
expect(subject.label).to be_nil
... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/script/introspection/visibility_spec.rb | spec/bashly/script/introspection/visibility_spec.rb | describe Script::Introspection::Visibility do
subject do
result = Script::Command.new fixtures[fixture]
result.parents = result.options['parents']
result
end
let(:fixtures) { load_fixture 'script/commands' }
let(:fixture) { :private_commands }
describe '#visibility' do
it 'returns :public fo... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/script/introspection/dependencies_spec.rb | spec/bashly/script/introspection/dependencies_spec.rb | describe Script::Introspection::Dependencies do
subject do
result = Script::Command.new fixtures[fixture]
result.parents = result.options['parents']
result
end
let(:fixtures) { load_fixture 'script/commands' }
let(:fixture) { :basic_command }
describe '#dependencies' do
let(:fixture) { :depe... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/script/introspection/flags_spec.rb | spec/bashly/script/introspection/flags_spec.rb | describe Script::Introspection::Flags do
subject do
result = Script::Command.new fixtures[fixture]
result.parents = result.options['parents']
result
end
let(:fixtures) { load_fixture 'script/commands' }
let(:fixture) { :basic_command }
describe '#default_flags' do
let(:fixture) { :default_va... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/script/introspection/variables_spec.rb | spec/bashly/script/introspection/variables_spec.rb | describe Script::Introspection::Variables do
subject do
result = Script::Command.new fixtures[fixture]
result.parents = result.options['parents']
result
end
let(:fixtures) { load_fixture 'script/commands' }
let(:fixture) { :variables }
describe '#variables' do
it 'returns an array of Variabl... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/script/introspection/environment_variables_spec.rb | spec/bashly/script/introspection/environment_variables_spec.rb | describe Script::Introspection::EnvironmentVariables do
subject do
result = Script::Command.new fixtures[fixture]
result.parents = result.options['parents']
result
end
let(:fixtures) { load_fixture 'script/commands' }
let(:fixture) { :environment_variable_enthusiast }
describe '#default_environm... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/script/introspection/commands_spec.rb | spec/bashly/script/introspection/commands_spec.rb | describe Script::Introspection::Commands do
subject do
result = Script::Command.new fixtures[fixture]
result.parents = result.options['parents']
result
end
let(:fixtures) { load_fixture 'script/commands' }
let(:fixture) { :basic_command }
describe '#command_aliases' do
let(:fixture) { :alias... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/script/introspection/arguments_spec.rb | spec/bashly/script/introspection/arguments_spec.rb | describe Script::Introspection::Arguments do
subject do
result = Script::Command.new fixtures[fixture]
result.parents = result.options['parents']
result
end
let(:fixtures) { load_fixture 'script/commands' }
let(:fixture) { :basic_command }
describe '#args' do
it 'returns an array of Argument... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/script/introspection/validate_spec.rb | spec/bashly/script/introspection/validate_spec.rb | describe Script::Introspection::Validate do
subject do
Script::Flag.new fixtures[fixture]
end
let(:fixtures) { load_fixture 'script/arguments' }
let(:fixture) { :basic_argument }
describe '#validate' do
context 'with a string value' do
let(:fixture) { :validate_string }
it 'returns it a... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/script/introspection/examples_spec.rb | spec/bashly/script/introspection/examples_spec.rb | describe Script::Introspection::Examples do
subject do
result = Script::Command.new fixtures[fixture]
result.parents = result.options['parents']
result
end
let(:fixtures) { load_fixture 'script/commands' }
let(:fixture) { :basic_command }
describe '#examples' do
context 'when there are no ex... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/libraries/render_mandoc_spec.rb | spec/bashly/libraries/render_mandoc_spec.rb | describe 'libraries/render/mandoc' do
subject do
RenderContext.new source: source, target: target, show: show
end
let(:leeway) { ENV['CI'] ? 10 : 0 }
let(:source) { 'lib/bashly/libraries/render/mandoc' }
let(:target) { 'spec/tmp' }
let(:show) { nil }
let(:config) { Bashly::Config.new "lib/bashly/tem... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/libraries/completions_yaml_spec.rb | spec/bashly/libraries/completions_yaml_spec.rb | describe Libraries::CompletionsYAML do
subject { described_class.new(*args) }
let(:args) { nil }
before { reset_tmp_dir example: 'minimal' }
describe '#files' do
it 'returns an array with a single hash' do
expect(subject.files.to_yaml).to match_approval('libraries/completions_yaml/files')
end
... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/libraries/completions_script_spec.rb | spec/bashly/libraries/completions_script_spec.rb | describe Libraries::CompletionsScript do
subject { described_class.new(*args) }
let(:args) { nil }
before { reset_tmp_dir example: 'minimal' }
describe '#files' do
it 'returns an array with a single hash' do
expect(subject.files.to_yaml).to match_approval('libraries/completions_script/files')
e... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/libraries/render_markdown_spec.rb | spec/bashly/libraries/render_markdown_spec.rb | describe 'libraries/render/markdown' do
subject do
RenderContext.new source: source, target: target, show: show
end
let(:source) { 'lib/bashly/libraries/render/markdown' }
let(:target) { 'spec/tmp' }
let(:show) { nil }
let(:config) { Bashly::Config.new "lib/bashly/templates/#{config_name}.yml" }
let(... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/libraries/base_spec.rb | spec/bashly/libraries/base_spec.rb | describe Libraries::Base do
describe '#files' do
it 'raises a NotImplementedError' do
expect { subject.files }.to raise_error(NotImplementedError)
end
end
describe '#post_install_message' do
it 'returns nil' do
expect(subject.post_install_message).to be_nil
end
end
end
| ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/libraries/completions_function_spec.rb | spec/bashly/libraries/completions_function_spec.rb | describe Libraries::CompletionsFunction do
subject { described_class.new(*args) }
let(:args) { nil }
before { reset_tmp_dir example: 'minimal' }
describe '#files' do
it 'returns an array with a single hash' do
expect(subject.files.to_yaml).to match_approval('libraries/completions_function/files')
... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/bashly/refinements/compose_refinements_spec.rb | spec/bashly/refinements/compose_refinements_spec.rb | describe ComposeRefinements do
using described_class
subject do
{
'array' => [string, array, hash],
'args' => imported_array,
}
end
let(:string) { 'hello' }
let(:array) { [string, hash] }
let(:hash) { { 'key' => 'value', 'import' => fixture } }
let(:imported_array) { { 'import' => '... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/spec/fixtures/render/source/render.rb | spec/fixtures/render/source/render.rb | puts 'render script executed'
| ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly.rb | lib/bashly.rb | if ENV['DEBUGGER']
require 'debug'
require 'lp'
end
require 'requires'
requires 'bashly/extensions'
requires 'bashly/exceptions'
module Bashly
autoloads 'bashly/refinements', %i[ComposeRefinements]
autoloads 'bashly', %i[
CLI Config ConfigValidator Library LibrarySource LibrarySourceConfig
MessageStr... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/library.rb | lib/bashly/library.rb | module Bashly
class Library
attr_reader :path, :config, :upgrade_string
attr_accessor :args
def initialize(path, config, upgrade_string: nil)
@path = path.to_s
@config = config
@upgrade_string = upgrade_string
end
def files
if custom_handler
custom_handler.files
... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/version.rb | lib/bashly/version.rb | module Bashly
VERSION = '1.3.5'
end
| ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/exceptions.rb | lib/bashly/exceptions.rb | module Bashly
class Interrupt < Interrupt; end
class Error < StandardError; end
class InitError < Error; end
class ConfigurationError < Error; end
end
| ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/config_validator.rb | lib/bashly/config_validator.rb | module Bashly
class ConfigValidator
include ValidationHelpers
attr_reader :data
def initialize(data)
@data = data
end
def validate
assert_command 'root', data
end
private
def assert_version(key, value)
return unless value
assert [String, Integer, Float].incl... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/render_source.rb | lib/bashly/render_source.rb | module Bashly
class RenderSource
attr_reader :selector
class << self
include AssetHelper
def internal
@internal ||= internal_dirs.to_h do |dir|
selector = File.basename(dir).to_sym
[selector, new(selector)]
end
end
def internal_dirs
@inter... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/settings.rb | lib/bashly/settings.rb | module Bashly
class Settings
class << self
include AssetHelper
attr_writer(
:commands_dir,
:compact_short_flags,
:conjoined_flag_args,
:config_path,
:enable_bash3_bouncer,
:enable_deps_array,
:enable_env_var_names_array,
:enable_header_c... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/library_source.rb | lib/bashly/library_source.rb | require 'fileutils'
require 'tmpdir'
module Bashly
class LibrarySource
attr_reader :uri
def initialize(uri = nil)
@uri = uri || File.expand_path('libraries', __dir__)
transform_github_uri if /^github(:|-)/.match? @uri
end
def git?
/^(git|github|github-ssh):/.match? uri
end
... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/cli.rb | lib/bashly/cli.rb | require 'mister_bin'
module Bashly
# The CLI class is used by the bashly binary and forwards incoming CLI
# commands to the relevant Bashly::Commands class
class CLI
def self.runner
runner = MisterBin::Runner.new version: Bashly::VERSION,
header: 'Bashly - Bash CLI Generator',
footer: "... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/library_source_config.rb | lib/bashly/library_source_config.rb | module Bashly
class LibrarySourceConfig
include ValidationHelpers
attr_reader :path
def initialize(path)
@path = path
end
def data
@data ||= YAML.load_file path
end
def validated_data
validate
data
end
def validate
assert_root path, data
end
... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/config.rb | lib/bashly/config.rb | module Bashly
# A convenience class to use either a hash or a filename as a configuration
# source.
#
# When a filename is provided, it is loaded with these extra features:
# - Support for `import` keyword to merge additional YAML files
# - Preprocessing with ERB
class Config
using ComposeRefinements
... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/message_strings.rb | lib/bashly/message_strings.rb | module Bashly
class MessageStrings
include AssetHelper
def [](key)
values[key.to_s]
end
def values
@values ||= values!
end
private
def values!
defaults = YAML.load_file asset('libraries/strings/strings.yml')
defaults.merge project_strings
end
def project_... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/render_context.rb | lib/bashly/render_context.rb | require 'date' # for use by template render scripts
require 'colsole'
module Bashly
class RenderContext
include Colsole
attr_reader :source, :target, :show
attr_writer :config
def initialize(source:, target:, show: nil)
@source = source
@target = target
@show = show
end
d... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/concerns/completions.rb | lib/bashly/concerns/completions.rb | require 'completely'
module Bashly
# This is a `Command` and `Flag` concern responsible for providing bash
# completion data
module Completions
module Flag
def completion_data(command_full_name)
comps = allowed || completions
return {} unless comps
aliases.to_h do |name|
... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/concerns/validation_helpers.rb | lib/bashly/concerns/validation_helpers.rb | module Bashly
# This is a `ConfigValidator` concern responsible for providing basic
# assertion methods.
module ValidationHelpers
protected
def assert(valid, message)
raise ConfigurationError, message unless valid
end
def refute(invalid, message)
assert !invalid, message
end
d... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/concerns/asset_helper.rb | lib/bashly/concerns/asset_helper.rb | module Bashly
module AssetHelper
def asset(path)
File.expand_path "../#{path}", __dir__
end
def asset_content(path)
File.read asset(path)
end
end
end
| ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/concerns/renderable.rb | lib/bashly/concerns/renderable.rb | require 'gtx'
module Bashly
module Renderable
attr_reader :render_options
def render(view, render_options = {})
@render_options = render_options
GTX.render_file view_path(view), context: binding, filename: "#{views_subfolder}.#{view}"
end
def strings
@strings ||= MessageStrings.ne... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/concerns/indentation_helper.rb | lib/bashly/concerns/indentation_helper.rb | module Bashly
# A helper class, used by the `Array#indent` extension.
# It will return the array of strings with all strings prefixed by `indentation`
# unless the line is within a heredoc block.
class IndentationHelper
attr_reader :marker, :indentation
def initialize(indentation)
@indentation = ... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/extensions/array.rb | lib/bashly/extensions/array.rb | require 'bashly/concerns/indentation_helper'
class Array
def indent(offset)
return self unless offset.positive?
indentation = ' ' * offset
indenter = Bashly::IndentationHelper.new indentation
map { |line| indenter.indent line }
end
def nonuniq
tally.select { |_key, count| count > 1 }.keys
... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/extensions/file.rb | lib/bashly/extensions/file.rb | require 'fileutils'
class File
def self.deep_write(file, content)
dir = File.dirname file
FileUtils.mkdir_p dir
File.write file, content
end
def self.append(path, content)
File.open(path, 'a') { |f| f << content }
end
end
| ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/extensions/yaml.rb | lib/bashly/extensions/yaml.rb | require 'erb'
require 'yaml'
module YAML
# We trust our loaded YAMLs
# This patch is due to https://bugs.ruby-lang.org/issues/17866
# StackOverflow: https://stackoverflow.com/questions/71191685/visit-psych-nodes-alias-unknown-alias-default-psychbadalias/71192990#71192990
class << self
alias load unsafe_loa... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/extensions/string.rb | lib/bashly/extensions/string.rb | class String
def sanitize_for_print
gsub("\n", '\\n').gsub('"', '\"').gsub('`', '\\\\`').gsub('%', '%%')
end
def for_markdown
gsub('<', '\\<').gsub('>', '\\>').nl2br
end
def for_manpage
gsub('<', '\\<').gsub('>', '\\>').gsub('`', '**').gsub(" \n", "\n\n")
end
def nl2br
gsub("\n", " \n... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/commands/add.rb | lib/bashly/commands/add.rb | module Bashly
module Commands
class Add < Base
help 'Add extra features and customization to your script'
usage 'bashly add [--source NAME] LIBRARY [ARGS...] [--force --quiet]'
usage 'bashly add [--source NAME] --list'
usage 'bashly add (-h|--help)'
option '-s --source NAME', <<~US... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/commands/generate.rb | lib/bashly/commands/generate.rb | require 'filewatcher'
module Bashly
module Commands
class Generate < Base
summary 'Generate the bash script and required files'
help "This command is also aliased as 'build'"
usage 'bashly generate [options]'
usage 'bashly generate (-h|--help)'
option '-f --force', 'Overwrite exis... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/commands/completions.rb | lib/bashly/commands/completions.rb | require 'completely'
module Bashly
module Commands
class Completions < Base
summary 'Install bash completions for bashly itself'
help 'Display the bash completions script or install it directly to your bash completions directory'
usage 'bashly completions [--install|--uninstall]'
usage '... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/commands/doc.rb | lib/bashly/commands/doc.rb | module Bashly
module Commands
class Doc < Base
summary 'Show bashly reference documentation'
usage 'bashly doc [SEARCH] [--index]'
usage 'bashly doc (-h|--help)'
option '-i --index', 'Show option keys only'
param 'SEARCH', 'Search for options that match this text'
example 'b... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/commands/preview.rb | lib/bashly/commands/preview.rb | module Bashly
module Commands
class Preview < Base
help 'Generate the bash script to STDOUT'
usage 'bashly preview'
usage 'bashly preview (-h|--help)'
def run
with_valid_config do
command = Script::Command.new config
script = Script::Wrapper.new command
... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/commands/render.rb | lib/bashly/commands/render.rb | require 'filewatcher'
require 'tty-markdown'
module Bashly
module Commands
class Render < Base
help 'Render the bashly data structure using custom templates'
usage 'bashly render SOURCE TARGET [--watch --show PATH]'
usage 'bashly render SOURCE --about'
usage 'bashly render --list'
... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/commands/base.rb | lib/bashly/commands/base.rb | require 'mister_bin'
require 'fileutils'
module Bashly
module Commands
class Base < MisterBin::Command
include AssetHelper
def config
@config ||= Config.new Settings.config_path
end
def config_validator
@config_validator ||= ConfigValidator.new config
end
de... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/commands/validate.rb | lib/bashly/commands/validate.rb | require 'lp'
module Bashly
module Commands
class Validate < Base
help 'Scan the configuration file for errors'
usage 'bashly validate [--verbose]'
usage 'bashly validate (-h|--help)'
option '-v --verbose', 'Show the bashly configuration file prior to validating. ' \
'This is use... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/commands/shell.rb | lib/bashly/commands/shell.rb | module Bashly
module Commands
class Shell < Base
summary 'Start an interactive bashly shell'
help 'Start an interactive shell where you can run bashly commands'
usage 'bashly shell'
usage 'bashly shell (-h|--help)'
def run
ENV['BASHLY_SHELL'] = '1'
terminal.start
... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/commands/init.rb | lib/bashly/commands/init.rb | module Bashly
module Commands
class Init < Base
summary 'Initialize a new workspace'
help 'Create the bashly source folder, and place a template configuration file in it'
usage 'bashly init [--minimal]'
usage 'bashly init (-h|--help)'
option '-m --minimal', 'Use a minimal configura... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/script/command.rb | lib/bashly/script/command.rb | module Bashly
module Script
class Command < Base
include Completions::Command
include Introspection::Arguments
include Introspection::Commands
include Introspection::Dependencies
include Introspection::EnvironmentVariables
include Introspection::Examples
include Introspec... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/script/flag.rb | lib/bashly/script/flag.rb | require 'shellwords'
module Bashly
module Script
class Flag < Base
include Completions::Flag
include Introspection::Visibility
include Introspection::Validate
class << self
def option_keys
@option_keys ||= %i[
allowed arg completions conflicts default help l... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/script/base.rb | lib/bashly/script/base.rb | module Bashly
module Script
class Base
include Renderable
attr_reader :options
class << self
def option_keys
@option_keys ||= []
end
end
def initialize(options)
raise Error, 'Invalid options provided' unless options.respond_to? :keys
@opt... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/script/variable.rb | lib/bashly/script/variable.rb | module Bashly
module Script
class Variable < Base
class << self
def option_keys
@option_keys ||= %i[name value]
end
end
end
end
end
| ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/script/formatter.rb | lib/bashly/script/formatter.rb | require 'open3'
require 'shellwords'
module Bashly
module Script
class Formatter
attr_reader :script, :mode
def initialize(script, mode: nil)
@script = script
@mode = mode&.to_s || 'internal'
end
def formatted_script
case mode
when 'internal' then script.... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/script/wrapper.rb | lib/bashly/script/wrapper.rb | module Bashly
module Script
class Wrapper
include Renderable
attr_reader :command, :function_name
def initialize(command, function_name = nil)
@command = command
@function_name = function_name
end
def code(tab_indent: false)
tab_indent ? base_code.expand_ta... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/script/argument.rb | lib/bashly/script/argument.rb | require 'shellwords'
module Bashly
module Script
class Argument < Base
include Introspection::Validate
class << self
def option_keys
@option_keys ||= %i[
allowed default help name repeatable required unique validate
]
end
end
def default_s... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/script/catch_all.rb | lib/bashly/script/catch_all.rb | module Bashly
module Script
class CatchAll
class << self
def option_keys
@option_keys ||= %i[label help required catch_help]
end
def from_config(config)
options = case config
when nil
{ enabled: false }
when String
{ la... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/script/dependency.rb | lib/bashly/script/dependency.rb | module Bashly
module Script
class Dependency < Base
attr_reader :label, :commands, :help
class << self
def option_keys
@option_keys ||= %i[command help]
end
def from_config(key, value)
options = case value
when nil
{ label: key, comma... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/script/environment_variable.rb | lib/bashly/script/environment_variable.rb | module Bashly
module Script
class EnvironmentVariable < Base
include Introspection::Visibility
include Introspection::Validate
class << self
def option_keys
@option_keys ||= %i[
allowed default help name private required validate
]
end
end
... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/script/introspection/variables.rb | lib/bashly/script/introspection/variables.rb | module Bashly
module Script
module Introspection
module Variables
# Returns an array of Variable objects
def variables
return [] unless options['variables']
options['variables'].map do |options|
Variable.new options
end
end
end
end... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/script/introspection/flags.rb | lib/bashly/script/introspection/flags.rb | module Bashly
module Script
module Introspection
module Flags
# Returns an array of all the default Flags
def default_flags
flags.select(&:default)
end
# Returns an array of Flags
def flags
return [] unless options['flags']
options['fla... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/script/introspection/visibility.rb | lib/bashly/script/introspection/visibility.rb | module Bashly
module Script
module Introspection
module Visibility
# Returns :public, :private, or :semi_private based on the `private`
# option of the host, in conjunction with `Settings.private_reveal_key`.
def visibility
if !options['private']
:public
... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/script/introspection/arguments.rb | lib/bashly/script/introspection/arguments.rb | module Bashly
module Script
module Introspection
module Arguments
# Returns an array of Arguments
def args
return [] unless options['args']
options['args'].map do |options|
Argument.new options
end
end
# Returns an array of all the ... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/script/introspection/environment_variables.rb | lib/bashly/script/introspection/environment_variables.rb | module Bashly
module Script
module Introspection
module EnvironmentVariables
# Returns an array of all the Environment Variables with default values
def default_environment_variables
environment_variables.select(&:default)
end
# Returns an array of EnvironmentVaria... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/script/introspection/validate.rb | lib/bashly/script/introspection/validate.rb | module Bashly
module Script
module Introspection
module Validate
# Returns an array of validations
def validate
return [] unless options['validate']
result = options['validate']
result.is_a?(Array) ? result : [result]
end
# Returns true if ther... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/script/introspection/commands.rb | lib/bashly/script/introspection/commands.rb | module Bashly
module Script
module Introspection
module Commands
# Returns true if the command or any of its descendants has `catch_all`
def catch_all_used_anywhere?
deep_commands(include_self: true).any? { |x| x.catch_all.enabled? }
end
# Returns a full list of th... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/script/introspection/examples.rb | lib/bashly/script/introspection/examples.rb | module Bashly
module Script
module Introspection
module Examples
# Returns an array of examples
def examples
return nil unless options['examples']
options['examples'].is_a?(Array) ? options['examples'] : [options['examples']]
end
end
end
end
end
| ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/script/introspection/dependencies.rb | lib/bashly/script/introspection/dependencies.rb | module Bashly
module Script
module Introspection
module Dependencies
# Returns an array of Dependency objects
def dependencies
return [] unless options['dependencies']
@dependencies ||= options['dependencies'].map do |key, value|
Dependency.from_config key, v... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/libraries/base.rb | lib/bashly/libraries/base.rb | module Bashly
module Libraries
class Base
attr_reader :args
def initialize(*args)
@args = args
end
def files
raise NotImplementedError, 'Please implement #files'
end
def post_install_message
nil
end
protected
def command
@com... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/libraries/help/help.rb | lib/bashly/libraries/help/help.rb | module Bashly
module Libraries
class Help < Base
include AssetHelper
def files
[
{
path: "#{Settings.source_dir}/help_command.#{Settings.partials_extension}",
content: help_command,
},
]
end
def post_install_message
<... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/libraries/completions/completions_script.rb | lib/bashly/libraries/completions/completions_script.rb | module Bashly
module Libraries
class CompletionsScript < Base
def files
[
{
path: target_path,
content: command.completion_script,
},
]
end
def post_install_message
<<~MESSAGE
In order to enable completions, run:
... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/libraries/completions/completions_function.rb | lib/bashly/libraries/completions/completions_function.rb | module Bashly
module Libraries
class CompletionsFunction < Base
def files
[
{
path: "#{Settings.full_lib_dir}/#{function_name}.#{Settings.partials_extension}",
content: completions_function_code(function_name),
},
]
end
def post_ins... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/libraries/completions/completions_yaml.rb | lib/bashly/libraries/completions/completions_yaml.rb | module Bashly
module Libraries
class CompletionsYAML < Base
def files
[
{
path: target_path,
content: command.completion_data.to_yaml,
},
]
end
def post_install_message
<<~MESSAGE
This file can be converted to a co... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/libraries/render/mandoc/render.rb | lib/bashly/libraries/render/mandoc/render.rb | # render script - mandoc
require 'gtx'
# Load the GTX template
template = "#{source}/mandoc.gtx"
gtx = GTX.load_file template
# Define a reusable code block for rendering a man page for a command
save_manpage = lambda { |command|
mdfile = "#{target}/#{command.full_name.tr(' ', '-')}.md"
manfile = "#{target}/#{com... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
bashly-framework/bashly | https://github.com/bashly-framework/bashly/blob/343e63e493a08b9d04e9b7a23912762a0270f8a8/lib/bashly/libraries/render/markdown_github/render.rb | lib/bashly/libraries/render/markdown_github/render.rb | # render script - markdown
require 'gtx'
# for previewing only (not needed for rendering)
require 'tty-markdown'
# Load the GTX template
template = "#{source}/markdown.gtx"
gtx = GTX.load_file template
# Render the file for the main command
save "#{target}/README.md", gtx.parse(command)
# Render a file for each sub... | ruby | MIT | 343e63e493a08b9d04e9b7a23912762a0270f8a8 | 2026-01-04T15:56:08.200657Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.