Module: SnapCI::ParallelTests::Partition::CLIHelper

Extended by:
CLIHelper
Included in:
CLIHelper
Defined in:
lib/snap_ci/parallel_tests/partition/cli_helper.rb

Instance Method Summary collapse

Instance Method Details



26
27
28
# File 'lib/snap_ci/parallel_tests/partition/cli_helper.rb', line 26

def render_footer(optparser, options)
  optparser.separator ''
end

#render_header(optparser, options) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/snap_ci/parallel_tests/partition/cli_helper.rb', line 5

def render_header(optparser, options)
  optparser.banner = "Partition a list of files/directories and print them\n\nUsage: \#{optparser.program_name} [options] [files or directories]\n\nExample: \#{optparser.program_name} test/models test/controllers/foo_controller_test.rb\n\nCan typically be used as -\n\n  $ your-test-runner $(snap-ci-parallel-partition location/of/test/files)\n\n"
end

#render_options(optparser, options) ⇒ Object



20
21
22
23
24
# File 'lib/snap_ci/parallel_tests/partition/cli_helper.rb', line 20

def render_options(optparser, options)
  optparser.on('-p', '--pattern [PATTERN]', 'only find files matching this pattern') do |pattern|
    options[:pattern] = /#{pattern}/
  end
end