Class: DuckTest::FrameWork::WatchConfig

Inherits:
Object
  • Object
show all
Includes:
ConfigHelper
Defined in:
lib/duck_test/frame_work/watch_config.rb

Overview

A WatchConfig represents a single watch definition including attributes such as pattern, filter sets, mappings, etc.

DuckTest.config do

  runnable "**/*"    # this would represent a WatchConfig object.

end

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods included from ConfigHelper

#autorun_status, #root, #root=, #runnable_basedir, #runnable_basedir=, #watch_basedir, #watch_basedir=

Constructor Details

- (WatchConfig) initialize(options = {})

Initialize a new WatchConfig

Parameters:

  • options (Hash) (defaults to: {})

    An options Hash containing values used to initialize the object.

Options Hash (options):



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/duck_test/frame_work/watch_config.rb', line 44

def initialize(options = {})
  super()

  self.autorun = options[:autorun]
  self.autorun = false if self.autorun.nil?

  self.watch_basedir = options[:watch_basedir]

  self.filter_set = options[:filter_set] unless options[:filter_set].blank?
  self.filter_set = FilterSet.new(options) if self.filter_set.blank?

  self.maps = options[:maps] unless options[:maps].blank?
  self.maps = [] if self.maps.blank?

  self.pattern = options[:pattern]
  self.runnable = options[:runnable]
  self.runnable = false if self.runnable.nil?

  self.runnable_basedir = options[:runnable_basedir]

  return self
end

Instance Attribute Details

- (Object) autorun Also known as: autorun?



16
17
18
# File 'lib/duck_test/frame_work/watch_config.rb', line 16

def autorun
  @autorun
end

- (Object) filter_set



19
20
21
# File 'lib/duck_test/frame_work/watch_config.rb', line 19

def filter_set
  @filter_set
end

- (Object) maps



22
23
24
# File 'lib/duck_test/frame_work/watch_config.rb', line 22

def maps
  @maps
end

- (Object) pattern



25
26
27
# File 'lib/duck_test/frame_work/watch_config.rb', line 25

def pattern
  @pattern
end

- (Object) runnable Also known as: runnable?



28
29
30
# File 'lib/duck_test/frame_work/watch_config.rb', line 28

def runnable
  @runnable
end