<commit_before>require 'mercenary'
require 'titlecase'

module Octopress
  require 'octopress/command'
  require 'octopress/version'
  require 'octopress/commands/new'
  require 'octopress/commands/init'
  require 'octopress/commands/publish'
  require 'octopress/commands/isolate'
  require 'octopress/isolate'
  require 'octopress-docs'

  autoload :Page, 'octopress/page'
  autoload :Post, 'octopress/post'
  autoload :Draft, 'octopress/draft'
  autoload :Scaffold, 'octopress/scaffold'

  # Automatically require these gems if installed
  BLESSED_GEMS = %w[
    octopress-ink
    octopress-deploy
  ]

  def self.logger
    @logger ||= Mercenary::Command.logger
    @logger.level = Logger::DEBUG
    @logger
  end

  # Cache Jekyll's site configuration
  #
  def self.configuration(options={})
    if @site
      @site.config
    else
      @config ||= Jekyll.configuration(options)
    end
  end

  # Cache Jekyll's site
  #
  def self.site(options={})
    @site ||= read_site(options)
  end

  # Quietly read from Jekyll's site
  #
  def self.read_site(options={})
    Jekyll.logger.log_level = :error
    s = Jekyll::Site.new(configuration(options))
    Jekyll.logger.log_level = :info
    alias_site_title(s)
  end

  # Allow site to be set
  #
  def self.site=(site)
    @site = alias_site_title(site)
  end

  # Octopress historically used site.title
  # This ensures we can all use site.name to be
  # compatible with Jekyll's scaffold convention
  #
  def self.alias_site_title(site)
    site.config['name'] ||= site.config['title']
    site
  end

  def self.gem_dir(dir='')
    File.expand_path(File.join(File.dirname(__FILE__), '../', dir))
  end

  def self.require_blessed_gems
    BLESSED_GEMS.each do |gem|
      begin<commit_msg>Fixed improper site configuration caching<commit_after>require 'mercenary'
require 'titlecase'

module Octopress
  require 'octopress/command'
  require 'octopress/version'
  require 'octopress/commands/new'
  require 'octopress/commands/init'
  require 'octopress/commands/publish'
  require 'octopress/commands/isolate'
  require 'octopress/isolate'
  require 'octopress-docs'

  autoload :Page, 'octopress/page'
  autoload :Post, 'octopress/post'
  autoload :Draft, 'octopress/draft'
  autoload :Scaffold, 'octopress/scaffold'

  # Automatically require these gems if installed
  BLESSED_GEMS = %w[
    octopress-ink
    octopress-deploy
  ]

  def self.logger
    @logger ||= Mercenary::Command.logger
    @logger.level = Logger::DEBUG
    @logger
  end

  # Cache Jekyll's site configuration
  #
  def self.configuration(options={})
    if site?
      @site.config
    else
      @config ||= Jekyll.configuration(options)
    end
  end

  def self.site?
    !@site.nil?
  end

  # Cache Jekyll's site
  #
  def self.site(options={})
    @site ||= read_site(options)
  end

  # Quietly read from Jekyll's site
  #
  def self.read_site(options={})
    Jekyll.logger.log_level = :error
    s = Jekyll::Site.new(Jekyll.configuration(options))
    Jekyll.logger.log_level = :info
    alias_site_title(s)
  end

  # Allow site to be set
  #
  def self.site=(site)
    @site = alias_site_title(site)
  end

  # Octopress historically used site.title
  # This ensures we can all use site.name to be
  # compatible with Jekyll's scaffold convention
  #
  def self.alias_site_title(site)
    site.config['name'] ||= site.config['title']
    site
  end

  def self.gem_dir(dir='')
    File.expand_path(File.join(File.dirname(__FILE__), '../', dir))
  end

  def self.require_blessed_gems
    BLESSED_GEMS.each do |gem|
      begin
{'fraction_non_alphanumeric': 0.11167086481947942, 'fraction_numerical': 0.0, 'mean_word_length': 3.4730913642052568, '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': '1019041', 'n_tokens_mistral': 1292, 'n_tokens_neox': 1252, 'n_words': 275}