htty 1.5.4 → 1.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +12 -9
- data/.rspec +2 -1
- data/.travis.yml +11 -8
- data/.yardopts +1 -1
- data/Gemfile +22 -10
- data/Guardfile +31 -13
- data/History.markdown +6 -0
- data/README.markdown +29 -13
- data/Rakefile +2 -64
- data/bin/console +10 -0
- data/bin/setup +8 -0
- data/exe/htty +5 -0
- data/htty.gemspec +27 -29
- data/lib/htty.rb +29 -4
- data/lib/htty/cli.rb +9 -16
- data/lib/htty/cli/body_open_command.rb +2 -7
- data/lib/htty/cli/command.rb +10 -18
- data/lib/htty/cli/commands.rb +76 -11
- data/lib/htty/cli/commands/address.rb +1 -14
- data/lib/htty/cli/commands/body_clear.rb +1 -8
- data/lib/htty/cli/commands/body_edit.rb +1 -11
- data/lib/htty/cli/commands/body_request.rb +1 -12
- data/lib/htty/cli/commands/body_request_open.rb +1 -10
- data/lib/htty/cli/commands/body_response.rb +1 -12
- data/lib/htty/cli/commands/body_response_open.rb +1 -11
- data/lib/htty/cli/commands/body_set.rb +1 -10
- data/lib/htty/cli/commands/body_unset.rb +1 -9
- data/lib/htty/cli/commands/cd.rb +1 -8
- data/lib/htty/cli/commands/cookie_add.rb +1 -8
- data/lib/htty/cli/commands/cookie_remove.rb +1 -8
- data/lib/htty/cli/commands/cookies.rb +1 -15
- data/lib/htty/cli/commands/cookies_add.rb +1 -11
- data/lib/htty/cli/commands/cookies_clear.rb +1 -8
- data/lib/htty/cli/commands/cookies_remove.rb +1 -11
- data/lib/htty/cli/commands/cookies_remove_all.rb +1 -11
- data/lib/htty/cli/commands/cookies_use.rb +1 -14
- data/lib/htty/cli/commands/delete.rb +1 -8
- data/lib/htty/cli/commands/exit.rb +1 -8
- data/lib/htty/cli/commands/follow.rb +1 -10
- data/lib/htty/cli/commands/form.rb +1 -7
- data/lib/htty/cli/commands/form_add.rb +1 -7
- data/lib/htty/cli/commands/form_clear.rb +1 -8
- data/lib/htty/cli/commands/form_remove.rb +1 -7
- data/lib/htty/cli/commands/form_remove_all.rb +1 -7
- data/lib/htty/cli/commands/fragment_clear.rb +1 -8
- data/lib/htty/cli/commands/fragment_set.rb +1 -10
- data/lib/htty/cli/commands/fragment_unset.rb +1 -9
- data/lib/htty/cli/commands/get.rb +1 -8
- data/lib/htty/cli/commands/header_set.rb +1 -8
- data/lib/htty/cli/commands/header_unset.rb +1 -8
- data/lib/htty/cli/commands/headers_clear.rb +1 -8
- data/lib/htty/cli/commands/headers_request.rb +1 -15
- data/lib/htty/cli/commands/headers_response.rb +1 -15
- data/lib/htty/cli/commands/headers_set.rb +1 -10
- data/lib/htty/cli/commands/headers_unset.rb +1 -10
- data/lib/htty/cli/commands/headers_unset_all.rb +1 -10
- data/lib/htty/cli/commands/help.rb +4 -12
- data/lib/htty/cli/commands/history.rb +1 -10
- data/lib/htty/cli/commands/history_verbose.rb +1 -12
- data/lib/htty/cli/commands/host_set.rb +1 -8
- data/lib/htty/cli/commands/http_delete.rb +1 -12
- data/lib/htty/cli/commands/http_get.rb +1 -13
- data/lib/htty/cli/commands/http_head.rb +1 -9
- data/lib/htty/cli/commands/http_options.rb +1 -9
- data/lib/htty/cli/commands/http_patch.rb +1 -13
- data/lib/htty/cli/commands/http_post.rb +1 -13
- data/lib/htty/cli/commands/http_put.rb +1 -12
- data/lib/htty/cli/commands/http_trace.rb +1 -9
- data/lib/htty/cli/commands/patch.rb +1 -8
- data/lib/htty/cli/commands/path_set.rb +11 -11
- data/lib/htty/cli/commands/port_set.rb +1 -9
- data/lib/htty/cli/commands/post.rb +1 -8
- data/lib/htty/cli/commands/put.rb +1 -8
- data/lib/htty/cli/commands/query_add.rb +1 -13
- data/lib/htty/cli/commands/query_clear.rb +1 -8
- data/lib/htty/cli/commands/query_remove.rb +1 -13
- data/lib/htty/cli/commands/query_set.rb +1 -13
- data/lib/htty/cli/commands/query_unset.rb +1 -13
- data/lib/htty/cli/commands/query_unset_all.rb +1 -10
- data/lib/htty/cli/commands/quit.rb +1 -7
- data/lib/htty/cli/commands/reuse.rb +5 -12
- data/lib/htty/cli/commands/scheme_set.rb +1 -9
- data/lib/htty/cli/commands/ssl_verification.rb +1 -11
- data/lib/htty/cli/commands/ssl_verification_off.rb +1 -10
- data/lib/htty/cli/commands/ssl_verification_on.rb +1 -10
- data/lib/htty/cli/commands/status.rb +1 -11
- data/lib/htty/cli/commands/undo.rb +1 -7
- data/lib/htty/cli/commands/userinfo_clear.rb +1 -8
- data/lib/htty/cli/commands/userinfo_set.rb +1 -11
- data/lib/htty/cli/commands/userinfo_unset.rb +1 -9
- data/lib/htty/cli/display.rb +4 -6
- data/lib/htty/cli/http_method_command.rb +1 -10
- data/lib/htty/cli/input_device.rb +1 -0
- data/lib/htty/cli/url_escaping.rb +1 -6
- data/lib/htty/cookies_util.rb +3 -3
- data/lib/htty/headers.rb +3 -4
- data/lib/htty/http_patch.rb +20 -23
- data/lib/htty/no_header_error.rb +1 -1
- data/lib/htty/no_location_header_error.rb +1 -3
- data/lib/htty/no_response_error.rb +1 -1
- data/lib/htty/no_set_cookie_header_error.rb +1 -3
- data/lib/htty/payload.rb +1 -5
- data/lib/htty/platform.rb +1 -1
- data/lib/htty/preferences.rb +1 -1
- data/lib/htty/request.rb +3 -13
- data/lib/htty/requests_util.rb +1 -5
- data/lib/htty/response.rb +1 -4
- data/lib/htty/session.rb +1 -3
- data/lib/htty/tempfile_preserving_extname.rb +1 -2
- data/lib/htty/uri.rb +1 -2
- data/lib/htty/version.rb +1 -1
- data/lib/tasks.rb +3 -0
- data/lib/tasks/build_doc.rake +8 -0
- data/lib/tasks/lib_each.rake +25 -0
- data/lib/tasks/spec.rake +68 -0
- data/lib/tasks/spec_each.rake +19 -0
- metadata +48 -209
- data/bin/htty +0 -5
- data/spec/integration/htty/cli/commands/query_add_spec.rb +0 -57
- data/spec/integration/htty/cli/commands/query_remove_spec.rb +0 -55
- data/spec/integration/htty/cli/commands/query_set_spec.rb +0 -78
- data/spec/integration/htty/cli/commands/query_unset_spec.rb +0 -43
- data/spec/spec_helper.rb +0 -76
- data/spec/unit/htty/cli/commands/address_spec.rb +0 -103
- data/spec/unit/htty/cli/commands/body_clear_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/body_edit_spec.rb +0 -18
- data/spec/unit/htty/cli/commands/body_request_spec.rb +0 -67
- data/spec/unit/htty/cli/commands/body_response_spec.rb +0 -72
- data/spec/unit/htty/cli/commands/body_set_spec.rb +0 -71
- data/spec/unit/htty/cli/commands/body_unset_spec.rb +0 -69
- data/spec/unit/htty/cli/commands/cd_spec.rb +0 -57
- data/spec/unit/htty/cli/commands/cookie_add_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/cookie_remove_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/cookies_add_spec.rb +0 -78
- data/spec/unit/htty/cli/commands/cookies_clear_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/cookies_remove_all_spec.rb +0 -73
- data/spec/unit/htty/cli/commands/cookies_remove_spec.rb +0 -69
- data/spec/unit/htty/cli/commands/cookies_spec.rb +0 -76
- data/spec/unit/htty/cli/commands/cookies_use_spec.rb +0 -75
- data/spec/unit/htty/cli/commands/delete_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/exit_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/follow_spec.rb +0 -70
- data/spec/unit/htty/cli/commands/form_add_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/form_clear_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/form_remove_all_spec.rb +0 -66
- data/spec/unit/htty/cli/commands/form_remove_spec.rb +0 -57
- data/spec/unit/htty/cli/commands/form_spec.rb +0 -57
- data/spec/unit/htty/cli/commands/fragment_clear_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/fragment_set_spec.rb +0 -73
- data/spec/unit/htty/cli/commands/fragment_unset_spec.rb +0 -72
- data/spec/unit/htty/cli/commands/get_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/header_set_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/header_unset_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/headers_clear_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/headers_request_spec.rb +0 -81
- data/spec/unit/htty/cli/commands/headers_response_spec.rb +0 -77
- data/spec/unit/htty/cli/commands/headers_set_spec.rb +0 -74
- data/spec/unit/htty/cli/commands/headers_unset_all_spec.rb +0 -71
- data/spec/unit/htty/cli/commands/headers_unset_spec.rb +0 -63
- data/spec/unit/htty/cli/commands/help_spec.rb +0 -67
- data/spec/unit/htty/cli/commands/history_spec.rb +0 -65
- data/spec/unit/htty/cli/commands/history_verbose_spec.rb +0 -72
- data/spec/unit/htty/cli/commands/host_set_spec.rb +0 -71
- data/spec/unit/htty/cli/commands/http_delete_spec.rb +0 -75
- data/spec/unit/htty/cli/commands/http_get_spec.rb +0 -77
- data/spec/unit/htty/cli/commands/http_head_spec.rb +0 -69
- data/spec/unit/htty/cli/commands/http_options_spec.rb +0 -69
- data/spec/unit/htty/cli/commands/http_patch_spec.rb +0 -73
- data/spec/unit/htty/cli/commands/http_post_spec.rb +0 -73
- data/spec/unit/htty/cli/commands/http_put_spec.rb +0 -71
- data/spec/unit/htty/cli/commands/http_trace_spec.rb +0 -69
- data/spec/unit/htty/cli/commands/patch_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/path_set_spec.rb +0 -72
- data/spec/unit/htty/cli/commands/port_set_spec.rb +0 -73
- data/spec/unit/htty/cli/commands/post_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/put_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/query_add_spec.rb +0 -82
- data/spec/unit/htty/cli/commands/query_clear_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/query_remove_spec.rb +0 -82
- data/spec/unit/htty/cli/commands/query_set_spec.rb +0 -82
- data/spec/unit/htty/cli/commands/query_unset_all_spec.rb +0 -74
- data/spec/unit/htty/cli/commands/query_unset_spec.rb +0 -75
- data/spec/unit/htty/cli/commands/quit_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/reuse_spec.rb +0 -72
- data/spec/unit/htty/cli/commands/scheme_set_spec.rb +0 -74
- data/spec/unit/htty/cli/commands/shared_examples_for_commands.rb +0 -55
- data/spec/unit/htty/cli/commands/ssl_verification_off_spec.rb +0 -67
- data/spec/unit/htty/cli/commands/ssl_verification_on_spec.rb +0 -60
- data/spec/unit/htty/cli/commands/ssl_verification_spec.rb +0 -65
- data/spec/unit/htty/cli/commands/status_spec.rb +0 -73
- data/spec/unit/htty/cli/commands/undo_spec.rb +0 -57
- data/spec/unit/htty/cli/commands/userinfo_clear_spec.rb +0 -64
- data/spec/unit/htty/cli/commands/userinfo_set_spec.rb +0 -97
- data/spec/unit/htty/cli/commands/userinfo_unset_spec.rb +0 -72
- data/spec/unit/htty/cli/display_spec.rb +0 -84
- data/spec/unit/htty/cli_spec.rb +0 -28
- data/spec/unit/htty/command.rb +0 -47
- data/spec/unit/htty/headers_spec.rb +0 -40
- data/spec/unit/htty/payload_spec.rb +0 -60
- data/spec/unit/htty/preferences_spec.rb +0 -8
- data/spec/unit/htty/request_follow_spec.rb +0 -94
- data/spec/unit/htty/request_spec.rb +0 -1232
- data/spec/unit/htty/request_userinfo_spec.rb +0 -208
- data/spec/unit/htty/response_spec.rb +0 -0
- data/spec/unit/htty/session_spec.rb +0 -10
- data/spec/unit/htty/shared_examples_for_requests.rb +0 -32
- data/spec/unit/htty/url_escaping.rb +0 -70
- data/spec/unit/htty/version_spec.rb +0 -8
data/lib/htty/cli.rb
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
require
|
|
2
|
-
require File.expand_path("#{File.dirname __FILE__}/cli/commands/help")
|
|
3
|
-
require File.expand_path("#{File.dirname __FILE__}/cli/input_device")
|
|
4
|
-
require File.expand_path("#{File.dirname __FILE__}/cli/display")
|
|
5
|
-
require File.expand_path("#{File.dirname __FILE__}/session")
|
|
6
|
-
require File.expand_path("#{File.dirname __FILE__}/version")
|
|
7
|
-
|
|
8
|
-
module HTTY; end
|
|
1
|
+
require 'htty'
|
|
9
2
|
|
|
10
3
|
# Encapsulates the command-line interface to _htty_.
|
|
11
4
|
class HTTY::CLI
|
|
12
5
|
|
|
6
|
+
autoload :BodyOpenCommand, 'htty/cli/body_open_command'
|
|
7
|
+
autoload :Command, 'htty/cli/command'
|
|
8
|
+
autoload :Commands, 'htty/cli/commands'
|
|
9
|
+
autoload :Display, 'htty/cli/display'
|
|
10
|
+
autoload :HTTPMethodCommand, 'htty/cli/http_method_command'
|
|
11
|
+
autoload :InputDevice, 'htty/cli/input_device'
|
|
12
|
+
autoload :UrlEscaping, 'htty/cli/url_escaping'
|
|
13
|
+
|
|
13
14
|
include HTTY::CLI::Display
|
|
14
15
|
|
|
15
16
|
# Returns the HTTY::Session created from command-line arguments.
|
|
@@ -94,11 +95,3 @@ private
|
|
|
94
95
|
end
|
|
95
96
|
end
|
|
96
97
|
end
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
Dir.glob "#{File.dirname __FILE__}/cli/*.rb" do |f|
|
|
101
|
-
require File.expand_path(
|
|
102
|
-
"#{File.dirname __FILE__}/cli/" + File.basename(f, '.rb')
|
|
103
|
-
)
|
|
104
|
-
end
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
+
require 'htty'
|
|
2
|
+
|
|
1
3
|
begin
|
|
2
4
|
require 'mime/types'
|
|
3
5
|
rescue LoadError
|
|
4
6
|
require 'rubygems'
|
|
5
7
|
retry
|
|
6
8
|
end
|
|
7
|
-
require File.expand_path("#{File.dirname __FILE__}/../platform")
|
|
8
|
-
require File.expand_path("#{File.dirname __FILE__}/../tempfile_preserving_extname")
|
|
9
|
-
require File.expand_path("#{File.dirname __FILE__}/display")
|
|
10
|
-
|
|
11
|
-
module HTTY; end
|
|
12
|
-
|
|
13
|
-
class HTTY::CLI; end
|
|
14
9
|
|
|
15
10
|
# Encapsulates behavior common to all HTTY::CLI::Command subclasses that open
|
|
16
11
|
# body content in an external viewer program.
|
data/lib/htty/cli/command.rb
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
require 'abbrev'
|
|
2
|
+
require 'htty'
|
|
2
3
|
require 'shellwords'
|
|
3
|
-
require File.expand_path("#{File.dirname __FILE__}/display")
|
|
4
|
-
|
|
5
|
-
module HTTY; end
|
|
6
|
-
|
|
7
|
-
class HTTY::CLI; end
|
|
8
4
|
|
|
9
5
|
# A base class for all HTTY::CLI::Commands.
|
|
10
6
|
class HTTY::CLI::Command
|
|
@@ -29,9 +25,7 @@ class HTTY::CLI::Command
|
|
|
29
25
|
if (match = (command_line_regexp.match(command_line)))
|
|
30
26
|
begin
|
|
31
27
|
if (arguments = match.captures[0])
|
|
32
|
-
attributes = attributes.merge(
|
|
33
|
-
:arguments => sanitize_arguments(arguments.strip.shellsplit)
|
|
34
|
-
)
|
|
28
|
+
attributes = attributes.merge(:arguments => sanitize_arguments(arguments.strip.shellsplit))
|
|
35
29
|
end
|
|
36
30
|
rescue ArgumentError
|
|
37
31
|
:unclosed_quote
|
|
@@ -61,17 +55,15 @@ class HTTY::CLI::Command
|
|
|
61
55
|
end
|
|
62
56
|
end
|
|
63
57
|
all_command_lines = [my_command_line] + other_command_lines
|
|
64
|
-
all_abbrevs = Abbrev.abbrev(all_command_lines).group_by
|
|
65
|
-
|
|
58
|
+
all_abbrevs = Abbrev.abbrev(all_command_lines).group_by { |abbrev,
|
|
59
|
+
command_line|
|
|
66
60
|
command_line
|
|
67
|
-
|
|
68
|
-
abbrevs.sort_by
|
|
69
|
-
command_line
|
|
70
|
-
end.first
|
|
61
|
+
}.collect do |command_line, abbrevs|
|
|
62
|
+
abbrevs.sort_by { |command_line, abbrev| command_line }.first
|
|
71
63
|
end
|
|
72
|
-
my_abbrev = all_abbrevs.detect
|
|
64
|
+
my_abbrev = all_abbrevs.detect { |abbrev, command_line|
|
|
73
65
|
command_line == my_command_line
|
|
74
|
-
|
|
66
|
+
}.first
|
|
75
67
|
my_abbrev_regexp = Regexp.new("^(#{Regexp.escape my_abbrev})(.*)$")
|
|
76
68
|
my_command_line.gsub my_abbrev_regexp do
|
|
77
69
|
$2.empty? ? $1 : "#{$1}[#{$2}]"
|
|
@@ -165,10 +157,10 @@ private
|
|
|
165
157
|
|
|
166
158
|
def self.namespace_siblings
|
|
167
159
|
namespace = namespaces.last
|
|
168
|
-
|
|
160
|
+
namespace.constants.collect { |constant|
|
|
169
161
|
type = namespace.module_eval(constant.to_s, __FILE__, __LINE__)
|
|
170
162
|
(type == self) ? nil : type
|
|
171
|
-
|
|
163
|
+
}.compact
|
|
172
164
|
end
|
|
173
165
|
|
|
174
166
|
public
|
data/lib/htty/cli/commands.rb
CHANGED
|
@@ -1,10 +1,81 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
class HTTY::CLI; end
|
|
1
|
+
require 'htty'
|
|
4
2
|
|
|
5
3
|
# Contains classes that implement commands in the user interface.
|
|
6
4
|
module HTTY::CLI::Commands
|
|
7
5
|
|
|
6
|
+
autoload :Address, 'htty/cli/commands/address'
|
|
7
|
+
autoload :BodyClear, 'htty/cli/commands/body_clear'
|
|
8
|
+
autoload :BodyEdit, 'htty/cli/commands/body_edit'
|
|
9
|
+
autoload :BodyRequest, 'htty/cli/commands/body_request'
|
|
10
|
+
autoload :BodyRequestOpen, 'htty/cli/commands/body_request_open'
|
|
11
|
+
autoload :BodyResponse, 'htty/cli/commands/body_response'
|
|
12
|
+
autoload :BodyResponseOpen, 'htty/cli/commands/body_response_open'
|
|
13
|
+
autoload :BodySet, 'htty/cli/commands/body_set'
|
|
14
|
+
autoload :BodyUnset, 'htty/cli/commands/body_unset'
|
|
15
|
+
autoload :Cd, 'htty/cli/commands/cd'
|
|
16
|
+
autoload :CookieAdd, 'htty/cli/commands/cookie_add'
|
|
17
|
+
autoload :CookieRemove, 'htty/cli/commands/cookie_remove'
|
|
18
|
+
autoload :Cookies, 'htty/cli/commands/cookies'
|
|
19
|
+
autoload :CookiesAdd, 'htty/cli/commands/cookies_add'
|
|
20
|
+
autoload :CookiesClear, 'htty/cli/commands/cookies_clear'
|
|
21
|
+
autoload :CookiesRemove, 'htty/cli/commands/cookies_remove'
|
|
22
|
+
autoload :CookiesRemoveAll, 'htty/cli/commands/cookies_remove_all'
|
|
23
|
+
autoload :CookiesUse, 'htty/cli/commands/cookies_use'
|
|
24
|
+
autoload :Delete, 'htty/cli/commands/delete'
|
|
25
|
+
autoload :Exit, 'htty/cli/commands/exit'
|
|
26
|
+
autoload :Follow, 'htty/cli/commands/follow'
|
|
27
|
+
autoload :Form, 'htty/cli/commands/form'
|
|
28
|
+
autoload :FormAdd, 'htty/cli/commands/form_add'
|
|
29
|
+
autoload :FormClear, 'htty/cli/commands/form_clear'
|
|
30
|
+
autoload :FormRemove, 'htty/cli/commands/form_remove'
|
|
31
|
+
autoload :FormRemoveAll, 'htty/cli/commands/form_remove_all'
|
|
32
|
+
autoload :FragmentClear, 'htty/cli/commands/fragment_clear'
|
|
33
|
+
autoload :FragmentSet, 'htty/cli/commands/fragment_set'
|
|
34
|
+
autoload :FragmentUnset, 'htty/cli/commands/fragment_unset'
|
|
35
|
+
autoload :Get, 'htty/cli/commands/get'
|
|
36
|
+
autoload :HeaderSet, 'htty/cli/commands/header_set'
|
|
37
|
+
autoload :HeaderUnset, 'htty/cli/commands/header_unset'
|
|
38
|
+
autoload :HeadersClear, 'htty/cli/commands/headers_clear'
|
|
39
|
+
autoload :HeadersRequest, 'htty/cli/commands/headers_request'
|
|
40
|
+
autoload :HeadersResponse, 'htty/cli/commands/headers_response'
|
|
41
|
+
autoload :HeadersSet, 'htty/cli/commands/headers_set'
|
|
42
|
+
autoload :HeadersUnset, 'htty/cli/commands/headers_unset'
|
|
43
|
+
autoload :HeadersUnsetAll, 'htty/cli/commands/headers_unset_all'
|
|
44
|
+
autoload :Help, 'htty/cli/commands/help'
|
|
45
|
+
autoload :History, 'htty/cli/commands/history'
|
|
46
|
+
autoload :HistoryVerbose, 'htty/cli/commands/history_verbose'
|
|
47
|
+
autoload :HostSet, 'htty/cli/commands/host_set'
|
|
48
|
+
autoload :HttpDelete, 'htty/cli/commands/http_delete'
|
|
49
|
+
autoload :HttpGet, 'htty/cli/commands/http_get'
|
|
50
|
+
autoload :HttpHead, 'htty/cli/commands/http_head'
|
|
51
|
+
autoload :HttpOptions, 'htty/cli/commands/http_options'
|
|
52
|
+
autoload :HttpPatch, 'htty/cli/commands/http_patch'
|
|
53
|
+
autoload :HttpPost, 'htty/cli/commands/http_post'
|
|
54
|
+
autoload :HttpPut, 'htty/cli/commands/http_put'
|
|
55
|
+
autoload :HttpTrace, 'htty/cli/commands/http_trace'
|
|
56
|
+
autoload :Patch, 'htty/cli/commands/patch'
|
|
57
|
+
autoload :PathSet, 'htty/cli/commands/path_set'
|
|
58
|
+
autoload :PortSet, 'htty/cli/commands/port_set'
|
|
59
|
+
autoload :Post, 'htty/cli/commands/post'
|
|
60
|
+
autoload :Put, 'htty/cli/commands/put'
|
|
61
|
+
autoload :QueryAdd, 'htty/cli/commands/query_add'
|
|
62
|
+
autoload :QueryClear, 'htty/cli/commands/query_clear'
|
|
63
|
+
autoload :QueryRemove, 'htty/cli/commands/query_remove'
|
|
64
|
+
autoload :QuerySet, 'htty/cli/commands/query_set'
|
|
65
|
+
autoload :QueryUnset, 'htty/cli/commands/query_unset'
|
|
66
|
+
autoload :QueryUnsetAll, 'htty/cli/commands/query_unset_all'
|
|
67
|
+
autoload :Quit, 'htty/cli/commands/quit'
|
|
68
|
+
autoload :Reuse, 'htty/cli/commands/reuse'
|
|
69
|
+
autoload :SchemeSet, 'htty/cli/commands/scheme_set'
|
|
70
|
+
autoload :SslVerification, 'htty/cli/commands/ssl_verification'
|
|
71
|
+
autoload :SslVerificationOff, 'htty/cli/commands/ssl_verification_off'
|
|
72
|
+
autoload :SslVerificationOn, 'htty/cli/commands/ssl_verification_on'
|
|
73
|
+
autoload :Status, 'htty/cli/commands/status'
|
|
74
|
+
autoload :Undo, 'htty/cli/commands/undo'
|
|
75
|
+
autoload :UserinfoClear, 'htty/cli/commands/userinfo_clear'
|
|
76
|
+
autoload :UserinfoSet, 'htty/cli/commands/userinfo_set'
|
|
77
|
+
autoload :UserinfoUnset, 'htty/cli/commands/userinfo_unset'
|
|
78
|
+
|
|
8
79
|
extend Enumerable
|
|
9
80
|
|
|
10
81
|
# Returns a HTTY::CLI::Command descendant whose command line representation
|
|
@@ -22,9 +93,8 @@ module HTTY::CLI::Commands
|
|
|
22
93
|
# Yields each HTTY::CLI::Command descendant in turn.
|
|
23
94
|
def self.each
|
|
24
95
|
Dir.glob "#{File.dirname __FILE__}/commands/*.rb" do |f|
|
|
25
|
-
class_name = File.basename(f, '.rb').gsub(/^(.)
|
|
26
|
-
|
|
27
|
-
end.gsub(/_(\S)/) do |initial|
|
|
96
|
+
class_name = File.basename(f, '.rb').gsub(/^(.)/, &:upcase).
|
|
97
|
+
gsub(/_(\S)/) do |initial|
|
|
28
98
|
initial.gsub(/_/, '').upcase
|
|
29
99
|
end
|
|
30
100
|
klass = const_get(class_name) rescue nil
|
|
@@ -34,8 +104,3 @@ module HTTY::CLI::Commands
|
|
|
34
104
|
end
|
|
35
105
|
|
|
36
106
|
end
|
|
37
|
-
|
|
38
|
-
Dir.glob "#{File.dirname __FILE__}/commands/*.rb" do |f|
|
|
39
|
-
require File.expand_path("#{File.dirname __FILE__}/commands/" +
|
|
40
|
-
File.basename(f, '.rb'))
|
|
41
|
-
end
|
|
@@ -1,17 +1,4 @@
|
|
|
1
|
-
require
|
|
2
|
-
require File.expand_path("#{File.dirname __FILE__}/fragment_set")
|
|
3
|
-
require File.expand_path("#{File.dirname __FILE__}/host_set")
|
|
4
|
-
require File.expand_path("#{File.dirname __FILE__}/path_set")
|
|
5
|
-
require File.expand_path("#{File.dirname __FILE__}/port_set")
|
|
6
|
-
require File.expand_path("#{File.dirname __FILE__}/query_set")
|
|
7
|
-
require File.expand_path("#{File.dirname __FILE__}/scheme_set")
|
|
8
|
-
require File.expand_path("#{File.dirname __FILE__}/userinfo_set")
|
|
9
|
-
|
|
10
|
-
module HTTY; end
|
|
11
|
-
|
|
12
|
-
class HTTY::CLI; end
|
|
13
|
-
|
|
14
|
-
module HTTY::CLI::Commands; end
|
|
1
|
+
require 'htty'
|
|
15
2
|
|
|
16
3
|
# Encapsulates the _address_ command.
|
|
17
4
|
class HTTY::CLI::Commands::Address < HTTY::CLI::Command
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
require
|
|
2
|
-
require File.expand_path("#{File.dirname __FILE__}/body_unset")
|
|
3
|
-
|
|
4
|
-
module HTTY; end
|
|
5
|
-
|
|
6
|
-
class HTTY::CLI; end
|
|
7
|
-
|
|
8
|
-
module HTTY::CLI::Commands; end
|
|
1
|
+
require 'htty'
|
|
9
2
|
|
|
10
3
|
# Encapsulates the _body-clear_ command.
|
|
11
4
|
class HTTY::CLI::Commands::BodyClear < HTTY::CLI::Command
|
|
@@ -1,15 +1,5 @@
|
|
|
1
|
+
require 'htty'
|
|
1
2
|
require 'tempfile'
|
|
2
|
-
require File.expand_path("#{File.dirname __FILE__}/../command")
|
|
3
|
-
require File.expand_path("#{File.dirname __FILE__}/../display")
|
|
4
|
-
require File.expand_path("#{File.dirname __FILE__}/body_request")
|
|
5
|
-
require File.expand_path("#{File.dirname __FILE__}/body_unset")
|
|
6
|
-
require File.expand_path("#{File.dirname __FILE__}/body_set")
|
|
7
|
-
|
|
8
|
-
module HTTY; end
|
|
9
|
-
|
|
10
|
-
class HTTY::CLI; end
|
|
11
|
-
|
|
12
|
-
module HTTY::CLI::Commands; end
|
|
13
3
|
|
|
14
4
|
# Encapsulates the _body-edit_ command.
|
|
15
5
|
class HTTY::CLI::Commands::BodyEdit < HTTY::CLI::Command
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
require
|
|
2
|
-
require File.expand_path("#{File.dirname __FILE__}/body_request_open")
|
|
3
|
-
require File.expand_path("#{File.dirname __FILE__}/body_response")
|
|
4
|
-
require File.expand_path("#{File.dirname __FILE__}/body_set")
|
|
5
|
-
require File.expand_path("#{File.dirname __FILE__}/body_unset")
|
|
6
|
-
require File.expand_path("#{File.dirname __FILE__}/headers_request")
|
|
7
|
-
|
|
8
|
-
module HTTY; end
|
|
9
|
-
|
|
10
|
-
class HTTY::CLI; end
|
|
11
|
-
|
|
12
|
-
module HTTY::CLI::Commands; end
|
|
1
|
+
require 'htty'
|
|
13
2
|
|
|
14
3
|
# Encapsulates the _body-request_ command.
|
|
15
4
|
class HTTY::CLI::Commands::BodyRequest < HTTY::CLI::Command
|
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
require
|
|
2
|
-
require File.expand_path("#{File.dirname __FILE__}/../command")
|
|
3
|
-
require File.expand_path("#{File.dirname __FILE__}/body_request")
|
|
4
|
-
require File.expand_path("#{File.dirname __FILE__}/body_response_open")
|
|
5
|
-
|
|
6
|
-
module HTTY; end
|
|
7
|
-
|
|
8
|
-
class HTTY::CLI; end
|
|
9
|
-
|
|
10
|
-
module HTTY::CLI::Commands; end
|
|
1
|
+
require 'htty'
|
|
11
2
|
|
|
12
3
|
# Encapsulates the _body-request-open_ command.
|
|
13
4
|
class HTTY::CLI::Commands::BodyRequestOpen < HTTY::CLI::Command
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
require
|
|
2
|
-
require File.expand_path("#{File.dirname __FILE__}/../command")
|
|
3
|
-
require File.expand_path("#{File.dirname __FILE__}/body_request")
|
|
4
|
-
require File.expand_path("#{File.dirname __FILE__}/body_response_open")
|
|
5
|
-
require File.expand_path("#{File.dirname __FILE__}/headers_response")
|
|
6
|
-
require File.expand_path("#{File.dirname __FILE__}/status")
|
|
7
|
-
|
|
8
|
-
module HTTY; end
|
|
9
|
-
|
|
10
|
-
class HTTY::CLI; end
|
|
11
|
-
|
|
12
|
-
module HTTY::CLI::Commands; end
|
|
1
|
+
require 'htty'
|
|
13
2
|
|
|
14
3
|
# Encapsulates the _body-response_ command.
|
|
15
4
|
class HTTY::CLI::Commands::BodyResponse < HTTY::CLI::Command
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
require
|
|
2
|
-
require File.expand_path("#{File.dirname __FILE__}/../body_open_command")
|
|
3
|
-
require File.expand_path("#{File.dirname __FILE__}/../command")
|
|
4
|
-
require File.expand_path("#{File.dirname __FILE__}/body_request_open")
|
|
5
|
-
require File.expand_path("#{File.dirname __FILE__}/body_response")
|
|
6
|
-
|
|
7
|
-
module HTTY; end
|
|
8
|
-
|
|
9
|
-
class HTTY::CLI; end
|
|
10
|
-
|
|
11
|
-
module HTTY::CLI::Commands; end
|
|
1
|
+
require 'htty'
|
|
12
2
|
|
|
13
3
|
# Encapsulates the _body-response-open_ command.
|
|
14
4
|
class HTTY::CLI::Commands::BodyResponseOpen < HTTY::CLI::Command
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
+
require 'htty'
|
|
1
2
|
require 'readline'
|
|
2
|
-
require File.expand_path("#{File.dirname __FILE__}/../command")
|
|
3
|
-
require File.expand_path("#{File.dirname __FILE__}/../display")
|
|
4
|
-
require File.expand_path("#{File.dirname __FILE__}/body_request")
|
|
5
|
-
require File.expand_path("#{File.dirname __FILE__}/body_unset")
|
|
6
|
-
|
|
7
|
-
module HTTY; end
|
|
8
|
-
|
|
9
|
-
class HTTY::CLI; end
|
|
10
|
-
|
|
11
|
-
module HTTY::CLI::Commands; end
|
|
12
3
|
|
|
13
4
|
# Encapsulates the _body-set_ command.
|
|
14
5
|
class HTTY::CLI::Commands::BodySet < HTTY::CLI::Command
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
require
|
|
2
|
-
require File.expand_path("#{File.dirname __FILE__}/body_request")
|
|
3
|
-
require File.expand_path("#{File.dirname __FILE__}/body_set")
|
|
4
|
-
|
|
5
|
-
module HTTY; end
|
|
6
|
-
|
|
7
|
-
class HTTY::CLI; end
|
|
8
|
-
|
|
9
|
-
module HTTY::CLI::Commands; end
|
|
1
|
+
require 'htty'
|
|
10
2
|
|
|
11
3
|
# Encapsulates the _body-unset_ command.
|
|
12
4
|
class HTTY::CLI::Commands::BodyUnset < HTTY::CLI::Command
|
data/lib/htty/cli/commands/cd.rb
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
require
|
|
2
|
-
require File.expand_path("#{File.dirname __FILE__}/path_set")
|
|
3
|
-
|
|
4
|
-
module HTTY; end
|
|
5
|
-
|
|
6
|
-
class HTTY::CLI; end
|
|
7
|
-
|
|
8
|
-
module HTTY::CLI::Commands; end
|
|
1
|
+
require 'htty'
|
|
9
2
|
|
|
10
3
|
# Encapsulates the _cd_ command.
|
|
11
4
|
class HTTY::CLI::Commands::Cd < HTTY::CLI::Command
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
require
|
|
2
|
-
require File.expand_path("#{File.dirname __FILE__}/cookies_add")
|
|
3
|
-
|
|
4
|
-
module HTTY; end
|
|
5
|
-
|
|
6
|
-
class HTTY::CLI; end
|
|
7
|
-
|
|
8
|
-
module HTTY::CLI::Commands; end
|
|
1
|
+
require 'htty'
|
|
9
2
|
|
|
10
3
|
# Encapsulates the _cookie-add_ command.
|
|
11
4
|
class HTTY::CLI::Commands::CookieAdd < HTTY::CLI::Command
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
require
|
|
2
|
-
require File.expand_path("#{File.dirname __FILE__}/cookies_remove")
|
|
3
|
-
|
|
4
|
-
module HTTY; end
|
|
5
|
-
|
|
6
|
-
class HTTY::CLI; end
|
|
7
|
-
|
|
8
|
-
module HTTY::CLI::Commands; end
|
|
1
|
+
require 'htty'
|
|
9
2
|
|
|
10
3
|
# Encapsulates the _cookie-remove_ command.
|
|
11
4
|
class HTTY::CLI::Commands::CookieRemove < HTTY::CLI::Command
|
|
@@ -1,18 +1,4 @@
|
|
|
1
|
-
require
|
|
2
|
-
require File.expand_path("#{File.dirname __FILE__}/../command")
|
|
3
|
-
require File.expand_path("#{File.dirname __FILE__}/../display")
|
|
4
|
-
require File.expand_path("#{File.dirname __FILE__}/cookies_add")
|
|
5
|
-
require File.expand_path("#{File.dirname __FILE__}/cookies_remove")
|
|
6
|
-
require File.expand_path("#{File.dirname __FILE__}/cookies_remove_all")
|
|
7
|
-
require File.expand_path("#{File.dirname __FILE__}/cookies_use")
|
|
8
|
-
require File.expand_path("#{File.dirname __FILE__}/headers_request")
|
|
9
|
-
require File.expand_path("#{File.dirname __FILE__}/headers_response")
|
|
10
|
-
|
|
11
|
-
module HTTY; end
|
|
12
|
-
|
|
13
|
-
class HTTY::CLI; end
|
|
14
|
-
|
|
15
|
-
module HTTY::CLI::Commands; end
|
|
1
|
+
require 'htty'
|
|
16
2
|
|
|
17
3
|
# Encapsulates the _cookies_ command.
|
|
18
4
|
class HTTY::CLI::Commands::Cookies < HTTY::CLI::Command
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
require
|
|
2
|
-
require File.expand_path("#{File.dirname __FILE__}/cookies")
|
|
3
|
-
require File.expand_path("#{File.dirname __FILE__}/cookies_remove")
|
|
4
|
-
require File.expand_path("#{File.dirname __FILE__}/cookies_remove_all")
|
|
5
|
-
require File.expand_path("#{File.dirname __FILE__}/cookies_use")
|
|
6
|
-
|
|
7
|
-
module HTTY; end
|
|
8
|
-
|
|
9
|
-
class HTTY::CLI; end
|
|
10
|
-
|
|
11
|
-
module HTTY::CLI::Commands; end
|
|
1
|
+
require 'htty'
|
|
12
2
|
|
|
13
3
|
# Encapsulates the _cookies-add_ command.
|
|
14
4
|
class HTTY::CLI::Commands::CookiesAdd < HTTY::CLI::Command
|