#!/usr/bin/env ruby $:.unshift(File.dirname(__FILE__) + '/../lib') unless $:.include?(File.dirname(__FILE__) + '/../lib') if ARGV.first == "server" require "wally" Sinatra::Application.run! elsif ARGV[0] == "push" require "restclient" require "json" require "wally" features = [] Dir.glob(File.join("#{ARGV[2]}", "**/*.feature")).each do |feature_path| gherkin = Wally::ParsesFeatures.new.parse(File.read(feature_path)) features << {:path => feature_path, :gherkin => gherkin} end RestClient.put "#{ARGV[1]}/features/?authentication_code=#{File.read(".wally")}", features.to_json, {:content_type => :json, :accept => :json} end