Module: Bashcov
- Extended by:
- BashInfo
- Defined in:
- lib/bashcov.rb,
lib/bashcov/line.rb,
lib/bashcov/lexer.rb,
lib/bashcov/errors.rb,
lib/bashcov/runner.rb,
lib/bashcov/xtrace.rb,
lib/bashcov/version.rb,
lib/bashcov/bash_info.rb,
lib/bashcov/field_stream.rb
Overview
:nodoc:
Defined Under Namespace
Modules: BashInfo, Line Classes: FieldStream, Lexer, Options, Runner, Xtrace, XtraceError
Constant Summary collapse
- BASH_VERSION =
Current Bash version (e.g. 4.2)
`#{bash_path} -c 'echo -n ${BASH_VERSINFO[0]}.${BASH_VERSINFO[1]}'`.freeze
- VERSION =
Current Bashcov version
"1.5.1".freeze
Class Method Summary collapse
-
.fullname ⇒ String
Program name including version for easy consistent output.
-
.options ⇒ Struct
The
Struct
object representing Bashcov configuration. -
.parse_options!(args) ⇒ void
Parses the given CLI arguments and sets
options
. -
.program_name ⇒ String
Program name.
-
.set_default_options! ⇒ Object
Wipe the current options and reset default values.
Methods included from BashInfo
bash_xtracefd?, truncated_ps4?
Class Method Details
.fullname ⇒ String
fullname
instead of name to avoid clashing with Module.name
Returns Program name including version for easy consistent output.
61 62 63 |
# File 'lib/bashcov.rb', line 61 def fullname "#{program_name} #{VERSION} (bash #{BASH_VERSION})" end |
.options ⇒ Struct
Returns The Struct
object representing Bashcov configuration.
31 32 33 34 |
# File 'lib/bashcov.rb', line 31 def unless defined?(@options) @options end |
.parse_options!(args) ⇒ void
This method returns an undefined value.
Parses the given CLI arguments and sets options
.
40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/bashcov.rb', line 40 def (args) begin option_parser.parse!(args) rescue OptionParser::ParseError, Errno::ENOENT => e abort "#{option_parser.program_name}: #{e.}" end if args.empty? abort("You must give exactly one command to execute.") else .command = args.unshift(bash_path) end end |
.program_name ⇒ String
Returns Program name.
55 56 57 |
# File 'lib/bashcov.rb', line 55 def program_name "bashcov" end |
.set_default_options! ⇒ Object
Wipe the current options and reset default values
66 67 68 69 70 71 72 73 |
# File 'lib/bashcov.rb', line 66 def @options = Options.new @options.skip_uncovered = false @options.mute = false @options.bash_path = "/bin/bash" @options.root_directory = Dir.getwd end |