Class: Hastie::ReportUpdater
Class Method Summary
collapse
Instance Method Summary
collapse
#get_server_config, #read_config_file, source_root
Class Method Details
.banner ⇒ Object
8
9
10
|
# File 'lib/hastie/report_updater.rb', line 8
def self.banner
"hastie update <REPORT_DIR> <OPTIONS>"
end
|
Instance Method Details
#fetch_static_files ⇒ Object
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/hastie/report_updater.rb', line 29
def fetch_static_files
options[:server]["static"] ||= []
options[:server]["static"].each do |static_file|
static_path = File.join(options[:server_root], static_file)
if File.exists? static_path
say_status "copy", "#{static_path} to #{File.basename(destination_root)}"
FileUtils.cp_r static_path, self.destination_root
end
end
end
|
#read_report_file ⇒ Object
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/hastie/report_updater.rb', line 15
def read_report_file
self.destination_root = name
report_config_file = File.join(self.destination_root, Hastie.report_config_name)
if !File.exists? report_config_file
say "Cannot locate #{Hastie.report_config_name}."
say "Report directory does not contain report"
say "#{File.expand_path(self.destination_root)}"
exit(1)
end
local_config = ConfigFile.load(report_config_file, :local)
self.options = local_config.merge(self.options)
end
|