Sha256: f909dd006ba798a79e86355b5abcc0c11ecca688d46a36f3ad9e174622ed19ce

Contents?: true

Size: 572 Bytes

Versions: 6

Compression:

Stored size: 572 Bytes

Contents

module Cucumber
  module HTMLFormatter
    class AssetsLoader
      def template
        read_asset('index.mustache.html')
      end

      def css
        read_asset('main.css')
      end

      def script
        read_asset('main.js')
      end

      private

      def read_asset(name)
        File.read(File.join(assets_path, name))
      end

      def assets_path
        "#{html_formatter_path}/assets"
      end

      def html_formatter_path
        Gem.loaded_specs['cucumber-html-formatter'].full_gem_path
      rescue
        '.'
      end

    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
honeybadger-5.4.0 vendor/bundle/ruby/3.2.0/gems/cucumber-html-formatter-20.4.0/lib/cucumber/html_formatter/assets_loader.rb
cucumber-html-formatter-21.0.0 lib/cucumber/html_formatter/assets_loader.rb
honeybadger-5.3.0 vendor/bundle/ruby/3.2.0/gems/cucumber-html-formatter-20.4.0/lib/cucumber/html_formatter/assets_loader.rb
cucumber-html-formatter-20.4.0 lib/cucumber/html_formatter/assets_loader.rb
cucumber-html-formatter-20.3.1 lib/cucumber/html_formatter/assets_loader.rb
cucumber-html-formatter-20.3.0 lib/cucumber/html_formatter/assets_loader.rb