Module: Bait::SimpleCovSupport
- Included in:
- Build
- Defined in:
- lib/bait/simplecov_support.rb
Instance Method Summary collapse
- #check_for_simplecov ⇒ Object
- #convert_paths ⇒ Object
- #coverage_dir ⇒ Object
- #simplecov_html_path ⇒ Object
Instance Method Details
#check_for_simplecov ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/bait/simplecov_support.rb', line 11 def check_for_simplecov if File.exists? simplecov_html_path self.simplecov = true convert_paths self.broadcast :simplecov, 'supported' self.save end end |
#convert_paths ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/bait/simplecov_support.rb', line 20 def convert_paths buffer = "" File.open(simplecov_html_path, "r") do |file| buffer = file.read.gsub("./assets", "/build/#{self.id}/coverage/assets") end File.open(simplecov_html_path, "w") do |file| file.write buffer end end |
#coverage_dir ⇒ Object
3 4 5 |
# File 'lib/bait/simplecov_support.rb', line 3 def coverage_dir File.join(clone_path, 'coverage') end |
#simplecov_html_path ⇒ Object
7 8 9 |
# File 'lib/bait/simplecov_support.rb', line 7 def simplecov_html_path File.join(coverage_dir, "index.html") end |