Sha256: 7a306aeb2a434e2197523c008e353457c0cd978c5250b9510fae90b83e8b22c6
Contents?: true
Size: 575 Bytes
Versions: 10
Compression:
Stored size: 575 Bytes
Contents
module Xing::Services module SnapshotWriter def write(path, html) if Rails.env.test? snapshot_file = "#{ Rails.root }/spec/fixtures/sitemap_scratch/#{path.present? ? path : 'index'}.html" else snapshot_file = "#{ Rails.root }/public/frontend_snapshots/#{path.present? ? path : 'index'}.html" end dirname = File.dirname(snapshot_file) unless File.directory?(dirname) FileUtils.mkdir_p(dirname) end File.open(snapshot_file, "w+:ASCII-8BIT:UTF-8") do |f| f.write(html) end end end end
Version data entries
10 entries across 10 versions & 1 rubygems