Sha256: d8200c25a5b620098f78665e38e227cda0c91910d7616a21ebdf21d52a3ed6a7

Contents?: true

Size: 1.36 KB

Versions: 6

Compression:

Stored size: 1.36 KB

Contents

require_relative "teuton/application"

module Teuton
  def self.create(path_to_new_dir)
    require_relative "teuton/skeleton"
    Skeleton.create(path_to_new_dir)
  end

  def self.run(projectpath, options = {})
    Application.instance.add_input_params(projectpath, options)
    require_dsl_and_script("teuton/case_manager/dsl") # Define DSL keywords
  end

  def self.readme(projectpath, options = {})
    # Create Readme file for a teuton test
    Application.instance.add_input_params(projectpath, options)
    require_dsl_and_script("teuton/readme/readme") # Define DSL keywords

    app = Application.instance
    readme = Readme.new(app.script_path, app.config_path)
    readme.show
  end

  def self.check(projectpath, options = {})
    Application.instance.add_input_params(projectpath, options)
    require_dsl_and_script("teuton/check/laboratory") # Define DSL keywords

    app = Application.instance
    lab = Laboratory.new(app.script_path, app.config_path)
    lab.show unless options[:panelconfig]
    lab.show_panelconfig if options[:panelconfig]
  end

  private_class_method def self.require_dsl_and_script(dslpath)
    app = Application.instance
    require_relative dslpath
    begin
      require_relative app.script_path
    rescue SyntaxError => e
      puts e.to_s
      puts Rainbow.new("==> [FAIL] SyntaxError into file #{app.script_path}").red
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
teuton-2.4.0 lib/teuton.rb
teuton-2.3.11 lib/teuton.rb
teuton-2.3.10 lib/teuton.rb
teuton-2.3.9 lib/teuton.rb
teuton-2.3.8 lib/teuton.rb
teuton-2.3.7 lib/teuton.rb