Sha256: edf5cb69da5150d47e38a2fe46c82b676bea3986ffac40cda76090953c0f61ed

Contents?: true

Size: 1.21 KB

Versions: 51

Compression:

Stored size: 1.21 KB

Contents

# -*- encoding : utf-8 -*-
require "optparse"

module Decko
  module Commands
    class CucumberCommand
      class Parser < OptionParser
        def initialize opts
          super() do |parser|
            parser.banner = "Usage: decko cucumber [DECKO ARGS] -- [CUCUMBER ARGS]\n\n"
            parser.separator <<-EOT.strip_heredoc

               DECKO ARGS
            EOT
            opts[:env] = ["RAILS_ROOT=."]
            parser.on("-d", "--debug", "Drop into debugger on failure") do |a|
              opts[:env] << "DEBUG=1" if a
            end
            parser.on("-f", "--fast", "Stop on first failure") do |a|
              opts[:env] << "FAST=1" if a
            end
            parser.on("-l", "--launchy", "Open page on failure") do |a|
              opts[:env] << "LAUNCHY=1" if a
            end
            parser.on("-s", "--step", "Pause after each step") do |a|
              opts[:env] << "STEP=1" if a
            end
            parser.on("--[no-]spring", "Run with spring") do |spring|
              opts[:executer] =
                if spring
                 "spring"
                else
                 "bundle exec"
                end
            end
          end
        end
      end
    end
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
decko-0.11.4 lib/decko/commands/cucumber_command/parser.rb
decko-0.11.3 lib/decko/commands/cucumber_command/parser.rb
decko-0.11.2 lib/decko/commands/cucumber_command/parser.rb
decko-0.11.1 lib/decko/commands/cucumber_command/parser.rb
decko-0.11.0 lib/decko/commands/cucumber_command/parser.rb
decko-0.10.0 lib/decko/commands/cucumber_command/parser.rb
decko-0.9.6 lib/decko/commands/cucumber_command/parser.rb
decko-0.9.5 lib/decko/commands/cucumber_command/parser.rb
decko-0.9.4 lib/decko/commands/cucumber_command/parser.rb
decko-0.9.3 lib/decko/commands/cucumber_command/parser.rb
decko-0.9.2 lib/decko/commands/cucumber_command/parser.rb
decko-0.9.1 lib/decko/commands/cucumber_command/parser.rb
decko-0.9.0 lib/decko/commands/cucumber_command/parser.rb
decko-0.8.3 lib/decko/commands/cucumber_command/parser.rb
decko-0.8.2 lib/decko/commands/cucumber_command/parser.rb
decko-0.8.1 lib/decko/commands/cucumber_command/parser.rb
decko-0.8.0 lib/decko/commands/cucumber_command/parser.rb
decko-0.7.0 lib/decko/commands/cucumber_command/parser.rb
decko-0.7.0.pre lib/decko/commands/cucumber_command/parser.rb
decko-0.6.8 lib/decko/commands/cucumber_command/parser.rb