Sha256: a3cca8a8cfd30bf1a6cf8c8b64f358f91b8590f94351e1f6a19a5ccf0d43d292

Contents?: true

Size: 1.46 KB

Versions: 5

Compression:

Stored size: 1.46 KB

Contents

require 'rubygems'
require 'rubigen'

class SiteGenerator < RubiGen::Base
  attr_reader :app_test_dir, :app_name

  def initialize(runtime_args, runtime_options = {})
    super
    usage if args.size != 1
    @app_test_dir = 'sites'
    @app_name=args.shift
  end

  def manifest
    record do |m|
      %w( base_urls.yaml.erb  html_elements.yaml  users_list.yaml ).each do |file|
        m.template "#{file}", "#{@app_test_dir}/#{@app_name}/conf/#{file.gsub('.erb', '')}"
      end
    end

    record do |m|
      m.directory "#{@app_test_dir}/#{@app_name}"
      BASEDIRS.each { |path| m.directory "#{@app_test_dir}/#{@app_name}/#{path}" }

      %w( base_urls.yaml.erb  html_elements.yaml  users_list.yaml ).each do |file|
        m.template "#{file}", "#{@app_test_dir}/#{@app_name}/conf/#{file.gsub('.erb', '')}"
      end


      %w( navigate.rb  reports.rb ).each do |file|
        m.template "#{file}", "#{@app_test_dir}/#{@app_name}/lib/#{file}"
      end
     
      m.template "elements.rb.erb", "#{@app_test_dir}/#{@app_name}/elements/#{@app_name}_elements.rb"
      m.template "create_flow.rb.erb", "#{@app_test_dir}/#{@app_name}/flows/#{@app_name}_flows.rb"


    end



  end

  protected
  def banner
    <<-EOS
    USAGE: #{$0} #{spec.name} site_name
    EOS
  end

  BASEDIRS = ["conf", 
              "lib", 
              "elements", 
              "helpers", 
              "flows", 
              "results", 
              "results/images", 
              "test_cases"]


end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
qa_robusta-0.1.9 qa_observer/generators/site/site_generator.rb
qa_robusta-0.1.8 qa_observer/generators/site/site_generator.rb
qa_robusta-0.1.5 qa_observer/generators/site/site_generator.rb
qa_robusta-0.1.4 qa_observer/generators/site/site_generator.rb
qa_robusta-0.1.3 qa_observer/generators/site/site_generator.rb