Sha256: 231a8f90e7eaa7c47303017e3ff6e328d9621621934030585410e3ddb4d63712

Contents?: true

Size: 1.16 KB

Versions: 2

Compression:

Stored size: 1.16 KB

Contents

#!/usr/bin/env ruby

require 'rubygems' unless ENV['NO_RUBYGEMS']
require 'rubigen'

if %w(-v --version).include? ARGV.first
  require File.dirname(__FILE__) + "/../lib/howitzer"
  puts "#{File.basename($0)} #{Howitzer::VERSION}"
  exit(0)
end

require 'rubigen/scripts/generate'

require 'pp'
RubiGen::Base.use_application_sources!
RubiGen::Base.prepend_sources(*[
  RubiGen::PathSource.new(:app, File.join(File.dirname(__FILE__), "..", "generators"))
])

CORRECT_ARGS = %w[--cucumber --rspec]

if ARGV[0] == "install"
  ARGV.delete 'install'
  ARGV.each do |option|
    if option == '--cucumber'
      RubiGen::Scripts::Generate.new.run(%w[cucumber])
      RubiGen::Scripts::Generate.new.run(%w[root])
      RubiGen::Scripts::Generate.new.run(%w[config])
      RubiGen::Scripts::Generate.new.run(%w[pages])
      RubiGen::Scripts::Generate.new.run(%w[tasks])
      RubiGen::Scripts::Generate.new.run(%w[emails])
    elsif option == '--rspec'
      #TODO add rspec generator
      puts "Rspec generator is not available"
    else
      puts "ERROR: no such generator with name: '#{option}' is available"
    end
  end
else
  puts "ERROR: no such command with name: '#{ARGV[0]} found'"
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
howitzer-0.0.3 bin/howitzer
howitzer-0.0.1 bin/howitzer