Sha256: 309d6becb0d3b442801ed6b546a1966cd57553ae456bf78077b30cbd644e3697

Contents?: true

Size: 1.38 KB

Versions: 11

Compression:

Stored size: 1.38 KB

Contents

# This generator bootstraps a Rails project for use with RSpec
class SaucelabsAdapterGenerator < Rails::Generator::Base
  DEFAULT_SHEBANG = File.join(Config::CONFIG['bindir'],
                              Config::CONFIG['ruby_install_name'])

  def initialize(runtime_args, runtime_options = {})
    puts <<-HELPFUL_INSTRUCTIONS

    The saucelabs_adapter generator installs glue to connect your Selenium tests to saucelabs.com

    After running this generator:

    1) Go edit config/selenium.yml and add your SauceLabs API credentials
    2) Add this to your selenium_helper.rb:

      require 'saucelabs-adapter'

    HELPFUL_INSTRUCTIONS
    super
  end

  def manifest
    record do |m|
      m.directory 'lib/tasks'
      m.file      'saucelabs_adapter.rake',        'lib/tasks/saucelabs_adapter.rake'
      m.file      'selenium.yml',                  'config/selenium.yml'
      if options[:jsunit]
        m.file      'jsunit.rake',                   'lib/tasks/jsunit.rake'
        m.directory 'test/jsunit'
        m.file      'jsunit_suite_example.rb',       'test/jsunit/jsunit_suite_example.rb'
      end
    end
  end

protected

  def banner
    "Usage: #{$0} saucelabs_adapter [options]"
  end

  def add_options!(opt)
    opt.separator ''
    opt.separator 'Options:'
    opt.on('--jsunit', 'Also install Saucelabs support for JsUnit') do |value|
      options[:jsunit] = true
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
saucelabs-adapter-0.8.10 generators/saucelabs_adapter/saucelabs_adapter_generator.rb
saucelabs-adapter-0.8.8 generators/saucelabs_adapter/saucelabs_adapter_generator.rb
saucelabs-adapter-0.8.7 generators/saucelabs_adapter/saucelabs_adapter_generator.rb
saucelabs-adapter-0.8.5 generators/saucelabs_adapter/saucelabs_adapter_generator.rb
saucelabs-adapter-0.8.4 generators/saucelabs_adapter/saucelabs_adapter_generator.rb
saucelabs-adapter-0.8.3 generators/saucelabs_adapter/saucelabs_adapter_generator.rb
saucelabs-adapter-0.8.2 generators/saucelabs_adapter/saucelabs_adapter_generator.rb
saucelabs-adapter-0.8.1 generators/saucelabs_adapter/saucelabs_adapter_generator.rb
saucelabs-adapter-0.8.0 generators/saucelabs_adapter/saucelabs_adapter_generator.rb
saucelabs-adapter-0.7.7 generators/saucelabs_adapter/saucelabs_adapter_generator.rb
saucelabs-adapter-0.7.6 generators/saucelabs_adapter/saucelabs_adapter_generator.rb