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
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cfa89b632f037b19e446cf0d93caacfda4c4ee06
|
|
4
|
+
data.tar.gz: 91f979a8b2919e9a03875a9d0320bed63b6c6872
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8eefb6673967dc17ca3748a6a2ae5862b81f13c89140c6e25c91714acb11d8cba2ab64931b2e36d7616363016bda7f24aaf76531dbbdbc7ad6e7c8893afc59d8
|
|
7
|
+
data.tar.gz: 6c7938e36f4f238b6e9e392b1e4977c88712d3d945a0f4c87ec774234e9a77476442dd7fe9f1b00e5aea43790a7a9a2dec9755de181569731389dfb1ab5e2fd1
|
data/.gitignore
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
doc/
|
|
9
|
-
pkg
|
|
1
|
+
/.bundle/
|
|
2
|
+
/.rbx
|
|
3
|
+
/.ruby-*
|
|
4
|
+
/.yardoc/
|
|
5
|
+
/Gemfile.lock
|
|
6
|
+
/_yardoc/
|
|
7
|
+
/coverage/
|
|
8
|
+
/doc/
|
|
9
|
+
/pkg/
|
|
10
|
+
/spec/examples.txt
|
|
11
|
+
/spec/reports/
|
|
12
|
+
/tmp/
|
data/.rspec
CHANGED
data/.travis.yml
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
language: ruby
|
|
2
|
+
before_install: gem install bundler -v 1.10.6
|
|
2
3
|
bundler_args: --without debug doc tooling
|
|
3
4
|
rvm:
|
|
4
5
|
- 1.8.7
|
|
5
6
|
- 1.9.2
|
|
6
7
|
- 1.9.3
|
|
7
|
-
- 2.0
|
|
8
|
-
- 2.1
|
|
8
|
+
- 2.0
|
|
9
|
+
- 2.1
|
|
10
|
+
- 2.2
|
|
9
11
|
- ruby-head
|
|
10
12
|
- ree
|
|
11
13
|
- jruby-18mode
|
|
12
14
|
- jruby-19mode
|
|
13
15
|
- jruby-head
|
|
14
|
-
- rbx
|
|
15
|
-
- rbx-
|
|
16
|
-
- rbx-head
|
|
16
|
+
- rbx
|
|
17
|
+
- rbx-2
|
|
17
18
|
notifications:
|
|
18
19
|
irc: "irc.freenode.org#htty"
|
|
19
20
|
script: "bundle exec rake test"
|
|
@@ -23,6 +24,8 @@ matrix:
|
|
|
23
24
|
- rvm: jruby-18mode
|
|
24
25
|
- rvm: jruby-19mode
|
|
25
26
|
- rvm: jruby-head
|
|
26
|
-
- rvm: rbx
|
|
27
|
-
- rvm: rbx-
|
|
28
|
-
|
|
27
|
+
- rvm: rbx
|
|
28
|
+
- rvm: rbx-2
|
|
29
|
+
branches:
|
|
30
|
+
except:
|
|
31
|
+
- /^gh-pages.*$/
|
data/.yardopts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
--file History.markdown --file License.markdown --no-private --protected --title "htty, the HTTP TTY"
|
|
1
|
+
--file History.markdown --file License.markdown --file examples.markdown --no-private --protected --title "htty, the HTTP TTY"
|
data/Gemfile
CHANGED
|
@@ -1,26 +1,38 @@
|
|
|
1
|
-
source '
|
|
1
|
+
source 'https://rubygems.org'
|
|
2
2
|
|
|
3
3
|
gemspec
|
|
4
4
|
|
|
5
|
-
gem 'jruby-openssl', '~> 0', :platforms => :jruby
|
|
6
|
-
|
|
7
5
|
group :debug do
|
|
8
|
-
gem '
|
|
9
|
-
|
|
6
|
+
gem 'pry-byebug', '~> 3', :platforms => [:mri_20,
|
|
7
|
+
:mri_21,
|
|
8
|
+
:mri_22]
|
|
9
|
+
gem 'pry-debugger', '~> 0', :platforms => [:mri_18,
|
|
10
|
+
:mri_19]
|
|
10
11
|
end
|
|
11
12
|
|
|
12
13
|
group :development do
|
|
13
|
-
|
|
14
|
+
if RUBY_VERSION.start_with?('1.8')
|
|
15
|
+
gem 'codeclimate-test-reporter', '> 0', '< 0.4.2',
|
|
16
|
+
:require => false
|
|
17
|
+
else
|
|
18
|
+
gem 'codeclimate-test-reporter', '~> 0', :require => false
|
|
19
|
+
end
|
|
14
20
|
end
|
|
15
21
|
|
|
16
22
|
group :doc do
|
|
17
|
-
gem 'yard',
|
|
18
|
-
gem 'rdiscount',
|
|
23
|
+
gem 'yard', '~> 0', :require => false
|
|
24
|
+
gem 'rdiscount', '~> 2', :require => false
|
|
19
25
|
end
|
|
20
26
|
|
|
21
27
|
group :tooling do
|
|
22
|
-
gem 'guard-rspec',
|
|
28
|
+
gem 'guard-rspec', '~> 4', :require => false, :platforms => [:mri_19,
|
|
29
|
+
:mri_20,
|
|
30
|
+
:mri_21,
|
|
31
|
+
:mri_22]
|
|
23
32
|
if RUBY_PLATFORM =~ /darwin/i
|
|
24
|
-
gem 'rb-fsevent',
|
|
33
|
+
gem 'rb-fsevent', '~> 0', :require => false, :platforms => [:mri_19,
|
|
34
|
+
:mri_20,
|
|
35
|
+
:mri_21,
|
|
36
|
+
:mri_22]
|
|
25
37
|
end
|
|
26
38
|
end
|
data/Guardfile
CHANGED
|
@@ -1,19 +1,37 @@
|
|
|
1
|
-
|
|
1
|
+
require 'guard/rspec/dsl'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
debugger_gem = %w(pry-byebug pry-debugger).detect do |gem|
|
|
4
|
+
`bundle show #{gem} 2>&1 >/dev/null`
|
|
5
|
+
$?.success?
|
|
6
|
+
end
|
|
7
|
+
debugger_require = debugger_gem ? " --require #{debugger_gem}" : nil
|
|
8
|
+
|
|
9
|
+
guard :rspec, all_on_start: true,
|
|
10
|
+
all_after_pass: true,
|
|
11
|
+
cmd: "bundle exec rspec --format progress#{debugger_require}" do
|
|
12
|
+
dsl = Guard::RSpec::Dsl.new(self)
|
|
13
|
+
rspec, ruby = dsl.rspec, dsl.ruby
|
|
9
14
|
|
|
10
|
-
#
|
|
11
|
-
watch
|
|
15
|
+
# RSpec files
|
|
16
|
+
watch('.rspec') { rspec.spec_dir }
|
|
17
|
+
watch rspec.spec_helper { rspec.spec_dir }
|
|
18
|
+
watch rspec.spec_support { rspec.spec_dir }
|
|
19
|
+
watch(%r{^spec/support}) { rspec.spec_dir } # This should not be necessary.
|
|
20
|
+
watch rspec.spec_files
|
|
12
21
|
|
|
13
|
-
# Run all specs when
|
|
14
|
-
watch(
|
|
15
|
-
watch('spec/spec_helper.rb') { 'spec' }
|
|
22
|
+
# Run all specs when a shared spec changes.
|
|
23
|
+
watch(%r{^spec/.+_sharedspec\.rb$}) { rspec.spec_dir }
|
|
16
24
|
|
|
17
25
|
# Run all specs when the bundle changes.
|
|
18
|
-
watch('Gemfile.lock')
|
|
26
|
+
watch('Gemfile.lock') { rspec.spec_dir }
|
|
27
|
+
watch(%r{^(.+)\.gemspec$}) { rspec.spec_dir }
|
|
28
|
+
|
|
29
|
+
# Ruby files
|
|
30
|
+
dsl.watch_spec_files_for ruby.lib_files
|
|
31
|
+
|
|
32
|
+
# Run the corresponding spec(s) (or all specs) when code changes.
|
|
33
|
+
watch(%r{^lib/(.+)\.rb$}) do |match|
|
|
34
|
+
corresponding_specs = Dir["spec/{integration,unit}/#{match[1]}_spec.rb"]
|
|
35
|
+
corresponding_specs.empty? ? rspec.spec_dir : corresponding_specs
|
|
36
|
+
end
|
|
19
37
|
end
|
data/History.markdown
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
Version history for the _htty_ project
|
|
2
2
|
======================================
|
|
3
3
|
|
|
4
|
+
<a name="v1.5.5"></a>v1.5.5, Tue 10/20/2015
|
|
5
|
+
-------------------------------------------
|
|
6
|
+
|
|
7
|
+
* Fixed a bug that added requests to history even if no HTTP request was made \[with help from [presskey](http://github.com/presskey "presskey at GitHub")\]
|
|
8
|
+
* Fixed a bug that URL-escaped slashes in the arguments to the `path-set` command \[with help from [pepijnve](http://github.com/pepijnve "pepijnve at GitHub")\]
|
|
9
|
+
|
|
4
10
|
<a name="v1.5.4"></a>v1.5.4, Mon 10/05/2015
|
|
5
11
|
-------------------------------------------
|
|
6
12
|
|
data/README.markdown
CHANGED
|
@@ -28,12 +28,13 @@
|
|
|
28
28
|
|
|
29
29
|
[htty](http://htty.github.io) is a console application for interacting with web servers. It’s a fun way to explore web APIs and to learn the ins and outs of HTTP.
|
|
30
30
|
|
|
31
|
-
[![Travis CI build status]
|
|
32
|
-
[![
|
|
33
|
-
[![Code Climate
|
|
34
|
-
|
|
35
|
-
[![
|
|
36
|
-
[![
|
|
31
|
+
[![Travis CI build status] ][Travis-CI-build-status]
|
|
32
|
+
[![Code Climate quality report] ][Code-Climate-report]
|
|
33
|
+
[![Code Climate coverage report]][Code-Climate-report]
|
|
34
|
+
|
|
35
|
+
[![Gemnasium build status] ][Gemnasium-build-status]
|
|
36
|
+
[![Inch CI build status] ][Inch-CI-build-status]
|
|
37
|
+
[![RubyGems release] ][RubyGems-release]
|
|
37
38
|
|
|
38
39
|
See what’s changed lately by reading the [project history](http://github.com/htty/htty/blob/master/History.markdown).
|
|
39
40
|
|
|
@@ -44,7 +45,7 @@ It couldn’t be much easier.
|
|
|
44
45
|
|
|
45
46
|
$ gem install htty
|
|
46
47
|
|
|
47
|
-
You’ll need Ruby and RubyGems. It’s known to work well under OS X against Ruby v1.8.7, v1.9.2, v1.9.3, v2.0, and v2.
|
|
48
|
+
You’ll need Ruby and RubyGems. It’s known to work well under OS X against Ruby v1.8.7, v1.9.2, v1.9.3, v2.0, v2.1, and v2.2.
|
|
48
49
|
|
|
49
50
|
Features
|
|
50
51
|
========
|
|
@@ -191,6 +192,13 @@ Report defects and feature requests on [GitHub Issues](http://github.com/htty/ht
|
|
|
191
192
|
|
|
192
193
|
Your patches are welcome, and you will receive attribution here for good stuff. Fork [the official _htty_ repository](http://github.com/htty/htty "htty’s ‘htty’ repository at GitHub") and send a pull request.
|
|
193
194
|
|
|
195
|
+
Development
|
|
196
|
+
-----------
|
|
197
|
+
|
|
198
|
+
After cloning the repository, `bin/setup` to install dependencies. Then `rake` to run the tests. You can also `bin/console` to get an interactive prompt that will allow you to experiment.
|
|
199
|
+
|
|
200
|
+
To install this gem onto your local machine, `bundle exec rake install`. To release a new version, update the version number in _lib/htty/version.rb_, and then `bundle exec rake release`, which will create a Git tag for the version, push Git commits and tags, and push the _.gem_ file to [RubyGems.org](http://rubygems.org).
|
|
201
|
+
|
|
194
202
|
News and information
|
|
195
203
|
====================
|
|
196
204
|
|
|
@@ -210,11 +218,13 @@ Thanks to [contributors](http://github.com/htty/htty/contributors "htty contribu
|
|
|
210
218
|
* Rob Dawson (ephox-rob/[rojotek](http://github.com/rojotek "rojotek at GitHub"))
|
|
211
219
|
* Bo Frederiksen ([bofrede](http://github.com/bofrede "bofrede at GitHub"))
|
|
212
220
|
* Johannes Gorset ([jgorset](http://github.com/jgorset "jgorset at GitHub"))
|
|
221
|
+
* Alex Gusev ([presskey](http://github.com/presskey "presskey at GitHub"))
|
|
213
222
|
* Gabriele Lana ([gabrielelana](http://github.com/gabrielelana "gabrielelana at GitHub"))
|
|
214
223
|
* Carson McDonald ([carsonmcdonald](http://github.com/carsonmcdonald "carsonmcdonald at GitHub"))
|
|
215
224
|
* Sam Nguyen ([dtjm](http://github.com/dtjm "dtjm at GitHub"))
|
|
216
225
|
* Robert Pitts ([rbxbx](http://github.com/rbxbx "rbxbx at GitHub"))
|
|
217
226
|
* Matt Sanders ([nextmat](http://github.com/nextmat "nextmat at GitHub"))
|
|
227
|
+
* Pepijn Van Eeckhoudt ([pepijnve](http://github.com/pepijnve "pepijnve at GitHub"))
|
|
218
228
|
* [vijay-v](http://github.com/vijay-v "vijay-v at GitHub")
|
|
219
229
|
|
|
220
230
|
License
|
|
@@ -222,9 +232,15 @@ License
|
|
|
222
232
|
|
|
223
233
|
Released under the [MIT License](http://github.com/htty/htty/blob/master/License.markdown).
|
|
224
234
|
|
|
225
|
-
[Travis CI build status]:
|
|
226
|
-
[
|
|
227
|
-
[Code Climate
|
|
228
|
-
[
|
|
229
|
-
[Inch
|
|
230
|
-
[RubyGems release]:
|
|
235
|
+
[Travis CI build status]: https://secure.travis-ci.org/htty/htty.svg?branch=v1.x
|
|
236
|
+
[Code Climate quality report]: https://codeclimate.com/github/htty/htty/badges/gpa.svg
|
|
237
|
+
[Code Climate coverage report]: https://codeclimate.com/github/htty/htty/badges/coverage.svg
|
|
238
|
+
[Gemnasium build status]: https://gemnasium.com/htty/htty.svg
|
|
239
|
+
[Inch CI build status]: http://inch-ci.org/github/htty/htty.svg?branch=v1.x
|
|
240
|
+
[RubyGems release]: https://badge.fury.io/rb/htty.svg
|
|
241
|
+
|
|
242
|
+
[Travis-CI-build-status]: http://travis-ci.org/htty/htty "Travis CI build status for htty"
|
|
243
|
+
[Code-Climate-report]: http://codeclimate.com/github/htty/htty "Code Climate report for htty"
|
|
244
|
+
[Gemnasium-build-status]: http://gemnasium.com/htty/htty "Gemnasium build status for htty"
|
|
245
|
+
[Inch-CI-build-status]: http://inch-ci.org/github/htty/htty "Inch CI build status for htty"
|
|
246
|
+
[RubyGems-release]: http://rubygems.org/gems/htty "RubyGems release of htty"
|
data/Rakefile
CHANGED
|
@@ -1,68 +1,6 @@
|
|
|
1
1
|
require 'bundler/gem_tasks'
|
|
2
|
-
require '
|
|
3
|
-
|
|
4
|
-
begin
|
|
5
|
-
require 'yard'
|
|
6
|
-
rescue LoadError
|
|
7
|
-
else
|
|
8
|
-
namespace :build do
|
|
9
|
-
YARD::Rake::YardocTask.new :doc
|
|
10
|
-
end
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
namespace :lib do
|
|
14
|
-
desc "Check the source for missing 'require' statements. Set the 'VERBOSE' " +
|
|
15
|
-
'environment variable to "t[rue]" to display the name of each file as ' +
|
|
16
|
-
'it is loaded.'
|
|
17
|
-
task :find_missing_requires do
|
|
18
|
-
def verbose?
|
|
19
|
-
ENV['VERBOSE'].to_s =~ /^T/i
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
Dir.glob 'lib/**/*.rb' do |f|
|
|
23
|
-
if verbose?
|
|
24
|
-
puts "* #{f}"
|
|
25
|
-
else
|
|
26
|
-
print "\e[32m.\e[0m"
|
|
27
|
-
end
|
|
28
|
-
command = "/usr/bin/env ruby -e 'require File.expand_path(#{f.inspect})'"
|
|
29
|
-
break unless system(command)
|
|
30
|
-
end
|
|
31
|
-
puts unless verbose?
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
def define_spec_task(name, options={})
|
|
36
|
-
RSpec::Core::RakeTask.new name do |t|
|
|
37
|
-
t.rspec_opts ||= []
|
|
38
|
-
unless options[:debug] == false
|
|
39
|
-
begin
|
|
40
|
-
require 'ruby-debug'
|
|
41
|
-
rescue LoadError
|
|
42
|
-
else
|
|
43
|
-
t.rspec_opts << '--debug'
|
|
44
|
-
end
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
directory = options[:as_subdirectory] ? "spec/#{name}" : 'spec'
|
|
48
|
-
t.pattern = %W(#{directory}/*_spec.rb #{directory}/**/*_spec.rb)
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
namespace :spec do |n|
|
|
53
|
-
%w(unit integration).each do |type_of_spec|
|
|
54
|
-
desc "Run #{type_of_spec} specs"
|
|
55
|
-
define_spec_task type_of_spec, :as_subdirectory => true
|
|
56
|
-
end
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
desc 'Run all specs'
|
|
60
|
-
define_spec_task :spec
|
|
2
|
+
require File.expand_path('../lib/tasks', __FILE__)
|
|
61
3
|
|
|
62
4
|
desc 'Run all specs'
|
|
63
|
-
task ''
|
|
5
|
+
task '' => :spec
|
|
64
6
|
task :default => :spec
|
|
65
|
-
|
|
66
|
-
# Support the 'gem test' command.
|
|
67
|
-
desc ''
|
|
68
|
-
define_spec_task :test, :debug => false
|
data/bin/console
ADDED
data/bin/setup
ADDED
data/exe/htty
ADDED
data/htty.gemspec
CHANGED
|
@@ -1,36 +1,34 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
4
|
require 'htty/version'
|
|
4
5
|
|
|
5
|
-
Gem::Specification.new do |
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
s.email = ['htty@nilsjonsson.com']
|
|
11
|
-
s.homepage = 'http://htty.github.io'
|
|
12
|
-
s.summary = 'The HTTP TTY'
|
|
13
|
-
s.description = <<-end_description.gsub(/^\s+/, '').chomp
|
|
14
|
-
htty is a console application for interacting with web servers.
|
|
15
|
-
It's a fun way to explore web APIs and to learn the ins and
|
|
16
|
-
outs of HTTP.
|
|
17
|
-
end_description
|
|
18
|
-
s.license = 'MIT'
|
|
6
|
+
Gem::Specification.new do |spec|
|
|
7
|
+
spec.name = 'htty'
|
|
8
|
+
spec.version = HTTY::VERSION
|
|
9
|
+
spec.authors = ['Nils Jonsson']
|
|
10
|
+
spec.email = ['htty@nilsjonsson.com']
|
|
19
11
|
|
|
20
|
-
|
|
12
|
+
spec.summary = 'The HTTP TTY'
|
|
13
|
+
spec.description = <<-end_description.chomp.gsub(/^\s+/, '').gsub("\n", ' ')
|
|
14
|
+
htty is a console application for interacting with web
|
|
15
|
+
servers. It's a fun way to explore web APIs and to learn
|
|
16
|
+
the ins and outs of HTTP.
|
|
17
|
+
end_description
|
|
18
|
+
spec.homepage = 'http://htty.github.io'
|
|
19
|
+
spec.license = 'MIT'
|
|
21
20
|
|
|
22
|
-
|
|
21
|
+
spec.required_ruby_version = '>= 1.8.7'
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
spec.add_dependency 'mime-types', '~> 1'
|
|
24
|
+
spec.add_development_dependency 'bundler', '~> 1'
|
|
25
|
+
spec.add_development_dependency 'rake', '~> 10'
|
|
26
|
+
spec.add_development_dependency 'rspec', '~> 3.3'
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
File.basename f
|
|
34
|
-
end
|
|
35
|
-
s.require_paths = %w(lib)
|
|
28
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
29
|
+
f.match(%r{^(test|spec|features)/})
|
|
30
|
+
end
|
|
31
|
+
spec.bindir = 'exe'
|
|
32
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename f }
|
|
33
|
+
spec.require_paths = %w(lib)
|
|
36
34
|
end
|
data/lib/htty.rb
CHANGED
|
@@ -1,7 +1,32 @@
|
|
|
1
1
|
# Contains the implementation of _htty_.
|
|
2
|
-
module HTTY
|
|
2
|
+
module HTTY
|
|
3
|
+
|
|
4
|
+
autoload :CLI, 'htty/cli'
|
|
5
|
+
autoload :CookiesUtil, 'htty/cookies_util'
|
|
6
|
+
autoload :Headers, 'htty/headers'
|
|
7
|
+
autoload :NoHeaderError, 'htty/no_header_error'
|
|
8
|
+
autoload :NoLocationHeaderError, 'htty/no_location_header_error'
|
|
9
|
+
autoload :NoResponseError, 'htty/no_response_error'
|
|
10
|
+
autoload :NoSetCookieHeaderError, 'htty/no_set_cookie_header_error'
|
|
11
|
+
autoload :Payload, 'htty/payload'
|
|
12
|
+
autoload :Platform, 'htty/platform'
|
|
13
|
+
autoload :Preferences, 'htty/preferences'
|
|
14
|
+
autoload :Request, 'htty/request'
|
|
15
|
+
autoload :RequestsUtil, 'htty/requests_util'
|
|
16
|
+
autoload :Response, 'htty/response'
|
|
17
|
+
autoload :Session, 'htty/session'
|
|
18
|
+
autoload :TempfilePreservingExtname, 'htty/tempfile_preserving_extname'
|
|
19
|
+
autoload :URI, 'htty/uri'
|
|
20
|
+
autoload :VERSION, 'htty/version'
|
|
21
|
+
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
module Net
|
|
25
|
+
|
|
26
|
+
class HTTP
|
|
27
|
+
|
|
28
|
+
autoload :Patch, 'htty/http_patch'
|
|
29
|
+
|
|
30
|
+
end
|
|
3
31
|
|
|
4
|
-
Dir.glob "#{File.dirname __FILE__}/htty/*.rb" do |f|
|
|
5
|
-
require File.expand_path("#{File.dirname __FILE__}/htty/" +
|
|
6
|
-
File.basename(f, '.rb'))
|
|
7
32
|
end
|