Class: GemSorter::TaskConfig
- Inherits:
-
Object
- Object
- GemSorter::TaskConfig
- Defined in:
- lib/task_config.rb
Constant Summary collapse
- DEFAULT_CONFIG =
{ 'backup' => false, 'update_comments' => false, 'update_versions' => false, 'use_double_quotes' => false, 'remove_versions' => false, 'force_update' => false, 'gemfile_path' => 'Gemfile', 'ignore_gems' => [], 'ignore_gem_versions' => [], 'ignore_gem_comments' => [] }.freeze
Instance Attribute Summary collapse
-
#backup ⇒ Object
readonly
Returns the value of attribute backup.
-
#gemfile_path ⇒ Object
readonly
Returns the value of attribute gemfile_path.
-
#ignore_gems ⇒ Object
readonly
Returns the value of attribute ignore_gems.
-
#update_comments ⇒ Object
readonly
Returns the value of attribute update_comments.
-
#update_versions ⇒ Object
readonly
Returns the value of attribute update_versions.
Instance Method Summary collapse
- #force_update ⇒ Object
- #ignore_gem_comments ⇒ Object
- #ignore_gem_versions ⇒ Object
-
#initialize(args = nil) ⇒ TaskConfig
constructor
A new instance of TaskConfig.
- #remove_versions ⇒ Object
- #use_double_quotes ⇒ Object
Constructor Details
#initialize(args = nil) ⇒ TaskConfig
Returns a new instance of TaskConfig.
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/task_config.rb', line 20 def initialize(args = nil) @backup = nil @update_comments = nil @update_versions = nil @use_double_quotes = nil @remove_versions = nil @force_update = nil @ignore_gems = nil @ignore_gem_versions = nil @ignore_gem_comments = nil @gemfile_path = nil load_config(args) end |
Instance Attribute Details
#backup ⇒ Object (readonly)
Returns the value of attribute backup.
5 6 7 |
# File 'lib/task_config.rb', line 5 def backup @backup end |
#gemfile_path ⇒ Object (readonly)
Returns the value of attribute gemfile_path.
5 6 7 |
# File 'lib/task_config.rb', line 5 def gemfile_path @gemfile_path end |
#ignore_gems ⇒ Object (readonly)
Returns the value of attribute ignore_gems.
5 6 7 |
# File 'lib/task_config.rb', line 5 def ignore_gems @ignore_gems end |
#update_comments ⇒ Object (readonly)
Returns the value of attribute update_comments.
5 6 7 |
# File 'lib/task_config.rb', line 5 def update_comments @update_comments end |
#update_versions ⇒ Object (readonly)
Returns the value of attribute update_versions.
5 6 7 |
# File 'lib/task_config.rb', line 5 def update_versions @update_versions end |
Instance Method Details
#force_update ⇒ Object
54 55 56 |
# File 'lib/task_config.rb', line 54 def force_update @force_update.nil? ? DEFAULT_CONFIG['force_update'] : @force_update end |
#ignore_gem_comments ⇒ Object
66 67 68 |
# File 'lib/task_config.rb', line 66 def ignore_gem_comments @ignore_gem_comments.nil? ? DEFAULT_CONFIG['ignore_gem_comments'] : @ignore_gem_comments end |
#ignore_gem_versions ⇒ Object
62 63 64 |
# File 'lib/task_config.rb', line 62 def ignore_gem_versions @ignore_gem_versions.nil? ? DEFAULT_CONFIG['ignore_gem_versions'] : @ignore_gem_versions end |
#remove_versions ⇒ Object
50 51 52 |
# File 'lib/task_config.rb', line 50 def remove_versions @remove_versions.nil? ? DEFAULT_CONFIG['remove_versions'] : @remove_versions end |
#use_double_quotes ⇒ Object
46 47 48 |
# File 'lib/task_config.rb', line 46 def use_double_quotes @use_double_quotes.nil? ? DEFAULT_CONFIG['use_double_quotes'] : @use_double_quotes end |