<commit_before>require 'erb'
require 'pathname'

namespace :webflow do
  task :install do
    on roles :all do    
      envs = ENV['STAGES'] || 'staging,production'
    
      tasks_dir = Pathname.new('lib/capistrano/tasks')
      config_dir = Pathname.new('config')
      deploy_dir = config_dir.join('deploy')
    
      deploy_rb = File.expand_path("../../templates/deploy.rb.erb", __FILE__)
      stage_rb = File.expand_path("../../templates/stage.rb.erb", __FILE__)
      capfile = File.expand_path("../../templates/Capfile", __FILE__)

      execute "mkdir -p #{deploy_dir}"
    
      entries = [{template: deploy_rb, file: config_dir.join('deploy.rb')}]
      entries += envs.split(',').map { |stage| {template: stage_rb, file: deploy_dir.join("#{stage}.rb")} }

      ask(:htaccess_pass, nil)
    
      entries.each do |entry|
        if File.exists?(entry[:file])
          warn "[skip] #{entry[:file]} already exists"
        else
          File.open(entry[:file], 'w+') do |f|
            f.write(ERB.new(File.read(entry[:template])).result(binding))
            puts "create #{entry[:file]}"<commit_msg>+ webflow:install task description<commit_after>require 'erb'
require 'pathname'

namespace :webflow do
  desc "Install webflow flavoured capistrano files"
  task :install do
    on roles :all do    
      envs = ENV['STAGES'] || 'staging,production'
    
      tasks_dir = Pathname.new('lib/capistrano/tasks')
      config_dir = Pathname.new('config')
      deploy_dir = config_dir.join('deploy')
    
      deploy_rb = File.expand_path("../../templates/deploy.rb.erb", __FILE__)
      stage_rb = File.expand_path("../../templates/stage.rb.erb", __FILE__)
      capfile = File.expand_path("../../templates/Capfile", __FILE__)

      execute "mkdir -p #{deploy_dir}"
    
      entries = [{template: deploy_rb, file: config_dir.join('deploy.rb')}]
      entries += envs.split(',').map { |stage| {template: stage_rb, file: deploy_dir.join("#{stage}.rb")} }

      ask(:htaccess_pass, nil)
    
      entries.each do |entry|
        if File.exists?(entry[:file])
          warn "[skip] #{entry[:file]} already exists"
        else
          File.open(entry[:file], 'w+') do |f|
            f.write(ERB.new(File.read(entry[:template])).result(binding))
            puts "create #{entry[:file]}"
{'fraction_non_alphanumeric': 0.16803811173668254, 'fraction_numerical': 0.0, 'mean_word_length': 2.8758389261744965, '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': '119964', 'n_tokens_mistral': 751, 'n_tokens_neox': 744, 'n_words': 146}