Sha256: a418bd1d43052d0d8efab474000daff1ebc66291837f42f6ed51e5d000e06145

Contents?: true

Size: 1.42 KB

Versions: 9

Compression:

Stored size: 1.42 KB

Contents

require_relative 'console'
require_relative 'migration'
require_relative 'services'
require_relative 'suite'
require_relative 'suites'

module Inferno
  module CLI
    class Main < Thor
      desc 'console', 'Start an interactive console session with Inferno'
      def console
        Console.new.run
      end

      desc 'migrate', 'Run database migrations'
      def migrate
        Migration.new.run
      end

      desc 'start', 'Start Inferno'
      option :watch,
             default: false,
             type: :boolean,
             desc: 'Automatically restart Inferno when a file is changed.'
      def start
        command = 'foreman start --env=/dev/null'
        if `gem list -i foreman`.chomp == 'false'
          puts "You must install foreman with 'gem install foreman' prior to running Inferno."
        end

        if options[:watch]
          if `gem list -i rerun`.chomp == 'false'
            puts "You must install 'rerun' with 'gem install rerun' to restart on file changes."
          end

          command = "rerun \"#{command}\" --background"
        end

        system command
      end

      desc 'suites', 'List available test suites'
      def suites
        Suites.new.run
      end

      desc 'services stop/start', 'Start or stop background services'
      subcommand 'services', Services

      desc 'suite SUBCOMMAND ...ARGS', 'Perform suite-based operations'
      subcommand 'suite', Suite
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
inferno_core-0.4.18 lib/inferno/apps/cli/main.rb
inferno_core-0.4.17 lib/inferno/apps/cli/main.rb
inferno_core-0.4.16 lib/inferno/apps/cli/main.rb
inferno_core-0.4.15 lib/inferno/apps/cli/main.rb
inferno_core-0.4.14 lib/inferno/apps/cli/main.rb
inferno_core-0.4.13 lib/inferno/apps/cli/main.rb
inferno_core-0.4.12 lib/inferno/apps/cli/main.rb
inferno_core-0.4.11 lib/inferno/apps/cli/main.rb
inferno_core-0.4.10 lib/inferno/apps/cli/main.rb