bin/aipim in aipim-rails-0.0.23 vs bin/aipim in aipim-rails-0.0.40

- old
+ new

@@ -6,15 +6,39 @@ if ARGV[0] == 'generate' system('mkdir -p aipim') system('mkdir -p aipim/screenshots') system('cp '+path+'lib/screenshot.rb features/support/') - system('mkdir -p public/aipim') - system('cp '+path+'lib/bootstrap.min.css public/aipim/') - system('cp '+path+'lib/jquery-1.9.1.js public/aipim/') + elsif ARGV[0] == 'html' - ConvertToHtml.init("aipim/markdown.md") - system('cp -r aipim/screenshots public/aipim/') - system('cp -r aipim/relatorio.html public/aipim/') -else - Parser.init("features/login.feature") + %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