Sha256: eb0fb3246cbb887990256da70070c3cb57d99f551a56e2f9a01308ba3c459a97

Contents?: true

Size: 813 Bytes

Versions: 69

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

69 entries across 69 versions & 1 rubygems

Version Path
inferno_core-0.4.5 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.4.4 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.4.3 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.4.2 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.4.2.pre lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.4.1 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.4.1.pre2 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.4.1.pre lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.4.0 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.3.12 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.3.11 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.3.10 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.3.9 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.3.8 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.3.7 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.3.6 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.3.5 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.3.4 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.3.3 lib/inferno/apps/cli/suite_input_template.rb
inferno_core-0.3.2 lib/inferno/apps/cli/suite_input_template.rb