Sha256: d10eac05ccdafb5be99b8c6de16f5a9b486fb1de721399baa5c49584ab7803c3
Contents?: true
Size: 1.44 KB
Versions: 8
Compression:
Stored size: 1.44 KB
Contents
#!/usr/bin/env ruby # attempt to load up the bundled gems, and give an explanatory message if we can't begin require File.join(File.dirname(__FILE__), '..', 'vendor', 'gems', 'environment') rescue LoadError puts "You need to bundle gems into your project before you can run this." puts puts "To do this, make sure the 'bundler' gem is installed, and run:" puts puts " $ gem bundle" puts exit 1 end require 'templater' module CucumberNagiosGenerators extend Templater::Manifold # feature generator class FeatureGenerator < Templater::Generator def self.source_root File.join(File.dirname(__FILE__), '..', 'lib', 'generators', 'feature') end desc <<-DESC Generate a cucumber feature. Takes a two arguments: bin/cucumber-nagios-gen feature <site-name> <feature-name> DESC first_argument :site, :required => true, :desc => "Site name" second_argument :feature, :required => true, :desc => "Feature name" template :feature do |template| template.source = "%feature_name%.feature" template.destination = "features/#{site}/#{feature}.feature" end template :step do |template| template.source = "%feature_name%_steps.rb" template.destination = "features/#{site}/steps/#{feature}_steps.rb" end end desc "Generators for a cucumber-nagios project" add :feature, FeatureGenerator end CucumberNagiosGenerators.run_cli Dir.pwd, 'cucumber-nagios-gen', '0.6.3', ARGV
Version data entries
8 entries across 8 versions & 1 rubygems