Module: Setup::Store
- Included in:
- ExceptionsBase, Session::ClearHistory, Session::PopulateHistory, ApplicationDictionary, Dictionary::ActiveRecord
- Defined in:
- lib/pry-byetypo/setup/store.rb
Constant Summary collapse
- DEFAULT_STORE_PATH =
"byetypo_dictionary.pstore"
- SEVEN_DAYS =
604800
Instance Method Summary collapse
-
#staled_store? ⇒ Boolean
By default we update the store every week.
- #store ⇒ Object
- #store_path ⇒ Object
Instance Method Details
#staled_store? ⇒ Boolean
By default we update the store every week. TODO: Make it configurable
16 17 18 19 20 |
# File 'lib/pry-byetypo/setup/store.rb', line 16 def staled_store? return true if store["synced_at"].nil? (store["synced_at"] + SEVEN_DAYS) <= Time.now end |
#store ⇒ Object
6 7 8 |
# File 'lib/pry-byetypo/setup/store.rb', line 6 def store @store ||= PStore.new(store_path) end |
#store_path ⇒ Object
10 11 12 |
# File 'lib/pry-byetypo/setup/store.rb', line 10 def store_path ENV["BYETYPO_STORE_PATH"] || DEFAULT_STORE_PATH end |