Class: Tempo::Controllers::Records
- Inherits:
-
Base
- Object
- Base
- Tempo::Controllers::Records
show all
- Defined in:
- lib/tempo/controllers/records_controller.rb
Class Method Summary
collapse
Methods inherited from Base
filter_projects_by_title, fuzzy_match, reassemble_the
Class Method Details
.backup_records(options, args) ⇒ Object
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/tempo/controllers/records_controller.rb', line 19
def backup_records(options, args)
dir = options.fetch( :directory, ENV['HOME'])
Views::interactive_progress "\nBacking up #{dir}/tempo"
if File.exist?(File.join(dir, 'tempo'))
dest = FileRecord::Directory.backup directory: dir
Views::interactive_progress "Sucessfully created #{dest}"
else
Views::no_items("directory #{dir}/tempo", :error)
end
end
|
.clean_records(options, args) ⇒ Object
.initialize_from_records(options, args) ⇒ Object
8
9
10
11
12
13
14
15
16
17
|
# File 'lib/tempo/controllers/records_controller.rb', line 8
def initialize_from_records(options, args)
dir = options.fetch( :directory, ENV['HOME'])
if File.exist?(File.join(dir, 'tempo'))
Tempo::Controllers::Projects.load directory: dir
else
FileRecord::Directory.create_new directory: dir
end
end
|
.move_old_records(options) ⇒ Object
.old_records_present?(options) ⇒ Boolean
31
32
33
34
|
# File 'lib/tempo/controllers/records_controller.rb', line 31
def old_records_present?(options)
file_utility = FileRecord::FileUtility.new(Tempo::Model::TimeRecord, options)
file_utility.old_style_log_records_exists?
end
|