#!/usr/bin/env ruby require 'aipim-rails' path = File.expand_path(File.dirname(__FILE__))+"/../" if ARGV[0] == 'generate' system('mkdir -p aipim') system('mkdir -p aipim/screenshots') system('cp '+path+'lib/screenshot.rb features/support/') elsif ARGV[0] == 'html' %x[rm -rf aipim/markdown] files = [] ARGV.delete_at(0) ARGV.each do |arg| ls = %x[ls #{arg}].split("\n") ls.each do |f| f = f.split('/') f.delete_at(0) f = f.join('/') files << f if !(f =~ /.feature\z/).nil? end end files.each { |f| Parser.init(f) } files.each { |f| ConvertToHtml.init(f) } system('cp '+path+'lib/bootstrap.min.css aipim/html') system('cp '+path+'lib/jquery-1.9.1.js aipim/html') elsif ARGV[0] == 'markdown' || ARGV[0] == 'md' %x[rm -rf aipim/markdown] files = [] ARGV.delete_at(0) ARGV.each do |arg| ls = %x[ls #{arg}].split("\n") ls.each do |f| f = f.split('/') f.delete_at(0) f = f.join('/') files << f if !(f =~ /.feature\z/).nil? end end files.each { |f| Parser.init(f) } end