Class: PeaceOfMind::Base
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- PeaceOfMind::Base
- Defined in:
- lib/peace_of_mind/base.rb
Class Method Summary collapse
- .archive_filename(value = nil) ⇒ Object (also: archive_filename=)
- .create! ⇒ Object
- .has_peace_of_mind {|_self| ... } ⇒ Object
- .tmp_directory(value = nil) ⇒ Object (also: tmp_directory=)
Class Method Details
.archive_filename(value = nil) ⇒ Object Also known as: archive_filename=
36 37 38 |
# File 'lib/peace_of_mind/base.rb', line 36 def archive_filename(value = nil) rw_config(:archive_filename, value, 'peace_of_mind') end |
.create! ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/peace_of_mind/base.rb', line 8 def create! = Time.now.strftime("%Y%m%d%H%M%S") remove_peace_of_mind_path! create_peace_of_mind_path! dump_database tar_peace_of_mind_path!() store_data!() super( :bucket => bucket, :filename => tar_filename(), :timestamp => , :size => File.size(File.join(peace_of_mind_path, tar_filename())) ) remove_peace_of_mind_path! end |
.has_peace_of_mind {|_self| ... } ⇒ Object
24 25 26 27 28 29 |
# File 'lib/peace_of_mind/base.rb', line 24 def has_peace_of_mind # Stop all configuration if the DB is not set up return if !db_setup? yield self if block_given? end |
.tmp_directory(value = nil) ⇒ Object Also known as: tmp_directory=
31 32 33 |
# File 'lib/peace_of_mind/base.rb', line 31 def tmp_directory(value = nil) rw_config(:tmp_directory, value, File.join(RAILS_ROOT, "tmp")) end |