<commit_before>module RubberRing
  module Build

    def Build.assets!
      # clear old assets and copy new ones
      build_assets_dir = "#{Rails.root.to_s}/public/build/assets"
      if File.directory?(build_assets_dir)
        FileUtils.rm_rf("#{build_assets_dir}/*")
      else
        FileUtils.mkdir_p(build_assets_dir)
      end

      # if running on production copy assets from precompiled files from public directory
      if Rails.env.production?
        FileUtils.cp_r("#{Rails.root.to_s}/public/assets/.", build_assets_dir)
      else
        %w(images javascripts stylesheets).each do |asset_dir|
          FileUtils.cp_r("#{Rails.root.to_s}/app/assets/#{asset_dir}/.", build_assets_dir)
        end
      end

      # copy attachments
      FileUtils.cp_r("#{Rails.root.to_s}/public/upload", "#{Rails.root.to_s}/public/build")
    end

  end
end
<commit_msg>copy all assets directories on build for development environment<commit_after>module RubberRing
  module Build

    def Build.assets!
      # clear old assets and copy new ones
      build_assets_dir = "#{Rails.root.to_s}/public/build/assets"
      if File.directory?(build_assets_dir)
        FileUtils.rm_rf("#{build_assets_dir}/*")
      else
        FileUtils.mkdir_p(build_assets_dir)
      end

      # if running on production copy assets from precompiled files from public directory
      if Rails.env.production?
        FileUtils.cp_r("#{Rails.root.to_s}/public/assets/.", build_assets_dir)
      else
        app_assets = "#{Rails.root.to_s}/app/assets"
        Dir.foreach(app_assets) do |asset_dir|
          FileUtils.cp_r("#{app_assets}/#{asset_dir}/.", build_assets_dir)
        end
      end

      # copy attachments
      FileUtils.cp_r("#{Rails.root.to_s}/public/upload", "#{Rails.root.to_s}/public/build")
    end

  end
end

{'fraction_non_alphanumeric': 0.11373626373626373, 'fraction_numerical': 0.0, 'mean_word_length': 2.858050847457627, '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': '4491420', 'n_tokens_mistral': 599, 'n_tokens_neox': 579, 'n_words': 116}