<commit_before>require 'rake_tasks_for_rails/config'
require 'rake_tasks_for_rails/assets'

namespace :app do

  namespace :push do

    desc "Push to Heroku staging app"
    task :staging  => :environment do
      Rake::Task['app:push:implementation'].invoke(RakeTasksForRails::Config.staging_app_name,
        RakeTasksForRails::Config.staging_remote)
    end

    desc "Push to Production staging app"
    task :production  => :environment do
      Rake::Task['app:push:implementation'].invoke(RakeTasksForRails::Config.production_app_name,
        RakeTasksForRails::Config.production_remote)
    end

    task :implementation, [:app_name, :remote]  => :environment do |t, args|
      puts "Checking for changes in `app/assets` ..."
      if RakeTasksForRails::Assets.assets_changed?(args[:app_name], args[:remote])
        puts "Changes detected. Precompiling assets"
        Rake::Task['rake:assets:precompile'].invoke
        puts "Comitting changes to 'public/assets/manifest'"
        `git add public/assets/manifest*.*`
        `git commit -m "Add updated asset manifest"`
      end
      puts "Pushing changes ..."
      `git push #{args[:remote]} master`
      puts "Running Migrations ..."
      'heroku run rake db:migrate -a #{:app_name}'
      puts "Done"
    end

  end

  desc "Default to 'app:push:staging'"
  task :push => "app:push:staging"

end<commit_msg>Fix issue with asset precompilation<commit_after>require 'rake_tasks_for_rails/config'
require 'rake_tasks_for_rails/assets'

namespace :app do

  namespace :push do

    desc "Push to Heroku staging app"
    task :staging  => :environment do
      Rake::Task['app:push:implementation'].invoke(RakeTasksForRails::Config.staging_app_name,
        RakeTasksForRails::Config.staging_remote, RakeTasksForRails::Config::STAGING_ENVIRONMENT)
    end

    desc "Push to Production staging app"
    task :production  => :environment do
      Rake::Task['shared:confirm'].invoke("Push application to production", RakeTasksForRails::Config.production_app_name)
      Rake::Task['app:push:implementation'].invoke(RakeTasksForRails::Config.production_app_name,
        RakeTasksForRails::Config.production_remote, RakeTasksForRails::Config::PRODUCTION_ENVIRONMENT)
    end

    task :implementation, [:app_name, :remote, :environment]  => :environment do |t, args|
      puts "Checking for changes in `app/assets` ..."
      if RakeTasksForRails::Assets.assets_changed?(args[:app_name], args[:remote])
        puts "Changes detected. Precompiling assets"
        # Set the appropriate environment before precompilation
        `RAILS_ENV=#{args[:environment]} rake assets:precompile`
        puts "Comitting changes to 'public/assets/manifest'"
        `git add public/assets/manifest*.*`
        `git commit -m "Add updated asset manifest"`
      end
      puts "Pushing changes ..."
      `git push #{args[:remote]} master`
      puts "Running Migrations ..."
      'heroku run rake db:migrate -a #{:app_name}'
      puts "Done"
    end

  end

  desc "Default to 'app:push:staging'"
  task :push => "app:push:staging"

end
{'fraction_non_alphanumeric': 0.11582012293756067, 'fraction_numerical': 0.0, 'mean_word_length': 3.793798449612403, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '5614881', 'n_tokens_mistral': 962, 'n_tokens_neox': 938, 'n_words': 225}