Sha256: 29c2941cc020c0ce75f4d2556b78831dd8c92492b975f66de04554efb3ad3495

Contents?: true

Size: 878 Bytes

Versions: 1

Compression:

Stored size: 878 Bytes

Contents

# frozen_string_literal: true

module AtCoderFriends
  # Holds applicaion global information
  # - command line options
  # - target path
  # - configuration
  # - application modules
  class Context
    attr_reader :options, :path

    def initialize(options, path)
      @options = options
      @path = File.expand_path(path)
    end

    def config
      @config ||= ConfigLoader.load_config(self)
    end

    def scraping_agent
      @scraping_agent ||= ScrapingAgent.new(self)
    end

    def sample_test_runner
      @sample_test_runner ||= SampleTestRunner.new(self)
    end

    def judge_test_runner
      @judge_test_runner ||= JudgeTestRunner.new(self)
    end

    def verifier
      @verifier ||= Verifier.new(self)
    end

    def emitter
      @emitter ||= Emitter.new(self)
    end

    def post_process
      @scraping_agent&.save_session
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
at_coder_friends-0.5.0 lib/at_coder_friends/context.rb