Sha256: eb0fb3246cbb887990256da70070c3cb57d99f551a56e2f9a01308ba3c459a97

Contents?: true

Size: 813 Bytes

Versions: 68

Compression:

Stored size: 813 Bytes

Contents

require_relative '../../utils/preset_template_generator'

module Inferno
  module CLI
    class SuiteInputTemplate
      def run(suite_id, options)
        require_relative '../../../inferno'

        Inferno::Application.start(:suites)

        suite = Inferno::Repositories::TestSuites.new.find(suite_id)
        if suite.nil?
          puts "No Test Suite found with id: #{suite_id}"
          return 1
        end

        output = JSON.pretty_generate(Inferno::Utils::PresetTemplateGenerator.new(suite).generate)

        if options[:filename].present?
          path = File.join(Dir.pwd, 'config', 'presets', options[:filename])
          FileUtils.mkdir_p(File.dirname(path))

          File.open(path, 'w') { |f| f.puts(output) }
        else
          puts output
        end
      end
    end
  end
end

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
inferno_core-0.5.0 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.4.44 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.4.43 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.4.42 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.4.41 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.4.40 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.4.39 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.4.38 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.4.35 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.4.34 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.4.33 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.4.32 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.4.31 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.4.30 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.4.29 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.4.28 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.4.27 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.4.26 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.4.25 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.4.24 lib/inferno/apps/cli/suite_input_template.rb