<commit_before>require 'jammit/command_line'
require 'jammit/s3_command_line'
require 'jammit/s3_uploader'

module Jammit
  def self.upload_to_s3!(options = {})
    S3Uploader.new(options).upload
  end
end

if defined?(Rails)
  module Jammit
    class JammitRailtie < Rails::Railtie
      initializer "set asset host and asset id" do
        config.after_initialize do
          s3_bucket = Jammit.configuration[:s3_bucket]
          if Jammit.package_assets and s3_bucket.present?
            ActionController::Base.asset_host = "http://#{Jammit.configuration[:s3_bucket]}.s3.amazonaws.com"
          end
        end
      end
    end
  end
end<commit_msg>Added CloudFront support<commit_after>require 'jammit/command_line'
require 'jammit/s3_command_line'
require 'jammit/s3_uploader'

module Jammit
  def self.upload_to_s3!(options = {})
    S3Uploader.new(options).upload
  end
end

if defined?(Rails)
  module Jammit
    class JammitRailtie < Rails::Railtie
      initializer "set asset host and asset id" do
        config.after_initialize do
          if Jammit.configuration[:use_cloudfront] && Jammit.configuration[:cloudfront_domain].present?
            asset_hostname = "http://#{Jammit.configuration[:cloudfront_domain]}" 
          else
            asset_hostname = "http://#{Jammit.configuration[:s3_bucket]}.s3.amazonaws.com"
          end

          if Jammit.package_assets and asset_hostname.present?
            ActionController::Base.asset_host = asset_hostname
          end
        end
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.0904359141184125, 'fraction_numerical': 0.009759271307742356, 'mean_word_length': 3.068783068783069, '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': '572239', 'n_tokens_mistral': 488, 'n_tokens_neox': 479, 'n_words': 96}