<commit_before>module Middleman::Features::AssetHost
  class << self
    def registered(app)
      app.compass_config do |config|
        if app.asset_host.is_a?(Proc)
          config.asset_host(&app.asset_host)
        end
      end

      app.register_asset_handler :asset_host do |path, prefix|
        original_output = self.before_asset_handler(:asset_host, path, prefix)

        valid_extensions = %w(.png .gif .jpg .jpeg .js .css)

        asset_prefix = self.asset_host.call(original_output)

        File.join(asset_prefix, original_output)
      end
    end
    alias :included :registered
  end
end<commit_msg>fix basic asset host<commit_after>module Middleman::Features::AssetHost
  class << self
    def registered(app)
      app.set :asset_host, nil
      
      app.compass_config do |config|
        if self.asset_host.is_a?(Proc)
          config.asset_host(&self.asset_host)
        end
      end
      
      app.send :include, InstanceMethods
    end
    alias :included :registered
  end
  
  module InstanceMethods
    def asset_url(path, prefix="")
      original_output = super

      valid_extensions = %w(.png .gif .jpg .jpeg .js .css)

      asset_prefix = if self.asset_host.is_a?(Proc)
        self.asset_host.call(original_output)
      elsif self.asset_host.is_a?(String)
        self.asset_host
      end

      File.join(asset_prefix, original_output)
    end
  end
end
{'fraction_non_alphanumeric': 0.08974358974358974, 'fraction_numerical': 0.0, 'mean_word_length': 2.5841836734693877, 'pattern_counts': {'":': 0, '<': 7, '<?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': '349215', 'n_tokens_mistral': 445, 'n_tokens_neox': 435, 'n_words': 95}