Class: XDry::Config

Inherits:
Struct
  • Object
show all
Defined in:
lib/xdry/run.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



41
42
43
44
45
46
47
48
# File 'lib/xdry/run.rb', line 41

def initialize
  self.only = nil
  self.dry_run = false
  self.watch = false
  self.verbose = false
  self.disable = []
  self.enable_only = nil
end

Instance Attribute Details

#disableObject

Returns the value of attribute disable

Returns:

  • (Object)

    the current value of disable



39
40
41
# File 'lib/xdry/run.rb', line 39

def disable
  @disable
end

#dry_runObject

Returns the value of attribute dry_run

Returns:

  • (Object)

    the current value of dry_run



39
40
41
# File 'lib/xdry/run.rb', line 39

def dry_run
  @dry_run
end

#enable_onlyObject

Returns the value of attribute enable_only

Returns:

  • (Object)

    the current value of enable_only



39
40
41
# File 'lib/xdry/run.rb', line 39

def enable_only
  @enable_only
end

#onlyObject

Returns the value of attribute only

Returns:

  • (Object)

    the current value of only



39
40
41
# File 'lib/xdry/run.rb', line 39

def only
  @only
end

#verboseObject

Returns the value of attribute verbose

Returns:

  • (Object)

    the current value of verbose



39
40
41
# File 'lib/xdry/run.rb', line 39

def verbose
  @verbose
end

#watchObject

Returns the value of attribute watch

Returns:

  • (Object)

    the current value of watch



39
40
41
# File 'lib/xdry/run.rb', line 39

def watch
  @watch
end

Instance Method Details

#enabled?(gen_id) ⇒ Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/xdry/run.rb', line 50

def enabled? gen_id
  (enable_only.nil? || enable_only.include?(gen_id)) && !disable.include?(gen_id)
end