Sha256: 8611ddcbaf71894870ca0b9f1824212ef5fcbacdcc6f858deb5dabccd3280735

Contents?: true

Size: 1.09 KB

Versions: 25

Compression:

Stored size: 1.09 KB

Contents

module Speckle
  module CLI

    require 'speckle/version'
    require 'speckle/cli/rake_app'

    class Controller

      def initialize(options)
        @options = options
      end

      def rake(task)
        if @rake_app.nil?
          @rake_app = RakeApp.new(@options)
        end

        @rake_app.invoke_task(task)
      end

      def show_version
        puts VERSION
      end

      def show_help
        puts @options.opts
      end

      def show_error(msg = @options.error)
        puts "Error: #{msg}"
        puts

        show_help
      end

      def show_invalid_option
        show_error @options.error
      end

      def show_missing_args
        show_error @options.error
      end

      def show_parser_error
        show_error @options.error
      end

      def show_no_spec_dir
        show_error '"spec" directory not found'
      end

      def compile
        rake :compile_tests
      end

      def compile_and_test
        rake :compile_and_test
      end

      def test
        rake :test
      end

      def watch
        puts '--- TODO ---'
      end

    end

  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
speckle-0.2.0 lib/speckle/cli/controller.rb
speckle-0.1.31 lib/speckle/cli/controller.rb
speckle-0.1.30 lib/speckle/cli/controller.rb
speckle-0.1.29 lib/speckle/cli/controller.rb
speckle-0.1.28 lib/speckle/cli/controller.rb
speckle-0.1.27 lib/speckle/cli/controller.rb
speckle-0.1.26 lib/speckle/cli/controller.rb
speckle-0.1.25 lib/speckle/cli/controller.rb
speckle-0.1.24 lib/speckle/cli/controller.rb
speckle-0.1.23 lib/speckle/cli/controller.rb
speckle-0.1.22 lib/speckle/cli/controller.rb
speckle-0.1.21 lib/speckle/cli/controller.rb
speckle-0.1.20 lib/speckle/cli/controller.rb
speckle-0.1.19 lib/speckle/cli/controller.rb
speckle-0.1.18 lib/speckle/cli/controller.rb
speckle-0.1.17 lib/speckle/cli/controller.rb
speckle-0.1.16 lib/speckle/cli/controller.rb
speckle-0.1.15 lib/speckle/cli/controller.rb
speckle-0.1.14 lib/speckle/cli/controller.rb
speckle-0.1.13 lib/speckle/cli/controller.rb