Sha256: cf2d84531c7fd5e2da297a8b61778a169e309d4cacca55a75057b5d8927e7b5b

Contents?: true

Size: 1.04 KB

Versions: 3

Compression:

Stored size: 1.04 KB

Contents

# frozen_string_literal: true

require 'thor'

class Generator < Thor::Group
  include Thor::Actions

  argument :automation
  argument :framework
  argument :name
  argument :visual_automation, optional: true

  def self.source_paths
    base_path = File.dirname(__FILE__)
    %W[#{base_path}/automation/templates #{base_path}/cucumber/templates #{base_path}/rspec/templates #{base_path}/templates]
  end

  def args
    initializer.first
  end

  def cucumber?
    args.include?('cucumber')
  end

  # The framework is cross platform when it supports Android and iOS
  def cross_platform?
    args.include?('cross_platform')
  end

  def mobile?
    (args & %w[android ios cross_platform]).count.positive?
  end

  def rspec?
    args.include?('rspec')
  end

  def selenium?
    args.include?('selenium')
  end

  def visual?
    initializer.first.last
  end

  def watir?
    args.include?('watir')
  end

  def web?
    args.include?(%w[selenium watir])
  end

  private

  def _initializer
    @_initializer ||= super
  end
  alias initializer _initializer
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ruby_raider-0.7.4 lib/generators/generator.rb
ruby_raider-0.7.3 lib/generators/generator.rb
ruby_raider-0.7.2 lib/generators/generator.rb