<commit_before># Set up coverage analysis
#-----------------------------------------------------------------------------#

if RUBY_VERSION >= '1.9.3'
  require "codeclimate-test-reporter"
  CodeClimate::TestReporter.start
end

# Set up
#-----------------------------------------------------------------------------#

require 'bacon'
require 'mocha-on-bacon'
require 'pretty_bacon'
require 'pathname'

$:.unshift File.expand_path('../../lib', __FILE__)
require 'cocoapods-downloader'

module Pod
  module Downloader
    class Base

      # Override hook to suppress executables output.
      #
      def execute_command(executable, command, raise_on_failure = false)
        output = `\n#{executable} #{command} 2>&1`
        check_exit_code!(executable, command, output) if raise_on_failure
        output
      end

      def ui_action(ui_message)  yield end
      def ui_sub_action(message) yield end
      def ui_message(message)    end
    end
  end
end

def tmp_folder(path = '')
  return Pathname.pwd + 'tmp' + path
end

def tmp_folder_with_quotes(path = '')
  return tmp_folder File.join("a' \"b", path)
end

def fixture(path)
  return Pathname.pwd + 'spec/fixtures/' + path
end


require 'vcr'
require 'webmock'

VCR.configure do |c|
  # Namespace the fixture by the Ruby version, because different Ruby versions
  # can lead to different ways the data is interpreted.
  # TODO is this still needed?
  # c.cassette_library_dir = (ROOT + "spec/fixtures/vcr/#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}").to_s

  c.cassette_library_dir = (Pathname.pwd + "spec/fixtures/vcr").to_s
  c.hook_into :webmock
  # c.allow_http_connections_when_no_cassette = true
end<commit_msg>Allow code climate host on VCR<commit_after>
#-- Set up coverage analysis -------------------------------------------------#

if RUBY_VERSION >= '1.9.3'
  require "codeclimate-test-reporter"
  CodeClimate::TestReporter.start
end

#-- Requirements -------------------------------------------------------------#

require 'bacon'
require 'mocha-on-bacon'
require 'pathname'
require 'pretty_bacon'
require 'vcr'
require 'webmock'

$:.unshift File.expand_path('../../lib', __FILE__)
require 'cocoapods-downloader'

#-- Output suppression -------------------------------------------------------#

module Pod
  module Downloader
    class Base

      # Override hook to suppress executables output.
      #
      def execute_command(executable, command, raise_on_failure = false)
        output = `\n#{executable} #{command} 2>&1`
        check_exit_code!(executable, command, output) if raise_on_failure
        output
      end

      def ui_action(ui_message)  yield end
      def ui_sub_action(message) yield end
      def ui_message(message)    end
    end
  end
end

#-- Helpers ------------------------------------------------------------------#

def tmp_folder(path = '')
  return Pathname.pwd + 'tmp' + path
end

def tmp_folder_with_quotes(path = '')
  return tmp_folder File.join("a' \"b", path)
end

def fixture(path)
  return Pathname.pwd + 'spec/fixtures/' + path
end

#-- VCR configuration --------------------------------------------------------#

VCR.configure do |c|
  c.cassette_library_dir = (Pathname.pwd + "spec/fixtures/vcr").to_s
  c.hook_into :webmock
  config.ignore_hosts 'codeclimate.com'
end
{'fraction_non_alphanumeric': 0.2301829268292683, 'fraction_numerical': 0.003048780487804878, 'mean_word_length': 2.1129032258064515, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6050998', 'n_tokens_mistral': 1006, 'n_tokens_neox': 990, 'n_words': 248}