Sha256: 87226e15b86314e51daa0d647674f4d2e0199717f20cf8135ea4e3a6cdf49f2b

Contents?: true

Size: 392 Bytes

Versions: 6

Compression:

Stored size: 392 Bytes

Contents

module Xing
  module Snapshot
    module Writer
      def write(path, html)
        snapshot_file = "#{ Rails.root }/public/frontend_snapshots/#{path.present? ? path : 'index'}.html"
        dirname = File.dirname(snapshot_file)
        FileUtils.mkdir_p(dirname)

        File.open(snapshot_file, "w+:ASCII-8BIT:UTF-8") do |f|
          f.write(html)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
xing-backend-1.0.0.pre.beta lib/xing/snapshot/writer.rb
xing-backend-0.0.25 lib/xing/snapshot/writer.rb
xing-backend-0.0.23 lib/xing/snapshot/writer.rb
xing-backend-0.0.22 lib/xing/snapshot/writer.rb
xing-backend-0.0.21 lib/xing/snapshot/writer.rb
xing-backend-0.0.20 lib/xing/snapshot/writer.rb