<commit_before><h1>Rails Overview</h1>

<pre>
Rails Version = <%= Rails::VERSION::STRING %>
Environment = <%= Rails.env %>
Root = <%= Rails.root %>
Timezone = <%= Rails.configuration.time_zone %>
Log Level = <%= Rails.configuration.log_level %>
</pre>

<ul class="nav nav-tabs" role="tablist">
  <li class="active"><a href="#config" role="tab" data-toggle="tab">Configuration</a></li>
  <li><a href="#application" role="tab" data-toggle="tab">Application</a></li>
  <li><a href="#initializers" role="tab" data-toggle="tab">Initializers</a></li>
  <li><a href="#middleware" role="tab" data-toggle="tab">Middleware</a></li>
  <li><a href="#railties" role="tab" data-toggle="tab">Railties</a></li>
  <li><a href="#engines" role="tab" data-toggle="tab">Engines</a></li>
  <li><a href="#generators" role="tab" data-toggle="tab">Generators</a></li>
  <li><a href="#timedate" role="tab" data-toggle="tab">Time and Date Formats</a></li>
</ul>

<div class="tab-content">
  <div class="tab-pane active" id="config">
    <p>
      Rails configuration is managed through the applications's config/application.rb, an environment-specific configuration file, and initializers from the config/initializers directory.
    </p>
    <p>
      The combined results of these configurations are shown here:
    </p>
    <table class="table table-condensed">
      <tr>
        <th>Setting</th>
        <th>Value</th>
        <th>Description</th>
      </tr>
      <tr>
        <td>config.asset_host</td>
        <td><%= Rails.configuration.asset_host %></td>
        <td>
           Sets the host for the assets. Useful when CDNs are used for hosting assets, or when you want to work around the concurrency constraints built-in in browsers using different domain aliases. Shorter version of config.action_controller.asset_host.
        </td>
      </tr>
      <tr>
        <td>config.beginning_of_week</td>
        <td><%= Rails.configuration.beginning_of_week %></td>
        <td>
          Sets the default beginning of week for the application. Accepts a valid week day symbol (e.g. :monday).
        </td>
      </tr>
    </table>

    <div class="panel panel-warning">
      <div class="panel-heading">
        <h4 class="panel-title" data-toggle="collapse" data-target="#rails_config_instances">Instance Variables</h4>
      </div>
      <div id="rails_config_instances" class="panel-body collapse">
        <dl class="dl-horizontal">
          <%- Rails.configuration.instance_variables.sort.each do |symbol| %>
              <dt><%= symbol %></dt>
              <dd><samp><%= Rails.configuration.instance_variable_get(symbol) %></samp></dd>
          <%- end %>
        </dl>
      </div>
    </div>
  </div>
  <div class="tab-pane" id="application">
    <p>
      The fully-configured Rails Application object manages class loading and request routing.
    </p>
    <%- all_autoload_paths = Rails.application.instance_variable_get('@_all_autoload_paths') -%>
    <%- all_load_paths = Rails.application.instance_variable_get('@_all_load_paths') -%>
    <h3>Load Paths</h3>
    <ol class="list-unstyled">
    <% all_load_paths.each do |path| %>
        <li><%= path %><%= ' *' unless all_autoload_paths.include?(path) %></li>
    <% end %>
    </ol>
    <p>Paths marked with '*' are not autoload paths</p>
    <div class="panel panel-warning">
      <div class="panel-heading">
        <h4 class="panel-title" data-toggle="collapse" data-target="#rails_app_instances">Instance Variables</h4>
      </div>
      <div id="rails_app_instances" class="panel-body collapse">
        <dl class="dl-horizontal">
          <%- Rails.application.instance_variables.sort.each do |symbol| %>
              <dt><%= symbol %></dt>
              <dd><samp><%= Rails.application.instance_variable_get(symbol).class.name %></samp></dd>
          <%- end %>
        </dl>
      </div>
    </div>
  </div>
  <div class="tab-pane" id="initializers">
    <p>Rails initializers are blocks of code that run during application initialization.</p>
    <p>Initializers can be provided by any Railtie, which includes Rails components themselves as well as many Gems.</p>
    <ol>
      <%- Rails.application.initializers.each do |initializer| %>
        <li><%= initializer.name %> - <%= initializer.instance_variable_get('@context').class.name %></li>
      <%- end %>
    </ol>
  </div>
  <div class="tab-pane" id="middleware">
    <p>The Rack middleware configuration shows the modules in the Rack stack that will process the request and response.</p>
    <ol>
      <%- Rails.application.middleware.each do |middleware| %>
          <li><%= middleware.name %></li>
      <%- end %>
    </ol>
  </div>
  <div class="tab-pane" id="railties">
    <p>
      Railties are components of the Rails framework or any other component that needs to interact directly with the framework.
    </p>
    <p>
      The configuration order of the Railties can be specified if necessary.
    </p>
    <p>
      Rails configuration.railties_order = <%= Rails.configuration.railties_order %>
    </p>
    <ol>
      <%- # TODO: protected methods `ordered_railties` changed to return an array of arrays between rails 4.1.5 and 4.1.8. investigate and replace. -%>
      <%- ordered_railties = Rails.application.send(:ordered_railties) -%>
      <%- ordered_railties = ordered_railties[0] if ordered_railties.is_a?(Array) && ordered_railties[0].is_a?(Array) -%>
      <%- ordered_railties.each do |railtie| %>
          <li><%= railtie.railtie_name %> - <%= railtie.class.name %></li>
      <%- end %>
    </ol>
  </div>
  <div class="tab-pane" id="engines">
    <p>
      Rails Engines are mini-applications that provide functionality to the host application.
      An Engine is like a plugin module that can expose controllers, assets, rake tasks, etc.
    </p>
    <ol>
      <%- ::Rails::Engine.descendants.sort_by(&:name).each do |engine_class| %>
          <%- next if engine_class.abstract_railtie? -%>
          <%- engine = engine_class.instance %>
          <li><%= engine.engine_name %> - <%= engine_class.name %> <%= engine_class.called_from %> <%= '<b>ISOLATED</b>'.html_safe if engine_class.isolated? %> </li>
      <%- end %>
    </ol>
  </div>
  <div class="tab-pane" id="timedate">
    <p>
      Rails date and time formats are usually configured in a config/initializers/date_formats.rb file.
    </p>
    <p>
      Here are the formats that have been configured for this application (including Rails' default formats).
    </p>
    <% # http://www.foragoodstrftime.com/ %>
    <%- today, now = Date.today, Time.now %>
    <h3>Date Formats</h3>
    <table class="table table-condensed">
      <tr>
        <th>Format</th>
        <th>Example</th>
        <th>Formatter</th>
      </tr>
      <tr>
        <td><i>default</i></td>
        <td><%= today.to_s %></td>
        <td></td>
      </tr>
      <%- Date::DATE_FORMATS.sort.each do |format,formatter| %>
          <tr>
          <td>:<%= format %></td>
          <td><%= today.to_s(format) %></td>
          <td><%= formatter.respond_to?(:call) ? 'Dynamic Proc' : formatter %></td>
          </tr>
      <%- end %>
    </table>
    <h3>Time Formats</h3>
    <table class="table table-condensed">
      <tr>
        <th>Format</th>
        <th>Example</th>
        <th>Formatter</th>
      </tr>
      <tr>
        <td><i>default</i></td>
        <td><%= now.to_s %></td>
        <td></td>
      </tr>
      <%- Time::DATE_FORMATS.sort.each do |format,formatter| %>
          <tr>
            <td>:<%= format %></td>
            <td><%= today.to_s(format) %></td>
            <td><%= formatter.respond_to?(:call) ? 'Dynamic Proc' : formatter %></td>
          </tr>
      <%- end %>
    </table>
  </div>
  <div class="tab-pane" id="generators">
    <p>Rails Generators are helpers for quickly creating new code that follows Rails standards and best practices.</p>
    <p>Rails itself provides many generators as do other gems.</p>
    <p>You can configure Rails Generators to generate files based on your project's preferences.</p>
    <h2>Configuration Settings</h2>
    <dl>
      <dt>assets = <%= Rails::Generators.options[:rails][:assets] %></dt>
      <dd>allows to create assets on generating a scaffold. Defaults to true.</dd>
      <dt>force_plural = <%= Rails::Generators.options[:rails][:force_plural] %></dt>
      <dd>allows pluralized model names. Defaults to false.</dd>
      <dt>helper = <%= Rails::Generators.options[:rails][:helper] %></dt>
      <dd>defines whether or not to generate helpers. Defaults to true.</dd>
      <dt>integration_tool = <%= Rails::Generators.options[:rails][:integration_tool] %></dt>
      <dd>defines which integration tool to use. Defaults to nil.</dd>
      <dt>javascripts = <%= Rails::Generators.options[:rails][:javascripts] %></dt>
      <dd>turns on the hook for JavaScript files in generators. Used in Rails for when the scaffold generator is run. Defaults to true.</dd>
      <dt>javascript_engine = <%= Rails::Generators.options[:rails][:javascript_engine] %></dt>
      <dd>configures the engine to be used (for eg. coffee) when generating assets. Defaults to nil.</dd>

      <dt>orm = <%= Rails::Generators.options[:rails][:orm] %></dt>
      <dd>defines which orm to use. Defaults to false and will use Active Record by default.</dd>
      <dt>resource_controller = <%= Rails::Generators.options[:rails][:resource_controller] %></dt>
      <dd>defines which generator to use for generating a controller when using rails generate resource. Defaults to :controller.</dd>
      <dt>scaffold_controller = <%= Rails::Generators.options[:rails][:scaffold_controller] %></dt>
      <dd>different from resource_controller, defines which generator to use for generating a scaffolded controller when using rails generate scaffold. Defaults to :scaffold_controller.</dd>
      <dt>stylesheets = <%= Rails::Generators.options[:rails][:stylesheets] %></dt>
      <dd>turns on the hook for stylesheets in generators. Used in Rails for when the scaffold generator is run, but this hook can be used in other generates as well. Defaults to true.</dd>
      <dt>stylesheet_engine = <%= Rails::Generators.options[:rails][:stylesheet_engine] %></dt>
      <dd>configures the stylesheet engine (for eg. sass) to be used when generating assets. Defaults to :css.</dd>
      <dt>test_framework = <%= Rails::Generators.options[:rails][:test_framework] %></dt>
      <dd>defines which test framework to use. Defaults to false and will use Test::Unit by default.</dd>
      <dt>template_engine = <%= Rails::Generators.options[:rails][:template_engine] %></dt>
      <dd>defines which template engine to use, such as ERB or Haml. Defaults to :erb.</dd>
     </dl>
    <h2>Generators</h2>
    <ul>
      <% Rails::Generators.subclasses.each do |generator| %>
        <li><%= generator.namespace %>
          <pre><%= generator.desc %></pre>
        </li>
      <% end %>
    </ul>
  </div>
</div>
<commit_msg>show rails initializers options for :group, :before, :after<commit_after><h1>Rails Overview</h1>

<pre>
Rails Version = <%= Rails::VERSION::STRING %>
Environment = <%= Rails.env %>
Root = <%= Rails.root %>
Timezone = <%= Rails.configuration.time_zone %>
Log Level = <%= Rails.configuration.log_level %>
</pre>

<ul class="nav nav-tabs" role="tablist">
  <li class="active"><a href="#config" role="tab" data-toggle="tab">Configuration</a></li>
  <li><a href="#application" role="tab" data-toggle="tab">Application</a></li>
  <li><a href="#initializers" role="tab" data-toggle="tab">Initializers</a></li>
  <li><a href="#middleware" role="tab" data-toggle="tab">Middleware</a></li>
  <li><a href="#railties" role="tab" data-toggle="tab">Railties</a></li>
  <li><a href="#engines" role="tab" data-toggle="tab">Engines</a></li>
  <li><a href="#generators" role="tab" data-toggle="tab">Generators</a></li>
  <li><a href="#timedate" role="tab" data-toggle="tab">Time and Date Formats</a></li>
</ul>

<div class="tab-content">
  <div class="tab-pane active" id="config">
    <p>
      Rails configuration is managed through the applications's config/application.rb, an environment-specific configuration file, and initializers from the config/initializers directory.
    </p>
    <p>
      The combined results of these configurations are shown here:
    </p>
    <table class="table table-condensed">
      <tr>
        <th>Setting</th>
        <th>Value</th>
        <th>Description</th>
      </tr>
      <tr>
        <td>config.asset_host</td>
        <td><%= Rails.configuration.asset_host %></td>
        <td>
           Sets the host for the assets. Useful when CDNs are used for hosting assets, or when you want to work around the concurrency constraints built-in in browsers using different domain aliases. Shorter version of config.action_controller.asset_host.
        </td>
      </tr>
      <tr>
        <td>config.beginning_of_week</td>
        <td><%= Rails.configuration.beginning_of_week %></td>
        <td>
          Sets the default beginning of week for the application. Accepts a valid week day symbol (e.g. :monday).
        </td>
      </tr>
    </table>

    <div class="panel panel-warning">
      <div class="panel-heading">
        <h4 class="panel-title" data-toggle="collapse" data-target="#rails_config_instances">Instance Variables</h4>
      </div>
      <div id="rails_config_instances" class="panel-body collapse">
        <dl class="dl-horizontal">
          <%- Rails.configuration.instance_variables.sort.each do |symbol| %>
              <dt><%= symbol %></dt>
              <dd><samp><%= Rails.configuration.instance_variable_get(symbol) %></samp></dd>
          <%- end %>
        </dl>
      </div>
    </div>
  </div>
  <div class="tab-pane" id="application">
    <p>
      The fully-configured Rails Application object manages class loading and request routing.
    </p>
    <%- all_autoload_paths = Rails.application.instance_variable_get('@_all_autoload_paths') -%>
    <%- all_load_paths = Rails.application.instance_variable_get('@_all_load_paths') -%>
    <h3>Load Paths</h3>
    <ol class="list-unstyled">
    <% all_load_paths.each do |path| %>
        <li><%= path %><%= ' *' unless all_autoload_paths.include?(path) %></li>
    <% end %>
    </ol>
    <p>Paths marked with '*' are not autoload paths</p>
    <div class="panel panel-warning">
      <div class="panel-heading">
        <h4 class="panel-title" data-toggle="collapse" data-target="#rails_app_instances">Instance Variables</h4>
      </div>
      <div id="rails_app_instances" class="panel-body collapse">
        <dl class="dl-horizontal">
          <%- Rails.application.instance_variables.sort.each do |symbol| %>
              <dt><%= symbol %></dt>
              <dd><samp><%= Rails.application.instance_variable_get(symbol).class.name %></samp></dd>
          <%- end %>
        </dl>
      </div>
    </div>
  </div>
  <div class="tab-pane" id="initializers">
    <p>Rails initializers are blocks of code that run during application initialization.</p>
    <p>Initializers can be provided by any Railtie, which includes Rails components themselves as well as many Gems.</p>
    <table class="table table-condensed">
      <tr><th>#</th><th>Name</th><th>Context Class</th><th>Group</th><th>After</th><th>Before</th></tr>
    <%- idx = 0 %>
    <%- Rails.application.initializers.tsort_each do |initializer| %>
      <%- options = initializer.instance_variable_get('@options') %>
      <tr>
        <td><%= idx+=1 %></td>
        <td><%= initializer.name %></td>
        <td><%= initializer.instance_variable_get('@context').class.name %></td>
        <td><%= options.try(:[],:group) %></td>
        <td><%= options.try(:[],:after) %></td>
        <td><%= options.try(:[],:before) %></td>
      </tr>
    <%- end %>
    </table>
  </div>
  <div class="tab-pane" id="middleware">
    <p>The Rack middleware configuration shows the modules in the Rack stack that will process the request and response.</p>
    <ol>
      <%- Rails.application.middleware.each do |middleware| %>
          <li><%= middleware.name %></li>
      <%- end %>
    </ol>
  </div>
  <div class="tab-pane" id="railties">
    <p>
      Railties are components of the Rails framework or any other component that needs to interact directly with the framework.
    </p>
    <p>
      The configuration order of the Railties can be specified if necessary.
    </p>
    <p>
      Rails configuration.railties_order = <%= Rails.configuration.railties_order %>
    </p>
    <ol>
      <%- # TODO: protected methods `ordered_railties` changed to return an array of arrays between rails 4.1.5 and 4.1.8. investigate and replace. -%>
      <%- ordered_railties = Rails.application.send(:ordered_railties) -%>
      <%- ordered_railties = ordered_railties[0] if ordered_railties.is_a?(Array) && ordered_railties[0].is_a?(Array) -%>
      <%- ordered_railties.each do |railtie| %>
          <li><%= railtie.railtie_name %> - <%= railtie.class.name %></li>
      <%- end %>
    </ol>
  </div>
  <div class="tab-pane" id="engines">
    <p>
      Rails Engines are mini-applications that provide functionality to the host application.
      An Engine is like a plugin module that can expose controllers, assets, rake tasks, etc.
    </p>
    <ol>
      <%- ::Rails::Engine.descendants.sort_by(&:name).each do |engine_class| %>
          <%- next if engine_class.abstract_railtie? -%>
          <%- engine = engine_class.instance %>
          <li><%= engine.engine_name %> - <%= engine_class.name %> <%= engine_class.called_from %> <%= '<b>ISOLATED</b>'.html_safe if engine_class.isolated? %> </li>
      <%- end %>
    </ol>
  </div>
  <div class="tab-pane" id="timedate">
    <p>
      Rails date and time formats are usually configured in a config/initializers/date_formats.rb file.
    </p>
    <p>
      Here are the formats that have been configured for this application (including Rails' default formats).
    </p>
    <% # http://www.foragoodstrftime.com/ %>
    <%- today, now = Date.today, Time.now %>
    <h3>Date Formats</h3>
    <table class="table table-condensed">
      <tr>
        <th>Format</th>
        <th>Example</th>
        <th>Formatter</th>
      </tr>
      <tr>
        <td><i>default</i></td>
        <td><%= today.to_s %></td>
        <td></td>
      </tr>
      <%- Date::DATE_FORMATS.sort.each do |format,formatter| %>
          <tr>
          <td>:<%= format %></td>
          <td><%= today.to_s(format) %></td>
          <td><%= formatter.respond_to?(:call) ? 'Dynamic Proc' : formatter %></td>
          </tr>
      <%- end %>
    </table>
    <h3>Time Formats</h3>
    <table class="table table-condensed">
      <tr>
        <th>Format</th>
        <th>Example</th>
        <th>Formatter</th>
      </tr>
      <tr>
        <td><i>default</i></td>
        <td><%= now.to_s %></td>
        <td></td>
      </tr>
      <%- Time::DATE_FORMATS.sort.each do |format,formatter| %>
          <tr>
            <td>:<%= format %></td>
            <td><%= today.to_s(format) %></td>
            <td><%= formatter.respond_to?(:call) ? 'Dynamic Proc' : formatter %></td>
          </tr>
      <%- end %>
    </table>
  </div>
  <div class="tab-pane" id="generators">
    <p>Rails Generators are helpers for quickly creating new code that follows Rails standards and best practices.</p>
    <p>Rails itself provides many generators as do other gems.</p>
    <p>You can configure Rails Generators to generate files based on your project's preferences.</p>
    <h2>Configuration Settings</h2>
    <dl>
      <dt>assets = <%= Rails::Generators.options[:rails][:assets] %></dt>
      <dd>allows to create assets on generating a scaffold. Defaults to true.</dd>
      <dt>force_plural = <%= Rails::Generators.options[:rails][:force_plural] %></dt>
      <dd>allows pluralized model names. Defaults to false.</dd>
      <dt>helper = <%= Rails::Generators.options[:rails][:helper] %></dt>
      <dd>defines whether or not to generate helpers. Defaults to true.</dd>
      <dt>integration_tool = <%= Rails::Generators.options[:rails][:integration_tool] %></dt>
      <dd>defines which integration tool to use. Defaults to nil.</dd>
      <dt>javascripts = <%= Rails::Generators.options[:rails][:javascripts] %></dt>
      <dd>turns on the hook for JavaScript files in generators. Used in Rails for when the scaffold generator is run. Defaults to true.</dd>
      <dt>javascript_engine = <%= Rails::Generators.options[:rails][:javascript_engine] %></dt>
      <dd>configures the engine to be used (for eg. coffee) when generating assets. Defaults to nil.</dd>

      <dt>orm = <%= Rails::Generators.options[:rails][:orm] %></dt>
      <dd>defines which orm to use. Defaults to false and will use Active Record by default.</dd>
      <dt>resource_controller = <%= Rails::Generators.options[:rails][:resource_controller] %></dt>
      <dd>defines which generator to use for generating a controller when using rails generate resource. Defaults to :controller.</dd>
      <dt>scaffold_controller = <%= Rails::Generators.options[:rails][:scaffold_controller] %></dt>
      <dd>different from resource_controller, defines which generator to use for generating a scaffolded controller when using rails generate scaffold. Defaults to :scaffold_controller.</dd>
      <dt>stylesheets = <%= Rails::Generators.options[:rails][:stylesheets] %></dt>
      <dd>turns on the hook for stylesheets in generators. Used in Rails for when the scaffold generator is run, but this hook can be used in other generates as well. Defaults to true.</dd>
      <dt>stylesheet_engine = <%= Rails::Generators.options[:rails][:stylesheet_engine] %></dt>
      <dd>configures the stylesheet engine (for eg. sass) to be used when generating assets. Defaults to :css.</dd>
      <dt>test_framework = <%= Rails::Generators.options[:rails][:test_framework] %></dt>
      <dd>defines which test framework to use. Defaults to false and will use Test::Unit by default.</dd>
      <dt>template_engine = <%= Rails::Generators.options[:rails][:template_engine] %></dt>
      <dd>defines which template engine to use, such as ERB or Haml. Defaults to :erb.</dd>
     </dl>
    <h2>Generators</h2>
    <ul>
      <% Rails::Generators.subclasses.each do |generator| %>
        <li><%= generator.namespace %>
          <pre><%= generator.desc %></pre>
        </li>
      <% end %>
    </ul>
  </div>
</div>

{'fraction_non_alphanumeric': 0.16660714285714287, 'fraction_numerical': 0.002232142857142857, 'mean_word_length': 3.0596230518303735, 'pattern_counts': {'":': 0, '<': 773, '<?xml version=': 0, '>': 773, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4995454', 'n_tokens_mistral': 7487, 'n_tokens_neox': 7011, 'n_words': 1815}