<commit_before>require "pathname"
require "sprockets"

Cuba.settings[:assets_dir] = "assets/"

Cuba.settings[:js_compressor]  = :uglify
Cuba.settings[:css_compressor] = :scss
module Cuba::Assets
  def asset(path)
    environment[path]
  end

  def assets_dir=(path)
    @assets_dir = path
  end

  private
  def environment
    @environment ||= get_environment
  end

  def get_environment
    environment = Sprockets::Environment.new
    environment.append_path "#{assets_dir}/javascripts"
    environment.append_path "#{assets_dir}/styles"
    environment.append_path "#{assets_dir}/fonts"
    environment.append_path "#{assets_dir}/images"

    environment.js_compressor  = Cuba.settings[:js_compressor]
    environment.css_compressor = Cuba.settings[:css_compressor]

    environment
  end

  def assets_dir
    @assets_dir ||= Pathname(Cuba.settings[:assets_dir]).expand_path.to_s
  end
end<commit_msg>Isolated assets configs<commit_after>require "pathname"
require "sprockets"

Cuba.settings[:assets] = {}

Cuba.settings[:assets][:assets_dir] = "assets/"

Cuba.settings[:assets][:js_compressor]  = :uglify
Cuba.settings[:assets][:css_compressor] = :scss
module Cuba::Assets
  def asset(path)
    environment[path]
  end

  def assets_dir=(path)
    @assets_dir = path
  end

  private
  def environment
    @environment ||= get_environment
  end

  def get_environment
    environment = Sprockets::Environment.new
    environment.append_path "#{assets_dir}/javascripts"
    environment.append_path "#{assets_dir}/styles"
    environment.append_path "#{assets_dir}/fonts"
    environment.append_path "#{assets_dir}/images"

    environment.js_compressor  = Cuba.settings[:assets][:js_compressor]
    environment.css_compressor = Cuba.settings[:assets][:css_compressor]

    environment
  end

  def assets_dir
    @assets_dir ||= Pathname(Cuba.settings[:assets][:assets_dir]).expand_path.to_s
  end
end
{'fraction_non_alphanumeric': 0.11588883062401678, 'fraction_numerical': 0.0, 'mean_word_length': 4.852760736196319, 'pattern_counts': {'":': 0, '<': 3, '<?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': '306009', 'n_tokens_mistral': 629, 'n_tokens_neox': 613, 'n_words': 104}