Sha256: e0d8ea7dca8d7c82878706fcfb639a86efa38e71e0ab156e397e54423e535c0d

Contents?: true

Size: 748 Bytes

Versions: 1

Compression:

Stored size: 748 Bytes

Contents

module GulpRails
  class CLI < Thor
    map %w[-v --version] => :version

    desc 'install PATH', 'Install Gulp files'
    option 'test_framework', required: true, default: 'qunit', aliases: '-t'
    def install(path = Dir.pwd)
      validate_test_framework!

      generator = Generator.new
      generator.destination_root = File.expand_path(path)
      generator.options = options
      generator.settings = Settings.new(options)
      generator.invoke_all
    end

    desc 'version', 'Display version'
    def version
      say VERSION
    end

    private
    def validate_test_framework!
      raise Error.new, 'invalid test framework. Can be qunit or jasmine' unless %w[qunit jasmine].include?(options['test_framework'])
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gulp-rails-0.1.2 lib/gulp-rails/cli.rb