Module: MandatoryOptions
- Included in:
- OptParserInternal
- Defined in:
- lib/gitarro/opt_parser.rb
Overview
this are the mandatory options
Instance Method Summary collapse
-
#context_opt(opt) ⇒ Object
primary.
- #git_opt(opt) ⇒ Object
- #mandatory_options(opt) ⇒ Object
- #repo_opt(opt) ⇒ Object
- #test_opt(opt) ⇒ Object
Instance Method Details
#context_opt(opt) ⇒ Object
primary
6 7 8 9 10 11 |
# File 'lib/gitarro/opt_parser.rb', line 6 def context_opt(opt) desc = 'Context to set on comment (test name). For example: python-test.' opt.on('-c', "--context 'CONTEXT'", desc) do |context| [:context] = context end end |
#git_opt(opt) ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/gitarro/opt_parser.rb', line 25 def git_opt(opt) desc = 'Specify a location where gitarro will clone the GitHub project. '\ 'If the dir does not exists, gitarro will create one. '\ 'For example: /tmp/' opt.on('-g', "--git_dir 'GIT_LOCAL_DIR'", desc) do |git_dir| [:git_dir] = git_dir end end |
#mandatory_options(opt) ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/gitarro/opt_parser.rb', line 34 def (opt) opt.separator 'Mandatory options:' repo_opt(opt) context_opt(opt) test_opt(opt) git_opt(opt) end |
#repo_opt(opt) ⇒ Object
13 14 15 16 |
# File 'lib/gitarro/opt_parser.rb', line 13 def repo_opt(opt) desc = 'GitHub repository to look for PRs. For example: openSUSE/gitarro.' opt.on('-r', "--repo 'REPO'", desc) { |repo| [:repo] = repo } end |
#test_opt(opt) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/gitarro/opt_parser.rb', line 18 def test_opt(opt) desc = 'Command, or full path to script/binary to be used to run the test.' opt.on('-t', "--test 'TEST.SH'", desc) do |test_file| [:test_file] = test_file end end |