<commit_before>require 'sinatra'
require 'erubis'

module GuidesFrontEnd
  class Base < Sinatra::Base
    set :views, File.expand_path('../../../app/views/guides_front_end', __FILE__)
    set :public, File.expand_path('../../../public', __FILE__)
   
    helpers do
      def asset_host
        case ENV['RACK_ENV']
          when ('development' or 'test')
            ""
          when 'production'
            "alpha.gov.uk"
          else
            "#{ENV['RACK_ENV']}.alphagov.co.uk:8080"
        end
      end

      def base_path(guide_slug, part_slug)
        "/#{guide_slug}/#{part_slug}"
      end
      
      def guide_path(guide_slug, part_slug)
        base_path(guide_slug,part_slug)
      end
    end<commit_msg>Add http:// on start of asset_hosts to make the styling for guide previews load properly<commit_after>require 'sinatra'
require 'erubis'

module GuidesFrontEnd
  class Base < Sinatra::Base
    set :views, File.expand_path('../../../app/views/guides_front_end', __FILE__)
    set :public, File.expand_path('../../../public', __FILE__)
   
    helpers do
      def asset_host
        case ENV['RACK_ENV']
          when ('development' or 'test')
            ""
          when 'production'
            "http://alpha.gov.uk"
          else
            "http://#{ENV['RACK_ENV']}.alphagov.co.uk:8080"
        end
      end

      def base_path(guide_slug, part_slug)
        "/#{guide_slug}/#{part_slug}"
      end
      
      def guide_path(guide_slug, part_slug)
        base_path(guide_slug,part_slug)
      end
    end
{'fraction_non_alphanumeric': 0.129928894634777, 'fraction_numerical': 0.005171299288946348, 'mean_word_length': 2.089820359281437, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2947060', 'n_tokens_mistral': 511, 'n_tokens_neox': 512, 'n_words': 103}