<commit_before>require 'rubygems/command_manager'
  
Gem::CommandManager.instance.register_command :torture

class Gem::Commands::TortureCommand < Gem::Command
  def initialize
    super 'torture', "Prepares a Rack application for deployment with IronRuby with the IIS Rack Handler"

    add_option('-p', '--public PATH', 'Path to your Rack app\'s public document root')
  end
  
  def execute
    explicit_path = get_one_optional_argument || './public'
    
    unless File.directory? explicit_path
      raise Gem::Exception, "supplied public path, or default ('public'), does not exist"
    end
    
    copy_ironruby_rack_template(explicit_path)
    puts follow_up_directions
  end
  
  private
  
    def copy_ironruby_rack_template(path)
      # TODO: Add ERB processing based on environment details inferred or specified
      template_files = Dir.glob(File.join(File.dirname(__FILE__), 'template') + '/*')
      FileUtils.cp_r template_files, path
    end
  
    def follow_up_directions
      <<-EOF
      ================================================================================
      |            Your app has been successfully tortured by IronMaiden!            |
      ================================================================================
      
      The Web.config file added into your application's public root is setup to work
      with Microsoft IIS 6 and 7. If you are using IIS 6 there are two additional
      steps you will need to take for deployment.
      
      First, in your application's deployment folder/site you need to open up the
      properties, go to the ASP.NET tab and make sure the version is set to 2.x or
      newer.
      
      Second, also in your application's deployment folder/site properties you need to
      add a wildcard handler. To do so ...
      
      
      - Thank you for using IronMaiden
      EOF
    end
end<commit_msg>Made follow_up_directions title line consistent with other uses of Iron Maiden name.<commit_after>require 'rubygems/command_manager'
  
Gem::CommandManager.instance.register_command :torture

class Gem::Commands::TortureCommand < Gem::Command
  def initialize
    super 'torture', "Prepares a Rack application for deployment with IronRuby with the IIS Rack Handler"

    add_option('-p', '--public PATH', 'Path to your Rack app\'s public document root')
  end
  
  def execute
    explicit_path = get_one_optional_argument || './public'
    
    unless File.directory? explicit_path
      raise Gem::Exception, "supplied public path, or default ('public'), does not exist"
    end
    
    copy_ironruby_rack_template(explicit_path)
    puts follow_up_directions
  end
  
  private
  
    def copy_ironruby_rack_template(path)
      # TODO: Add ERB processing based on environment details inferred or specified
      template_files = Dir.glob(File.join(File.dirname(__FILE__), 'template') + '/*')
      FileUtils.cp_r template_files, path
    end
  
    def follow_up_directions
      <<-EOF
      ================================================================================
      |           Your app has been successfully tortured by Iron Maiden!            |
      ================================================================================
      
      The Web.config file added into your application's public root is setup to work
      with Microsoft IIS 6 and 7. If you are using IIS 6 there are two additional
      steps you will need to take for deployment.
      
      First, in your application's deployment folder/site you need to open up the
      properties, go to the ASP.NET tab and make sure the version is set to 2.x or
      newer.
      
      Second, also in your application's deployment folder/site properties you need to
      add a wildcard handler. To do so ...
      
      
      - Thank you for using IronMaiden
      EOF
    end
end
{'fraction_non_alphanumeric': 0.13909677419354838, 'fraction_numerical': 0.002064516129032258, 'mean_word_length': 3.0586387434554974, 'pattern_counts': {'":': 0, '<': 9, '<?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': '4588625', 'n_tokens_mistral': 1040, 'n_tokens_neox': 973, 'n_words': 379}