Class: Deprewriter::Configuration
- Inherits:
-
Object
- Object
- Deprewriter::Configuration
- Defined in:
- lib/deprewriter/configuration.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#skip_redundant_rewrite ⇒ Object
Returns the value of attribute skip_redundant_rewrite.
Instance Method Summary collapse
- #enabled? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/deprewriter/configuration.rb', line 9 def initialize @mode = case ENV["DEPREWRITER"] when nil :disabled when "log" :log when "diff" :diff when "dangerously_rewrite" :rewrite else :log # default end @logger = Logger.new($stdout) @skip_redundant_rewrite = true # Test purpose end |
Instance Attribute Details
#logger ⇒ Object
Returns the value of attribute logger.
7 8 9 |
# File 'lib/deprewriter/configuration.rb', line 7 def logger @logger end |
#mode ⇒ Object
Returns the value of attribute mode.
7 8 9 |
# File 'lib/deprewriter/configuration.rb', line 7 def mode @mode end |
#skip_redundant_rewrite ⇒ Object
Returns the value of attribute skip_redundant_rewrite.
7 8 9 |
# File 'lib/deprewriter/configuration.rb', line 7 def skip_redundant_rewrite @skip_redundant_rewrite end |
Instance Method Details
#enabled? ⇒ Boolean
27 28 29 |
# File 'lib/deprewriter/configuration.rb', line 27 def enabled? @mode != :disabled end |