Sha256: ccf5739693cf1a15662fe90e1818a44bc39833413b6ac6377ebea576551c3c72

Contents?: true

Size: 811 Bytes

Versions: 4

Compression:

Stored size: 811 Bytes

Contents

#!/usr/bin/env ruby

require 'rubygems'
require 'bundler/setup'
require 'pathname'

unless ARGV[0]
  puts "Usage: #{__FILE__} <feature> [--debug|--pretty]"
  exit 4
end

root          = Pathname.new(File.dirname(__FILE__)).expand_path
feature_dir   = root.join('..', 'features').expand_path
feature, line = ARGV[0].split(':')

unless File.exist?(feature)
  puts "Error: feature file '#{feature}' doesn't exist!"
  exit 4
end

parts = []
parts << "cucumber"
parts << "--require #{feature_dir}"
parts << "--format pretty" if ARGV.include?("--pretty")
parts << "--format Cucumber::Formatter::Nagios" unless ARGV.include?("--pretty")
parts << "#{line ? "#{feature}:#{line}" : feature }"
command = parts.join(' ')

if ARGV.grep(/^\-\-debug$/).size > 0
  puts command
  puts
end

system(command) ? exit(0) : exit(2)

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cucumber-nagios-0.8.10 lib/generators/project/bin/cucumber-nagios
cucumber-nagios-0.8.9 lib/generators/project/bin/cucumber-nagios
cucumber-nagios-0.8.8 lib/generators/project/bin/cucumber-nagios
cucumber-nagios-0.8.7 lib/generators/project/bin/cucumber-nagios