Class: Retest::Options
- Inherits:
-
Object
- Object
- Retest::Options
- Defined in:
- lib/retest/options.rb
Constant Summary collapse
- DEFAULT_PARAMS =
{ all: false, diff: nil, exts: %w[rb], help: false, notify: false, polling: false, rake: false, rails: false, rspec: false, ruby: false, version: false, watcher: nil, command: nil }.freeze
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Class Method Summary collapse
Instance Method Summary collapse
- #auto? ⇒ Boolean
- #command ⇒ Object
- #extensions ⇒ Object
- #force_polling? ⇒ Boolean
- #full_suite? ⇒ Boolean
- #help ⇒ Object
- #help? ⇒ Boolean
-
#initialize(args = []) ⇒ Options
constructor
A new instance of Options.
- #merge(options = []) ⇒ Object
- #notify? ⇒ Boolean
- #version? ⇒ Boolean
- #watcher ⇒ Object
Constructor Details
#initialize(args = []) ⇒ Options
Returns a new instance of Options.
27 28 29 |
# File 'lib/retest/options.rb', line 27 def initialize(args = []) self.args = args end |
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
21 22 23 |
# File 'lib/retest/options.rb', line 21 def args @args end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
21 22 23 |
# File 'lib/retest/options.rb', line 21 def params @params end |
Class Method Details
.command(args) ⇒ Object
23 24 25 |
# File 'lib/retest/options.rb', line 23 def self.command(args) new(args).command end |
Instance Method Details
#auto? ⇒ Boolean
45 46 47 |
# File 'lib/retest/options.rb', line 45 def auto? command.nil? end |
#command ⇒ Object
41 42 43 |
# File 'lib/retest/options.rb', line 41 def command params[:command] end |
#extensions ⇒ Object
69 70 71 |
# File 'lib/retest/options.rb', line 69 def extensions params[:exts] end |
#force_polling? ⇒ Boolean
65 66 67 |
# File 'lib/retest/options.rb', line 65 def force_polling? params[:polling] end |
#full_suite? ⇒ Boolean
57 58 59 |
# File 'lib/retest/options.rb', line 57 def full_suite? params[:all] end |
#help ⇒ Object
37 38 39 |
# File 'lib/retest/options.rb', line 37 def help parser.to_s end |
#help? ⇒ Boolean
49 50 51 |
# File 'lib/retest/options.rb', line 49 def help? params[:help] end |
#merge(options = []) ⇒ Object
77 78 79 |
# File 'lib/retest/options.rb', line 77 def merge( = []) self.class.new(@args.dup.concat()) end |
#notify? ⇒ Boolean
61 62 63 |
# File 'lib/retest/options.rb', line 61 def notify? params[:notify] end |
#version? ⇒ Boolean
53 54 55 |
# File 'lib/retest/options.rb', line 53 def version? params[:version] end |
#watcher ⇒ Object
73 74 75 |
# File 'lib/retest/options.rb', line 73 def watcher params[:watcher] || :installed end |