Skip to content

Commit 978caba

Browse files
author
Kevin Paulisse
committed
Add --bootstrap-current and --debug-bootstrap options
1 parent 68b4977 commit 978caba

4 files changed

Lines changed: 47 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Option to bootstrap the current directory (by default, the bootstrap script is NOT
2+
# run when the catalog builds in the current directory).
3+
# @param parser [OptionParser object] The OptionParser argument
4+
# @param options [Hash] Options hash being constructed; this is modified in this method.
5+
OctocatalogDiff::CatalogDiff::Cli::Options::Option.newoption(:bootstrap_current) do
6+
has_weight 48
7+
8+
def parse(parser, options)
9+
parser.on('--bootstrap-current', 'Run bootstrap script for the current directory too') do
10+
options[:bootstrap_current] = true
11+
end
12+
end
13+
end
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Option to print debugging output for the bootstrap script in addition to the normal
2+
# debugging output. Note that `--debug` must also be enabled for this option to have
3+
# any effect.
4+
# @param parser [OptionParser object] The OptionParser argument
5+
# @param options [Hash] Options hash being constructed; this is modified in this method.
6+
OctocatalogDiff::CatalogDiff::Cli::Options::Option.newoption(:debug_bootstrap) do
7+
has_weight 49
8+
9+
def parse(parser, options)
10+
parser.on('--debug-bootstrap', 'Print debugging output for bootstrap script') do
11+
options[:debug_bootstrap] = true
12+
end
13+
end
14+
end
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
require_relative '../options_helper'
2+
3+
describe OctocatalogDiff::CatalogDiff::Cli::Options do
4+
describe '#opt_bootstrap_current' do
5+
it 'should handle --bootstrap-current' do
6+
result = run_optparse(['--bootstrap-current'])
7+
expect(result[:bootstrap_current]).to eq(true)
8+
end
9+
end
10+
end
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
require_relative '../options_helper'
2+
3+
describe OctocatalogDiff::CatalogDiff::Cli::Options do
4+
describe '#opt_debug_bootstrap' do
5+
it 'should handle --debug-bootstrap' do
6+
result = run_optparse(['--debug-bootstrap'])
7+
expect(result[:debug_bootstrap]).to eq(true)
8+
end
9+
end
10+
end

0 commit comments

Comments
 (0)