Class: Watchful::Configuration
- Inherits:
-
Object
- Object
- Watchful::Configuration
- Defined in:
- lib/watchful/configuration.rb
Direct Known Subclasses
Constant Summary collapse
- @@active_configuration =
nil
Class Attribute Summary collapse
-
.actions ⇒ Object
readonly
Returns the value of attribute actions.
Class Method Summary collapse
- ._description ⇒ Object
- .action(args) ⇒ Object
- .action_for_file(path) ⇒ Object
- .active_configuration ⇒ Object
- .active_configuration=(x) ⇒ Object
- .description(s) ⇒ Object
Class Attribute Details
.actions ⇒ Object (readonly)
Returns the value of attribute actions.
19 20 21 |
# File 'lib/watchful/configuration.rb', line 19 def actions @actions end |
Class Method Details
._description ⇒ Object
21 |
# File 'lib/watchful/configuration.rb', line 21 def _description; @description; end |
.action(args) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/watchful/configuration.rb', line 25 def action(args) # set the description in case the user doesn’t @description ||= 'Custom Configuration' # set to active configuration @@active_configuration = self # todo: support block-style action definition @actions ||= [] a = Watchful::Action.new(args) @actions << a end |
.action_for_file(path) ⇒ Object
12 13 14 15 |
# File 'lib/watchful/configuration.rb', line 12 def self.action_for_file(path) @actions ||= [] @actions.find { |a| a.input_file?(path) && a.enabled?} end |
.active_configuration ⇒ Object
9 |
# File 'lib/watchful/configuration.rb', line 9 def self.active_configuration; @@active_configuration; end |
.active_configuration=(x) ⇒ Object
10 |
# File 'lib/watchful/configuration.rb', line 10 def self.active_configuration=(x); @@active_configuration = x; end |
.description(s) ⇒ Object
23 |
# File 'lib/watchful/configuration.rb', line 23 def description(s); @description = s; end |