<commit_before>require 'sprockets/rails/helper'

module Sprockets
  module NYNY
    class Builder
      def self.build_config config
        config.assets            = ActiveSupport::OrderedOptions.new
        config.assets._blocks    = []
        config.assets.paths      = ['app/assets/javascripts',
          'app/assets/stylesheets', 'app/assets/images']
        config.assets.prefix     = "/assets"
        config.assets.precompile = [/(?:\/|\\|\A)application\.(css|js)$/]
        config.assets.version    = ""
        config.assets.debug      = false
        config.assets.compile    = true
        config.assets.digest     = false
      end

      def self.build_environment app
        sprockets = Sprockets::Environment.new do |env|
          env.version = ::NYNY.env
          path        = ::NYNY.root.join "/tmp/cache/assets/#{::NYNY.env}"
          env.cache   = Sprockets::Cache::FileStore.new(path)
          env.logger  = Logger.new(STDOUT)
        end

        app.inheritable :assets, sprockets
      end

      def self.configure_scope config, app
        config.assets.paths.each do |path|
          app.assets.append_path path
        end

        app.scope_class.debug_assets  = config.assets.debug
        app.scope_class.digest_assets = config.assets.digest
        app.scope_class.assets_prefix = config.assets.prefix

        manifest_path = "#{::NYNY.root}/public#{config.assets.prefix}"

        if config.assets.compile
          app.scope_class.assets_environment = app.assets
          app.scope_class.assets_manifest = Sprockets::Manifest.new(app.assets, manifest_path)
        else
          app.scope_class.assets_manifest = Sprockets::Manifest.new(manifest_path)
        end
      end

      def self.add_hooks app
        app.before_run do |app|
          config = app.config

          unless config.assets.version.blank?
            app.assets.version += "-#{config.assets.version}"
          end
<commit_msg>Initial release works, YAY!<commit_after>require 'sprockets/rails/helper'

module Sprockets
  module NYNY
    class Builder
      def self.build_config config
        config.assets            = ActiveSupport::OrderedOptions.new
        config.assets._blocks    = []
        config.assets.paths      = ['app/assets/javascripts',
          'app/assets/stylesheets', 'app/assets/images']
        config.assets.prefix     = "/assets"
        config.assets.precompile = [/(?:\/|\\|\A)application\.(css|js)$/]
        config.assets.version    = ""
        config.assets.debug      = false
        config.assets.compile    = !::NYNY.env.production?
        config.assets.digest     = ::NYNY.env.production?
      end

      def self.build_environment app
        sprockets = Sprockets::Environment.new do |env|
          env.version = ::NYNY.env
          path        = ::NYNY.root.join "/tmp/cache/assets/#{::NYNY.env}"
          env.cache   = Sprockets::Cache::FileStore.new(path)
          env.logger  = Logger.new(STDOUT)
        end

        app.inheritable :assets, sprockets
      end

      def self.configure_scope config, app
        config.assets.paths.each do |path|
          app.assets.append_path path
        end

        app.scope_class.debug_assets  = config.assets.debug
        app.scope_class.digest_assets = config.assets.digest
        app.scope_class.assets_prefix = config.assets.prefix

        manifest_path = "#{::NYNY.root}/public#{config.assets.prefix}"

        if config.assets.compile
          app.scope_class.assets_environment = app.assets
          app.scope_class.assets_manifest = Sprockets::Manifest.new(app.assets, manifest_path)
        else
          app.use Rack::Static, :urls => ['/assets'], :root => 'public'
          app.scope_class.assets_manifest = Sprockets::Manifest.new(manifest_path)
        end
      end

      def self.add_hooks app
        app.before_run do |app|
          config = app.config

          unless config.assets.version.blank?
            app.assets.version += "-#{config.assets.version}"
          end

{'fraction_non_alphanumeric': 0.11329681274900398, 'fraction_numerical': 0.0, 'mean_word_length': 2.113953488372093, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5691408', 'n_tokens_mistral': 1193, 'n_tokens_neox': 1173, 'n_words': 197}