cgi/http_to_yaml.rb in tap-http-0.1.0 vs cgi/http_to_yaml.rb in tap-http-0.2.0
- old
+ new
@@ -43,11 +43,11 @@
require 'rubygems'
require 'cgi'
require 'yaml'
require 'net/http'
-require 'tap/http/helpers'
+require 'tap/http/utils'
# included to sort the hash keys
class Hash
def to_yaml( opts = {} )
YAML::quick_emit( object_id, opts ) do |out|
@@ -73,24 +73,24 @@
#
# gather configs
#
config = {}
- Tap::Http::Helpers.parse_cgi_request(cgi).each_pair do |key, value|
+ Tap::Http::Utils.parse_cgi_request(cgi).each_pair do |key, value|
config[key.to_s] = value
end
original_action = config['params'].delete("__original_action").to_s
referer = config['headers']['Referer'].to_s
- config['url'] = Tap::Http::Helpers.determine_url(original_action, referer)
+ config['url'] = Tap::Http::Utils.determine_url(original_action, referer)
config['headers']['Host'] = URI.parse(config['url']).host
#
# format output
#
- # help = cgi.a(Tap::Http::Helpers::HELP_URL) { "help" }
- # how_to_get_cookies = cgi.a(Tap::Http::Helpers::COOKIES_HELP_URL) { "how to get cookies" }
+ # help = cgi.a(Tap::Http::Utils::HELP_URL) { "help" }
+ # how_to_get_cookies = cgi.a(Tap::Http::Utils::COOKIES_HELP_URL) { "how to get cookies" }
#
# If you need cookies, see #{how_to_get_cookies} or the #{help}.
cgi.out('text/plain') do
%Q{# Copy and paste into a configuration file. Multiple configs
\ No newline at end of file