htty 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.markdown +21 -0
- data/MIT-LICENSE.markdown +10 -0
- data/README.markdown +238 -0
- data/VERSION +1 -1
- data/bin/htty +1 -1
- data/{app → lib}/htty.rb +0 -2
- data/{app → lib}/htty/cli.rb +11 -4
- data/{app → lib}/htty/cli/command.rb +25 -3
- data/{app → lib}/htty/cli/commands.rb +0 -2
- data/{app → lib}/htty/cli/commands/address.rb +15 -9
- data/{app → lib}/htty/cli/commands/body_clear.rb +0 -2
- data/{app → lib}/htty/cli/commands/body_request.rb +1 -3
- data/{app → lib}/htty/cli/commands/body_response.rb +1 -3
- data/{app → lib}/htty/cli/commands/body_set.rb +9 -4
- data/{app → lib}/htty/cli/commands/body_unset.rb +1 -3
- data/{app → lib}/htty/cli/commands/cd.rb +0 -2
- data/{app → lib}/htty/cli/commands/cookie_add.rb +0 -2
- data/{app → lib}/htty/cli/commands/cookie_remove.rb +0 -2
- data/{app → lib}/htty/cli/commands/cookies.rb +9 -5
- data/{app → lib}/htty/cli/commands/cookies_add.rb +1 -3
- data/{app → lib}/htty/cli/commands/cookies_clear.rb +0 -2
- data/{app → lib}/htty/cli/commands/cookies_remove.rb +1 -3
- data/{app → lib}/htty/cli/commands/cookies_remove_all.rb +1 -3
- data/{app → lib}/htty/cli/commands/cookies_use.rb +11 -4
- data/{app → lib}/htty/cli/commands/delete.rb +0 -2
- data/{app → lib}/htty/cli/commands/exit.rb +0 -2
- data/{app → lib}/htty/cli/commands/follow.rb +6 -9
- data/{app → lib}/htty/cli/commands/form.rb +0 -2
- data/{app → lib}/htty/cli/commands/form_add.rb +0 -2
- data/{app → lib}/htty/cli/commands/form_clear.rb +0 -2
- data/{app → lib}/htty/cli/commands/form_remove.rb +0 -2
- data/{app → lib}/htty/cli/commands/form_remove_all.rb +0 -2
- data/{app → lib}/htty/cli/commands/fragment_clear.rb +0 -2
- data/{app → lib}/htty/cli/commands/fragment_set.rb +6 -4
- data/{app → lib}/htty/cli/commands/fragment_unset.rb +4 -4
- data/{app → lib}/htty/cli/commands/get.rb +0 -2
- data/{app → lib}/htty/cli/commands/header_set.rb +0 -2
- data/{app → lib}/htty/cli/commands/header_unset.rb +0 -2
- data/{app → lib}/htty/cli/commands/headers_clear.rb +0 -2
- data/{app → lib}/htty/cli/commands/headers_request.rb +13 -8
- data/{app → lib}/htty/cli/commands/headers_response.rb +6 -4
- data/{app → lib}/htty/cli/commands/headers_set.rb +1 -3
- data/{app → lib}/htty/cli/commands/headers_unset.rb +1 -4
- data/{app → lib}/htty/cli/commands/headers_unset_all.rb +1 -3
- data/{app → lib}/htty/cli/commands/help.rb +8 -4
- data/{app → lib}/htty/cli/commands/history.rb +5 -7
- data/{app → lib}/htty/cli/commands/history_verbose.rb +6 -5
- data/{app → lib}/htty/cli/commands/host_set.rb +2 -7
- data/{app → lib}/htty/cli/commands/http_delete.rb +0 -2
- data/{app → lib}/htty/cli/commands/http_get.rb +0 -2
- data/{app → lib}/htty/cli/commands/http_head.rb +0 -2
- data/{app → lib}/htty/cli/commands/http_options.rb +0 -2
- data/{app → lib}/htty/cli/commands/http_post.rb +0 -2
- data/{app → lib}/htty/cli/commands/http_put.rb +0 -2
- data/{app → lib}/htty/cli/commands/http_trace.rb +0 -2
- data/{app → lib}/htty/cli/commands/path_set.rb +6 -4
- data/{app → lib}/htty/cli/commands/port_set.rb +4 -4
- data/{app → lib}/htty/cli/commands/post.rb +0 -2
- data/{app → lib}/htty/cli/commands/put.rb +0 -2
- data/{app → lib}/htty/cli/commands/query_clear.rb +0 -2
- data/{app → lib}/htty/cli/commands/query_set.rb +10 -7
- data/{app → lib}/htty/cli/commands/query_unset.rb +12 -6
- data/{app → lib}/htty/cli/commands/query_unset_all.rb +4 -4
- data/{app → lib}/htty/cli/commands/quit.rb +0 -2
- data/{app → lib}/htty/cli/commands/reuse.rb +4 -3
- data/{app → lib}/htty/cli/commands/scheme_set.rb +4 -4
- data/{app → lib}/htty/cli/commands/status.rb +8 -5
- data/{app → lib}/htty/cli/commands/undo.rb +0 -2
- data/{app → lib}/htty/cli/commands/userinfo_clear.rb +0 -2
- data/{app → lib}/htty/cli/commands/userinfo_set.rb +30 -8
- data/{app → lib}/htty/cli/commands/userinfo_unset.rb +4 -4
- data/{app → lib}/htty/cli/display.rb +40 -19
- data/{app → lib}/htty/cli/http_method_command.rb +4 -8
- data/{app → lib}/htty/cli/url_escaping.rb +0 -2
- data/{app → lib}/htty/cookies_util.rb +0 -2
- data/{app → lib}/htty/no_location_header_error.rb +3 -2
- data/{app → lib}/htty/no_response_error.rb +0 -2
- data/{app → lib}/htty/no_set_cookie_header_error.rb +3 -2
- data/{app → lib}/htty/ordered_hash.rb +2 -3
- data/{app → lib}/htty/payload.rb +2 -3
- data/{app → lib}/htty/request.rb +25 -15
- data/{app → lib}/htty/requests_util.rb +2 -3
- data/{app → lib}/htty/response.rb +2 -3
- data/{app → lib}/htty/session.rb +0 -2
- data/spec/unit/htty/cli_spec.rb +9 -14
- data/spec/unit/htty/ordered_hash_spec.rb +13 -17
- data/spec/unit/htty/request_spec.rb +281 -127
- data/spec/unit/htty/session_spec.rb +4 -7
- metadata +152 -99
- data/MIT-LICENSE.rdoc +0 -9
- data/README.rdoc +0 -199
- data/app/htty/cli/cookie_clearing_command.rb +0 -26
@@ -1,5 +1,3 @@
|
|
1
|
-
# Defines HTTY::CLI::Commands::HeadersSet.
|
2
|
-
|
3
1
|
require File.expand_path("#{File.dirname __FILE__}/../command")
|
4
2
|
require File.expand_path("#{File.dirname __FILE__}/headers_request")
|
5
3
|
require File.expand_path("#{File.dirname __FILE__}/headers_unset")
|
@@ -34,7 +32,7 @@ class HTTY::CLI::Commands::HeadersSet < HTTY::CLI::Command
|
|
34
32
|
# Returns the extended help text for the _headers-set_ command.
|
35
33
|
def self.help_extended
|
36
34
|
'Sets a header used for the request. Does not communicate with the ' +
|
37
|
-
"
|
35
|
+
"host.\n" +
|
38
36
|
"\n" +
|
39
37
|
'Headers must have unique names. When you set a header that already ' +
|
40
38
|
'exists, its value will be changed.'
|
@@ -1,5 +1,3 @@
|
|
1
|
-
# Defines HTTY::CLI::Commands::HeadersUnset.
|
2
|
-
|
3
1
|
require File.expand_path("#{File.dirname __FILE__}/../command")
|
4
2
|
require File.expand_path("#{File.dirname __FILE__}/headers_request")
|
5
3
|
require File.expand_path("#{File.dirname __FILE__}/headers_set")
|
@@ -33,8 +31,7 @@ class HTTY::CLI::Commands::HeadersUnset < HTTY::CLI::Command
|
|
33
31
|
|
34
32
|
# Returns the extended help text for the _headers-unset_ command.
|
35
33
|
def self.help_extended
|
36
|
-
'Removes a header used for the request. Does not communicate with the '
|
37
|
-
'endpoint.'
|
34
|
+
'Removes a header used for the request. Does not communicate with the host.'
|
38
35
|
end
|
39
36
|
|
40
37
|
# Returns related command classes for the _headers-unset_ command.
|
@@ -1,5 +1,3 @@
|
|
1
|
-
# Defines HTTY::CLI::Commands::HeadersUnsetAll.
|
2
|
-
|
3
1
|
require File.expand_path("#{File.dirname __FILE__}/../command")
|
4
2
|
require File.expand_path("#{File.dirname __FILE__}/headers_request")
|
5
3
|
require File.expand_path("#{File.dirname __FILE__}/headers_set")
|
@@ -28,7 +26,7 @@ class HTTY::CLI::Commands::HeadersUnsetAll < HTTY::CLI::Command
|
|
28
26
|
# Returns the extended help text for the _headers-unset-all_ command.
|
29
27
|
def self.help_extended
|
30
28
|
'Removes all headers used for the request. Does not communicate with the ' +
|
31
|
-
'
|
29
|
+
'host.'
|
32
30
|
end
|
33
31
|
|
34
32
|
# Returns related command classes for the _headers-unset-all_ command.
|
@@ -1,5 +1,3 @@
|
|
1
|
-
# Defines HTTY::CLI::Commands::Help.
|
2
|
-
|
3
1
|
require File.expand_path("#{File.dirname __FILE__}/../command")
|
4
2
|
require File.expand_path("#{File.dirname __FILE__}/../commands")
|
5
3
|
require File.expand_path("#{File.dirname __FILE__}/../display")
|
@@ -25,6 +23,12 @@ class HTTY::CLI::Commands::Help < HTTY::CLI::Command
|
|
25
23
|
'Displays this help table, or help on the specified command'
|
26
24
|
end
|
27
25
|
|
26
|
+
# Returns the extended help text for the _help_ command.
|
27
|
+
def self.help_extended
|
28
|
+
'Displays a table containing available commands and a brief description ' +
|
29
|
+
'of each, or detailed help on the specified command.'
|
30
|
+
end
|
31
|
+
|
28
32
|
# Performs the _help_ command.
|
29
33
|
def perform
|
30
34
|
return display_help if arguments.empty?
|
@@ -51,9 +55,9 @@ private
|
|
51
55
|
nil]
|
52
56
|
HTTY::CLI::Commands.select do |c|
|
53
57
|
# Filter out commands not yet implemented.
|
54
|
-
c.instance_methods
|
58
|
+
c.instance_methods.collect(&:to_sym).include?(:perform) ||
|
55
59
|
(c.alias_for &&
|
56
|
-
c.alias_for.instance_methods
|
60
|
+
c.alias_for.instance_methods.collect(&:to_sym).include?(:perform))
|
57
61
|
end.group_by(&:category).sort_by do |category, commands|
|
58
62
|
# Group commands by category and give the categories a custom order.
|
59
63
|
categories_in_order.index category
|
@@ -1,5 +1,3 @@
|
|
1
|
-
# Defines HTTY::CLI::Commands::History.
|
2
|
-
|
3
1
|
require File.expand_path("#{File.dirname __FILE__}/../command")
|
4
2
|
require File.expand_path("#{File.dirname __FILE__}/../display")
|
5
3
|
require File.expand_path("#{File.dirname __FILE__}/history_verbose")
|
@@ -29,11 +27,11 @@ class HTTY::CLI::Commands::History < HTTY::CLI::Command
|
|
29
27
|
|
30
28
|
# Returns the extended help text for the _history_ command.
|
31
29
|
def self.help_extended
|
32
|
-
'Displays previous request-response activity in this session. Does not '
|
33
|
-
"communicate with the
|
34
|
-
"\n"
|
35
|
-
'Only a summary of each request-response pair is shown;
|
36
|
-
'
|
30
|
+
'Displays previous request-response activity in this session. Does not ' +
|
31
|
+
"communicate with the host.\n" +
|
32
|
+
"\n" +
|
33
|
+
'Only a summary of each request-response pair is shown; the contents of ' +
|
34
|
+
'headers and bodies are hidden.'
|
37
35
|
end
|
38
36
|
|
39
37
|
# Returns related command classes for the _history_ command.
|
@@ -1,5 +1,3 @@
|
|
1
|
-
# Defines HTTY::CLI::Commands::HistoryVerbose.
|
2
|
-
|
3
1
|
require File.expand_path("#{File.dirname __FILE__}/../../request")
|
4
2
|
require File.expand_path("#{File.dirname __FILE__}/../../response")
|
5
3
|
require File.expand_path("#{File.dirname __FILE__}/../command")
|
@@ -32,7 +30,7 @@ class HTTY::CLI::Commands::HistoryVerbose < HTTY::CLI::Command
|
|
32
30
|
# Returns the extended help text for the _history_ command.
|
33
31
|
def self.help_extended
|
34
32
|
'Displays the details of previous request-response activity in this ' +
|
35
|
-
"session. Does not communicate with the
|
33
|
+
"session. Does not communicate with the host.\n" +
|
36
34
|
"\n" +
|
37
35
|
'All headers and body content of each request-response pair are shown.'
|
38
36
|
end
|
@@ -58,7 +56,9 @@ class HTTY::CLI::Commands::HistoryVerbose < HTTY::CLI::Command
|
|
58
56
|
show_request request
|
59
57
|
|
60
58
|
puts unless request.headers.empty?
|
61
|
-
show_headers request.headers,
|
59
|
+
show_headers request.headers,
|
60
|
+
:show_asterisk_next_to => HTTY::Request::COOKIES_HEADER_NAME,
|
61
|
+
:show_mercantile_next_to => HTTY::Request::AUTHORIZATION_HEADER_NAME
|
62
62
|
|
63
63
|
unless request.body.to_s.empty?
|
64
64
|
puts
|
@@ -69,7 +69,8 @@ class HTTY::CLI::Commands::HistoryVerbose < HTTY::CLI::Command
|
|
69
69
|
show_response request.response
|
70
70
|
|
71
71
|
puts unless request.response.headers.empty?
|
72
|
-
show_headers request.response.headers,
|
72
|
+
show_headers request.response.headers,
|
73
|
+
:show_asterisk_next_to => HTTY::Response::COOKIES_HEADER_NAME
|
73
74
|
|
74
75
|
unless request.response.body.to_s.empty?
|
75
76
|
puts
|
@@ -1,7 +1,4 @@
|
|
1
|
-
# Defines HTTY::CLI::Commands::HostSet.
|
2
|
-
|
3
1
|
require File.expand_path("#{File.dirname __FILE__}/../command")
|
4
|
-
require File.expand_path("#{File.dirname __FILE__}/../cookie_clearing_command")
|
5
2
|
require File.expand_path("#{File.dirname __FILE__}/address")
|
6
3
|
|
7
4
|
module HTTY; end
|
@@ -13,8 +10,6 @@ module HTTY::CLI::Commands; end
|
|
13
10
|
# Encapsulates the _host-set_ command.
|
14
11
|
class HTTY::CLI::Commands::HostSet < HTTY::CLI::Command
|
15
12
|
|
16
|
-
include HTTY::CLI::CookieClearingCommand
|
17
|
-
|
18
13
|
# Returns the name of a category under which help for the _host-set_ command
|
19
14
|
# should appear.
|
20
15
|
def self.category
|
@@ -34,7 +29,7 @@ class HTTY::CLI::Commands::HostSet < HTTY::CLI::Command
|
|
34
29
|
# Returns the extended help text for the _host-set_ command.
|
35
30
|
def self.help_extended
|
36
31
|
'Changes the host used for the request. Does not communicate with the ' +
|
37
|
-
"
|
32
|
+
"host.\n" +
|
38
33
|
"\n" +
|
39
34
|
"The host you supply can be either a hostname (e.g., 'github.com') or " +
|
40
35
|
"an IP address (e.g., '127.0.0.1').\n" +
|
@@ -50,7 +45,7 @@ class HTTY::CLI::Commands::HostSet < HTTY::CLI::Command
|
|
50
45
|
# Performs the _host-set_ command.
|
51
46
|
def perform
|
52
47
|
add_request_if_has_response do |request|
|
53
|
-
notify_if_cookies_cleared request do
|
48
|
+
self.class.notify_if_cookies_cleared request do
|
54
49
|
request.host_set(*arguments)
|
55
50
|
end
|
56
51
|
end
|
@@ -1,5 +1,3 @@
|
|
1
|
-
# Defines HTTY::CLI::Commands::PathSet.
|
2
|
-
|
3
1
|
require File.expand_path("#{File.dirname __FILE__}/../command")
|
4
2
|
require File.expand_path("#{File.dirname __FILE__}/../url_escaping")
|
5
3
|
require File.expand_path("#{File.dirname __FILE__}/address")
|
@@ -34,7 +32,9 @@ class HTTY::CLI::Commands::PathSet < HTTY::CLI::Command
|
|
34
32
|
# Returns the extended help text for the _path-set_ command.
|
35
33
|
def self.help_extended
|
36
34
|
'Changes the path used for the request. Does not communicate with the ' +
|
37
|
-
"
|
35
|
+
"host.\n" +
|
36
|
+
"\n" +
|
37
|
+
"The path will be URL-encoded if necessary.\n" +
|
38
38
|
"\n" +
|
39
39
|
'The console prompt shows the address for the current request.'
|
40
40
|
end
|
@@ -47,7 +47,9 @@ class HTTY::CLI::Commands::PathSet < HTTY::CLI::Command
|
|
47
47
|
# Performs the _path-set_ command.
|
48
48
|
def perform
|
49
49
|
add_request_if_has_response do |request|
|
50
|
-
request
|
50
|
+
self.class.notify_if_cookies_cleared request do
|
51
|
+
request.path_set(*escape_or_warn_of_escape_sequences(arguments))
|
52
|
+
end
|
51
53
|
end
|
52
54
|
end
|
53
55
|
|
@@ -1,5 +1,3 @@
|
|
1
|
-
# Defines HTTY::CLI::Commands::PortSet.
|
2
|
-
|
3
1
|
require File.expand_path("#{File.dirname __FILE__}/../command")
|
4
2
|
require File.expand_path("#{File.dirname __FILE__}/address")
|
5
3
|
require File.expand_path("#{File.dirname __FILE__}/scheme_set")
|
@@ -32,7 +30,7 @@ class HTTY::CLI::Commands::PortSet < HTTY::CLI::Command
|
|
32
30
|
# Returns the extended help text for the _port-set_ command.
|
33
31
|
def self.help_extended
|
34
32
|
'Changes the TCP port used for the request. Does not communicate with ' +
|
35
|
-
"the
|
33
|
+
"the host.\n" +
|
36
34
|
"\n" +
|
37
35
|
"The port you supply must be an integer between 0 and 65,535. Changing " +
|
38
36
|
"the port has no effect on the scheme, and vice versa.\n" +
|
@@ -48,7 +46,9 @@ class HTTY::CLI::Commands::PortSet < HTTY::CLI::Command
|
|
48
46
|
# Performs the _port-set_ command.
|
49
47
|
def perform
|
50
48
|
add_request_if_has_response do |request|
|
51
|
-
request
|
49
|
+
self.class.notify_if_cookies_cleared request do
|
50
|
+
request.port_set(*arguments)
|
51
|
+
end
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
@@ -1,5 +1,3 @@
|
|
1
|
-
# Defines HTTY::CLI::Commands::QuerySet.
|
2
|
-
|
3
1
|
require File.expand_path("#{File.dirname __FILE__}/../command")
|
4
2
|
require File.expand_path("#{File.dirname __FILE__}/../url_escaping")
|
5
3
|
require File.expand_path("#{File.dirname __FILE__}/address")
|
@@ -31,14 +29,17 @@ class HTTY::CLI::Commands::QuerySet < HTTY::CLI::Command
|
|
31
29
|
|
32
30
|
# Returns the help text for the _query-set_ command.
|
33
31
|
def self.help
|
34
|
-
"Sets a query
|
32
|
+
"Sets a query-string parameter in the request's address"
|
35
33
|
end
|
36
34
|
|
37
35
|
# Returns the extended help text for the _query-set_ command.
|
38
36
|
def self.help_extended
|
39
|
-
'Sets a query
|
40
|
-
"communicate with the
|
41
|
-
"\n"
|
37
|
+
'Sets a query-string parameter used for the request. Does not ' +
|
38
|
+
"communicate with the host.\n" +
|
39
|
+
"\n" +
|
40
|
+
'The name and value of the query-string parameter will be URL-encoded if ' +
|
41
|
+
"necessary.\n" +
|
42
|
+
"\n" +
|
42
43
|
'The console prompt shows the address for the current request.'
|
43
44
|
end
|
44
45
|
|
@@ -52,7 +53,9 @@ class HTTY::CLI::Commands::QuerySet < HTTY::CLI::Command
|
|
52
53
|
# Performs the _query-set_ command.
|
53
54
|
def perform
|
54
55
|
add_request_if_has_response do |request|
|
55
|
-
request
|
56
|
+
self.class.notify_if_cookies_cleared request do
|
57
|
+
request.query_set(*escape_or_warn_of_escape_sequences(arguments))
|
58
|
+
end
|
56
59
|
end
|
57
60
|
end
|
58
61
|
|
@@ -1,6 +1,5 @@
|
|
1
|
-
# Defines HTTY::CLI::Commands::QueryUnset.
|
2
|
-
|
3
1
|
require File.expand_path("#{File.dirname __FILE__}/../command")
|
2
|
+
require File.expand_path("#{File.dirname __FILE__}/../url_escaping")
|
4
3
|
require File.expand_path("#{File.dirname __FILE__}/address")
|
5
4
|
require File.expand_path("#{File.dirname __FILE__}/query_set")
|
6
5
|
require File.expand_path("#{File.dirname __FILE__}/query_unset_all")
|
@@ -14,6 +13,8 @@ module HTTY::CLI::Commands; end
|
|
14
13
|
# Encapsulates the _query-unset_ command.
|
15
14
|
class HTTY::CLI::Commands::QueryUnset < HTTY::CLI::Command
|
16
15
|
|
16
|
+
include HTTY::CLI::UrlEscaping
|
17
|
+
|
17
18
|
# Returns the name of a category under which help for the _query-unset_
|
18
19
|
# command should appear.
|
19
20
|
def self.category
|
@@ -28,13 +29,16 @@ class HTTY::CLI::Commands::QueryUnset < HTTY::CLI::Command
|
|
28
29
|
|
29
30
|
# Returns the help text for the _query-unset_ command.
|
30
31
|
def self.help
|
31
|
-
"Removes a query
|
32
|
+
"Removes a query-string parameter from the request's address"
|
32
33
|
end
|
33
34
|
|
34
35
|
# Returns the extended help text for the _query-unset_ command.
|
35
36
|
def self.help_extended
|
36
|
-
'Removes a query
|
37
|
-
"communicate with the
|
37
|
+
'Removes a query-string parameter used for the request. Does not ' +
|
38
|
+
"communicate with the host.\n" +
|
39
|
+
"\n" +
|
40
|
+
'The name of the query-string parameter will be URL-encoded if ' +
|
41
|
+
"necessary.\n" +
|
38
42
|
"\n" +
|
39
43
|
'The console prompt shows the address for the current request.'
|
40
44
|
end
|
@@ -49,7 +53,9 @@ class HTTY::CLI::Commands::QueryUnset < HTTY::CLI::Command
|
|
49
53
|
# Performs the _query-unset_ command.
|
50
54
|
def perform
|
51
55
|
add_request_if_has_response do |request|
|
52
|
-
request
|
56
|
+
self.class.notify_if_cookies_cleared request do
|
57
|
+
request.query_unset(*escape_or_warn_of_escape_sequences(arguments))
|
58
|
+
end
|
53
59
|
end
|
54
60
|
end
|
55
61
|
|
@@ -1,5 +1,3 @@
|
|
1
|
-
# Defines HTTY::CLI::Commands::QueryUnsetAll.
|
2
|
-
|
3
1
|
require File.expand_path("#{File.dirname __FILE__}/../command")
|
4
2
|
require File.expand_path("#{File.dirname __FILE__}/address")
|
5
3
|
require File.expand_path("#{File.dirname __FILE__}/query_set")
|
@@ -28,7 +26,7 @@ class HTTY::CLI::Commands::QueryUnsetAll < HTTY::CLI::Command
|
|
28
26
|
# Returns the extended help text for the _query-unset-all_ command.
|
29
27
|
def self.help_extended
|
30
28
|
'Clears the query string used for the request. Does not communicate with ' +
|
31
|
-
"the
|
29
|
+
"the host.\n" +
|
32
30
|
"\n" +
|
33
31
|
'The console prompt shows the address for the current request.'
|
34
32
|
end
|
@@ -43,7 +41,9 @@ class HTTY::CLI::Commands::QueryUnsetAll < HTTY::CLI::Command
|
|
43
41
|
# Performs the _query-unset-all_ command.
|
44
42
|
def perform
|
45
43
|
add_request_if_has_response do |request|
|
46
|
-
request
|
44
|
+
self.class.notify_if_cookies_cleared request do
|
45
|
+
request.query_unset_all(*arguments)
|
46
|
+
end
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
@@ -1,5 +1,3 @@
|
|
1
|
-
# Defines HTTY::CLI::Commands::Reuse.
|
2
|
-
|
3
1
|
require File.expand_path("#{File.dirname __FILE__}/../command")
|
4
2
|
require File.expand_path("#{File.dirname __FILE__}/../display")
|
5
3
|
require File.expand_path("#{File.dirname __FILE__}/history")
|
@@ -36,7 +34,7 @@ class HTTY::CLI::Commands::Reuse < HTTY::CLI::Command
|
|
36
34
|
def self.help_extended
|
37
35
|
'Copies the properties of a previous request to be used for the request, ' +
|
38
36
|
'using the request index number shown in history. Does not communicate ' +
|
39
|
-
"with the
|
37
|
+
"with the host.\n" +
|
40
38
|
"\n" +
|
41
39
|
'The argument is an index number that appears when you type ' +
|
42
40
|
"#{strong HTTY::CLI::Commands::History.command_line}."
|
@@ -69,6 +67,9 @@ class HTTY::CLI::Commands::Reuse < HTTY::CLI::Command
|
|
69
67
|
add_request_if_has_response do
|
70
68
|
requests[index - 1].send :dup_without_response
|
71
69
|
end
|
70
|
+
|
71
|
+
puts notice("Using a copy of request ##{index}")
|
72
|
+
self
|
72
73
|
end
|
73
74
|
|
74
75
|
end
|
@@ -1,5 +1,3 @@
|
|
1
|
-
# Defines HTTY::CLI::Commands::SchemeSet.
|
2
|
-
|
3
1
|
require File.expand_path("#{File.dirname __FILE__}/../command")
|
4
2
|
require File.expand_path("#{File.dirname __FILE__}/address")
|
5
3
|
require File.expand_path("#{File.dirname __FILE__}/port_set")
|
@@ -32,7 +30,7 @@ class HTTY::CLI::Commands::SchemeSet < HTTY::CLI::Command
|
|
32
30
|
# Returns the extended help text for the _scheme-set_ command.
|
33
31
|
def self.help_extended
|
34
32
|
'Changes the scheme, or protocol identifier, used for the request. Does ' +
|
35
|
-
"not communicate with the
|
33
|
+
"not communicate with the host.\n" +
|
36
34
|
"\n" +
|
37
35
|
"The scheme you supply must be either 'http' or 'https'. Changing the " +
|
38
36
|
"scheme has no effect on the port, and vice versa.\n" +
|
@@ -62,7 +60,9 @@ class HTTY::CLI::Commands::SchemeSet < HTTY::CLI::Command
|
|
62
60
|
# Performs the _scheme-set_ command.
|
63
61
|
def perform
|
64
62
|
add_request_if_has_response do |request|
|
65
|
-
request
|
63
|
+
self.class.notify_if_cookies_cleared request do
|
64
|
+
request.scheme_set(*arguments)
|
65
|
+
end
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|