<commit_before>require File.expand_path('../boot', __FILE__)

require 'rails/all'
require 'socket'
require 'sprockets'
require 'resolv'
require 'uri'

# If you have a Gemfile, require the gems listed there, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env)
Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8

module ScholarSphere
  class Application < Rails::Application
    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration should go into files in config/initializers
    # -- all .rb files in that directory are automatically loaded.

    def get_vhost_by_host
      hostname = Socket.gethostname
      vhost = config.hosts_vhosts_map[hostname] || "https://#{hostname}/"
      uri = URI.parse(vhost)
      service = uri.host
      port = uri.port
      service << "-#{port}" unless port == 443
      [service, vhost]
    end

    def google_analytics_id
      vhost = get_vhost_by_host[0]
      ga_id = config.ga_host_map[vhost]
      ga_id ||= Rails.application.secrets.google_analytics_tracking_id
    end

    def ffmpeg_path
      vhost = get_vhost_by_host[0]
      path = config.ffmpeg_path_map[vhost]
      path ||= 'ffmpeg'
    end

    config.scholarsphere_version = "v2.1"
    config.scholarsphere_release_date = "Januray 16, 2015"<commit_msg>Fixing spelling error on versions page<commit_after>require File.expand_path('../boot', __FILE__)

require 'rails/all'
require 'socket'
require 'sprockets'
require 'resolv'
require 'uri'

# If you have a Gemfile, require the gems listed there, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env)
Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8

module ScholarSphere
  class Application < Rails::Application
    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration should go into files in config/initializers
    # -- all .rb files in that directory are automatically loaded.

    def get_vhost_by_host
      hostname = Socket.gethostname
      vhost = config.hosts_vhosts_map[hostname] || "https://#{hostname}/"
      uri = URI.parse(vhost)
      service = uri.host
      port = uri.port
      service << "-#{port}" unless port == 443
      [service, vhost]
    end

    def google_analytics_id
      vhost = get_vhost_by_host[0]
      ga_id = config.ga_host_map[vhost]
      ga_id ||= Rails.application.secrets.google_analytics_tracking_id
    end

    def ffmpeg_path
      vhost = get_vhost_by_host[0]
      path = config.ffmpeg_path_map[vhost]
      path ||= 'ffmpeg'
    end

    config.scholarsphere_version = "v2.1"
    config.scholarsphere_release_date = "January 16, 2015"
{'fraction_non_alphanumeric': 0.09527145359019265, 'fraction_numerical': 0.010507880910683012, 'mean_word_length': 3.6363636363636362, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '2185972', 'n_tokens_mistral': 939, 'n_tokens_neox': 896, 'n_words': 234}