Sha256: 254d535f5b2b7f8dc97be36c358fc6b8ee84404fc308ea82bef49e1809ffb701

Contents?: true

Size: 918 Bytes

Versions: 17

Compression:

Stored size: 918 Bytes

Contents

require 'xcpretty/version'
require 'xcpretty/printer'
require 'xcpretty/syntax'
require 'xcpretty/snippet'
require 'xcpretty/term'
require 'xcpretty/formatters/formatter'
require 'xcpretty/formatters/simple'
require 'xcpretty/formatters/rspec'
require 'xcpretty/formatters/knock'
require 'xcpretty/formatters/tap'
require 'xcpretty/reporters/junit'
require 'xcpretty/reporters/html'
require 'xcpretty/reporters/json_compilation_database'

module XCPretty

  def self.class_from_path(path)
    source = File.read(path)
    klass = eval(source, nil, path)
    raise unless klass.is_a?(Class)
    klass
  end

  def self.load_custom_formatter(path)
    $LOAD_PATH.unshift File.dirname(path)
    class_from_path(path)
  rescue SyntaxError => e
    exit_with_error("Expected formatter source file to return a class. #{e}")
  end

  def self.exit_with_error(message)
    $stderr.puts "[!] #{message}"
    exit 1
  end

end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
xcpretty-bb-0.1.12.bb14 lib/xcpretty.rb
xcpretty-bb-0.1.12.bb13 lib/xcpretty.rb
xcpretty-bb-0.1.12.bb12 lib/xcpretty.rb
xcpretty-bb-0.1.12.bb11 lib/xcpretty.rb
xcpretty-bb-0.1.12.bb10 lib/xcpretty.rb
xcpretty-bb-0.1.12.bb9 lib/xcpretty.rb
xcpretty-bb-0.1.12.bb8 lib/xcpretty.rb
xcpretty-0.2.2 lib/xcpretty.rb
xcpretty-bb-0.1.12.bb7 lib/xcpretty.rb
xcpretty-0.2.1 lib/xcpretty.rb
xcpretty-bb-0.1.12.bb6 lib/xcpretty.rb
xcpretty-0.2.0 lib/xcpretty.rb
xcpretty-bb-0.1.12.bb5 lib/xcpretty.rb
xcpretty-bb-0.1.12.bb4 lib/xcpretty.rb
xcpretty-bb-0.1.12.bb3 lib/xcpretty.rb
xcpretty-bb-0.1.12.bb2 lib/xcpretty.rb
xcpretty-bb-0.1.12.bb1 lib/xcpretty.rb