Class: CucumberStatistics::Configuration
- Inherits:
-
Object
- Object
- CucumberStatistics::Configuration
- Defined in:
- lib/cucumber_statistics/configuration.rb
Class Method Summary collapse
- .clean_tmp_dir ⇒ Object
- .resolve_path_from_root(relative_path) ⇒ Object
- .result_combined_statistics ⇒ Object
- .tmp_dir ⇒ Object
- .tmp_file(filename) ⇒ Object
Class Method Details
.clean_tmp_dir ⇒ Object
10 11 12 |
# File 'lib/cucumber_statistics/configuration.rb', line 10 def clean_tmp_dir FileUtils.rm_r tmp_dir end |
.resolve_path_from_root(relative_path) ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'lib/cucumber_statistics/configuration.rb', line 29 def resolve_path_from_root(relative_path) if defined?(Rails) Rails.root.join(relative_path) elsif defined?(Rake.original_dir) File.(relative_path, Rake.original_dir) else File.(relative_path, Dir.pwd) end end |
.result_combined_statistics ⇒ Object
25 26 27 |
# File 'lib/cucumber_statistics/configuration.rb', line 25 def result_combined_statistics tmp_file('combined_statistics.html') end |
.tmp_dir ⇒ Object
14 15 16 17 18 19 |
# File 'lib/cucumber_statistics/configuration.rb', line 14 def tmp_dir dir = resolve_path_from_root $tmp_path FileUtils.mkdir_p dir unless File.exists? dir dir end |
.tmp_file(filename) ⇒ Object
21 22 23 |
# File 'lib/cucumber_statistics/configuration.rb', line 21 def tmp_file(filename) "#{tmp_dir}/#{filename}" end |