Class: DependencyTimelineAudit::Config
- Inherits:
-
Object
- Object
- DependencyTimelineAudit::Config
- Defined in:
- lib/dependency-timeline-audit/config.rb
Instance Attribute Summary collapse
-
#lockfile ⇒ Object
readonly
Returns the value of attribute lockfile.
-
#outdated_threshold ⇒ Object
readonly
Returns the value of attribute outdated_threshold.
-
#verbose ⇒ Object
readonly
Returns the value of attribute verbose.
Instance Method Summary collapse
-
#initialize(options) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(options) ⇒ Config
Returns a new instance of Config.
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/dependency-timeline-audit/config.rb', line 7 def initialize() @verbose = value_or_default([:verbose], false) @lockfile = value_or_default([:lockfile], 'Gemfile.lock') @outdated_threshold = value_or_default([:outdated_threshold], 3) # FIXME: There is probably a better way to handle the guard clauses and type casting if @outdated_threshold.to_i <= 0 raise InvalidOption, "Outdated Threshold must be an integer greater than 0" end # TODO: activesupport is kinda hefty for just grabbing X.years.ago, remove @outdated_threshold = @outdated_threshold.to_i.years.ago end |
Instance Attribute Details
#lockfile ⇒ Object (readonly)
Returns the value of attribute lockfile.
5 6 7 |
# File 'lib/dependency-timeline-audit/config.rb', line 5 def lockfile @lockfile end |
#outdated_threshold ⇒ Object (readonly)
Returns the value of attribute outdated_threshold.
5 6 7 |
# File 'lib/dependency-timeline-audit/config.rb', line 5 def outdated_threshold @outdated_threshold end |
#verbose ⇒ Object (readonly)
Returns the value of attribute verbose.
5 6 7 |
# File 'lib/dependency-timeline-audit/config.rb', line 5 def verbose @verbose end |