Sha256: 2b52b96412b0b2213d7698303a51118a90bcc9c9d423e63527b9771a37a0a332

Contents?: true

Size: 617 Bytes

Versions: 1

Compression:

Stored size: 617 Bytes

Contents

#encoding: utf-8
require 'peek_a_view/tools/checker'

module PeekAView
  module Tools
    class YSlow < Checker

      def check(uri)
        system "phantomjs '#{yslow_script}' -f plain '#{uri}'"
      end

      def report(uri)
        system "phantomjs '#{yslow_script}' -f junit '#{uri}' > '#{report_file(uri)}'"
      end

      private

      def yslow_script
        File.join(PeekAView::Engine.config.root, 'tools', 'yslow.js')
      end

      def report_dir
        File.join(Rails.root, 'reports', 'yslow')
      end

      def report_file(uri)
        report_path(uri, '.xml')
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
peek-a-view-0.0.3 lib/peek_a_view/tools/yslow.rb