Class: AfterMigrate::Configuration
- Inherits:
-
Object
- Object
- AfterMigrate::Configuration
- Defined in:
- lib/after_migrate.rb
Instance Attribute Summary collapse
-
#analyze ⇒ Object
Returns the value of attribute analyze.
-
#defer ⇒ Object
Returns the value of attribute defer.
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#rake_tasks_enhanced ⇒ Object
Returns the value of attribute rake_tasks_enhanced.
-
#run_id ⇒ Object
Returns the value of attribute run_id.
-
#store ⇒ Object
Returns the value of attribute store.
-
#store_options ⇒ Object
Returns the value of attribute store_options.
-
#vacuum ⇒ Object
Returns the value of attribute vacuum.
-
#verbose ⇒ Object
Returns the value of attribute verbose.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #redis ⇒ Object
- #redis=(value) ⇒ Object
- #redis_key_prefix ⇒ Object
- #redis_key_prefix=(value) ⇒ Object
- #redis_ttl ⇒ Object
- #redis_ttl=(value) ⇒ Object
- #store_options_for(store_name) ⇒ Object
- #store_path ⇒ Object
- #store_path=(value) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/after_migrate.rb', line 14 def initialize @enabled = true @verbose = true @vacuum = true @analyze = 'only_affected_tables' @rake_tasks_enhanced = true @defer = true @store = :memory @run_id = ENV.fetch('AFTER_MIGRATE_RUN_ID', 'default') @store_options = { file: { path: 'tmp/after_migrate/affected_tables.json' }, redis: { client: nil, key_prefix: 'after_migrate', ttl: 24 * 60 * 60 } } end |
Instance Attribute Details
#analyze ⇒ Object
Returns the value of attribute analyze.
11 12 13 |
# File 'lib/after_migrate.rb', line 11 def analyze @analyze end |
#defer ⇒ Object
Returns the value of attribute defer.
11 12 13 |
# File 'lib/after_migrate.rb', line 11 def defer @defer end |
#enabled ⇒ Object
Returns the value of attribute enabled.
11 12 13 |
# File 'lib/after_migrate.rb', line 11 def enabled @enabled end |
#rake_tasks_enhanced ⇒ Object
Returns the value of attribute rake_tasks_enhanced.
11 12 13 |
# File 'lib/after_migrate.rb', line 11 def rake_tasks_enhanced @rake_tasks_enhanced end |
#run_id ⇒ Object
Returns the value of attribute run_id.
11 12 13 |
# File 'lib/after_migrate.rb', line 11 def run_id @run_id end |
#store ⇒ Object
Returns the value of attribute store.
11 12 13 |
# File 'lib/after_migrate.rb', line 11 def store @store end |
#store_options ⇒ Object
Returns the value of attribute store_options.
11 12 13 |
# File 'lib/after_migrate.rb', line 11 def @store_options end |
#vacuum ⇒ Object
Returns the value of attribute vacuum.
11 12 13 |
# File 'lib/after_migrate.rb', line 11 def vacuum @vacuum end |
#verbose ⇒ Object
Returns the value of attribute verbose.
11 12 13 |
# File 'lib/after_migrate.rb', line 11 def verbose @verbose end |
Instance Method Details
#redis ⇒ Object
43 44 45 |
# File 'lib/after_migrate.rb', line 43 def redis (:redis)[:client] end |
#redis=(value) ⇒ Object
47 48 49 |
# File 'lib/after_migrate.rb', line 47 def redis=(value) (:redis)[:client] = value end |
#redis_key_prefix ⇒ Object
51 52 53 |
# File 'lib/after_migrate.rb', line 51 def redis_key_prefix (:redis)[:key_prefix] end |
#redis_key_prefix=(value) ⇒ Object
55 56 57 |
# File 'lib/after_migrate.rb', line 55 def redis_key_prefix=(value) (:redis)[:key_prefix] = value end |
#redis_ttl ⇒ Object
59 60 61 |
# File 'lib/after_migrate.rb', line 59 def redis_ttl (:redis)[:ttl] end |
#redis_ttl=(value) ⇒ Object
63 64 65 |
# File 'lib/after_migrate.rb', line 63 def redis_ttl=(value) (:redis)[:ttl] = value end |
#store_options_for(store_name) ⇒ Object
67 68 69 |
# File 'lib/after_migrate.rb', line 67 def (store_name) [store_name.to_sym] ||= {} end |
#store_path ⇒ Object
35 36 37 |
# File 'lib/after_migrate.rb', line 35 def store_path (:file)[:path] end |
#store_path=(value) ⇒ Object
39 40 41 |
# File 'lib/after_migrate.rb', line 39 def store_path=(value) (:file)[:path] = value end |