Sha256: 63b9d93475460991741a45e7fb7cee174f57331c6e086c08d17276ee4da28733

Contents?: true

Size: 1.19 KB

Versions: 6

Compression:

Stored size: 1.19 KB

Contents

require_relative 'automation/automation_generator'
require_relative 'common_generator'
require_relative 'cucumber/cucumber_generator'
require_relative 'helper_generator'
require_relative 'rspec/rspec_generator'

# :reek:FeatureEnvy { enabled: false }
# :reek:UtilityFunction { enabled: false }
module InvokeGenerators
  def generate_framework(structure = {})
    generators = %w[Automation Common Helpers]
    framework = structure[:framework]
    add_generator(generators, framework.capitalize)
    generators.each do |generator|
      invoke_generator({
                         automation: structure[:automation],
                         framework: framework,
                         generator: generator,
                         name: structure[:name],
                         visual: structure[:visual]
                       })
    end
  end

  def add_generator(generators, *gens)
    gens.each { |generator| generators.push generator }
  end

  def invoke_generator(structure = {})
    Object.const_get("#{structure[:generator]}Generator")
          .new([structure[:automation],
                structure[:framework],
                structure[:name],
                structure[:visual]]).invoke_all
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ruby_raider-0.7.9 lib/generators/invoke_generators.rb
ruby_raider-0.7.8 lib/generators/invoke_generators.rb
ruby_raider-0.7.7 lib/generators/invoke_generators.rb
ruby_raider-0.7.6 lib/generators/invoke_generators.rb
ruby_raider-0.7.5 lib/generators/invoke_generators.rb
ruby_raider-0.7.4 lib/generators/invoke_generators.rb