htty 1.5.4 → 1.5.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (209) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +12 -9
  3. data/.rspec +2 -1
  4. data/.travis.yml +11 -8
  5. data/.yardopts +1 -1
  6. data/Gemfile +22 -10
  7. data/Guardfile +31 -13
  8. data/History.markdown +6 -0
  9. data/README.markdown +29 -13
  10. data/Rakefile +2 -64
  11. data/bin/console +10 -0
  12. data/bin/setup +8 -0
  13. data/exe/htty +5 -0
  14. data/htty.gemspec +27 -29
  15. data/lib/htty.rb +29 -4
  16. data/lib/htty/cli.rb +9 -16
  17. data/lib/htty/cli/body_open_command.rb +2 -7
  18. data/lib/htty/cli/command.rb +10 -18
  19. data/lib/htty/cli/commands.rb +76 -11
  20. data/lib/htty/cli/commands/address.rb +1 -14
  21. data/lib/htty/cli/commands/body_clear.rb +1 -8
  22. data/lib/htty/cli/commands/body_edit.rb +1 -11
  23. data/lib/htty/cli/commands/body_request.rb +1 -12
  24. data/lib/htty/cli/commands/body_request_open.rb +1 -10
  25. data/lib/htty/cli/commands/body_response.rb +1 -12
  26. data/lib/htty/cli/commands/body_response_open.rb +1 -11
  27. data/lib/htty/cli/commands/body_set.rb +1 -10
  28. data/lib/htty/cli/commands/body_unset.rb +1 -9
  29. data/lib/htty/cli/commands/cd.rb +1 -8
  30. data/lib/htty/cli/commands/cookie_add.rb +1 -8
  31. data/lib/htty/cli/commands/cookie_remove.rb +1 -8
  32. data/lib/htty/cli/commands/cookies.rb +1 -15
  33. data/lib/htty/cli/commands/cookies_add.rb +1 -11
  34. data/lib/htty/cli/commands/cookies_clear.rb +1 -8
  35. data/lib/htty/cli/commands/cookies_remove.rb +1 -11
  36. data/lib/htty/cli/commands/cookies_remove_all.rb +1 -11
  37. data/lib/htty/cli/commands/cookies_use.rb +1 -14
  38. data/lib/htty/cli/commands/delete.rb +1 -8
  39. data/lib/htty/cli/commands/exit.rb +1 -8
  40. data/lib/htty/cli/commands/follow.rb +1 -10
  41. data/lib/htty/cli/commands/form.rb +1 -7
  42. data/lib/htty/cli/commands/form_add.rb +1 -7
  43. data/lib/htty/cli/commands/form_clear.rb +1 -8
  44. data/lib/htty/cli/commands/form_remove.rb +1 -7
  45. data/lib/htty/cli/commands/form_remove_all.rb +1 -7
  46. data/lib/htty/cli/commands/fragment_clear.rb +1 -8
  47. data/lib/htty/cli/commands/fragment_set.rb +1 -10
  48. data/lib/htty/cli/commands/fragment_unset.rb +1 -9
  49. data/lib/htty/cli/commands/get.rb +1 -8
  50. data/lib/htty/cli/commands/header_set.rb +1 -8
  51. data/lib/htty/cli/commands/header_unset.rb +1 -8
  52. data/lib/htty/cli/commands/headers_clear.rb +1 -8
  53. data/lib/htty/cli/commands/headers_request.rb +1 -15
  54. data/lib/htty/cli/commands/headers_response.rb +1 -15
  55. data/lib/htty/cli/commands/headers_set.rb +1 -10
  56. data/lib/htty/cli/commands/headers_unset.rb +1 -10
  57. data/lib/htty/cli/commands/headers_unset_all.rb +1 -10
  58. data/lib/htty/cli/commands/help.rb +4 -12
  59. data/lib/htty/cli/commands/history.rb +1 -10
  60. data/lib/htty/cli/commands/history_verbose.rb +1 -12
  61. data/lib/htty/cli/commands/host_set.rb +1 -8
  62. data/lib/htty/cli/commands/http_delete.rb +1 -12
  63. data/lib/htty/cli/commands/http_get.rb +1 -13
  64. data/lib/htty/cli/commands/http_head.rb +1 -9
  65. data/lib/htty/cli/commands/http_options.rb +1 -9
  66. data/lib/htty/cli/commands/http_patch.rb +1 -13
  67. data/lib/htty/cli/commands/http_post.rb +1 -13
  68. data/lib/htty/cli/commands/http_put.rb +1 -12
  69. data/lib/htty/cli/commands/http_trace.rb +1 -9
  70. data/lib/htty/cli/commands/patch.rb +1 -8
  71. data/lib/htty/cli/commands/path_set.rb +11 -11
  72. data/lib/htty/cli/commands/port_set.rb +1 -9
  73. data/lib/htty/cli/commands/post.rb +1 -8
  74. data/lib/htty/cli/commands/put.rb +1 -8
  75. data/lib/htty/cli/commands/query_add.rb +1 -13
  76. data/lib/htty/cli/commands/query_clear.rb +1 -8
  77. data/lib/htty/cli/commands/query_remove.rb +1 -13
  78. data/lib/htty/cli/commands/query_set.rb +1 -13
  79. data/lib/htty/cli/commands/query_unset.rb +1 -13
  80. data/lib/htty/cli/commands/query_unset_all.rb +1 -10
  81. data/lib/htty/cli/commands/quit.rb +1 -7
  82. data/lib/htty/cli/commands/reuse.rb +5 -12
  83. data/lib/htty/cli/commands/scheme_set.rb +1 -9
  84. data/lib/htty/cli/commands/ssl_verification.rb +1 -11
  85. data/lib/htty/cli/commands/ssl_verification_off.rb +1 -10
  86. data/lib/htty/cli/commands/ssl_verification_on.rb +1 -10
  87. data/lib/htty/cli/commands/status.rb +1 -11
  88. data/lib/htty/cli/commands/undo.rb +1 -7
  89. data/lib/htty/cli/commands/userinfo_clear.rb +1 -8
  90. data/lib/htty/cli/commands/userinfo_set.rb +1 -11
  91. data/lib/htty/cli/commands/userinfo_unset.rb +1 -9
  92. data/lib/htty/cli/display.rb +4 -6
  93. data/lib/htty/cli/http_method_command.rb +1 -10
  94. data/lib/htty/cli/input_device.rb +1 -0
  95. data/lib/htty/cli/url_escaping.rb +1 -6
  96. data/lib/htty/cookies_util.rb +3 -3
  97. data/lib/htty/headers.rb +3 -4
  98. data/lib/htty/http_patch.rb +20 -23
  99. data/lib/htty/no_header_error.rb +1 -1
  100. data/lib/htty/no_location_header_error.rb +1 -3
  101. data/lib/htty/no_response_error.rb +1 -1
  102. data/lib/htty/no_set_cookie_header_error.rb +1 -3
  103. data/lib/htty/payload.rb +1 -5
  104. data/lib/htty/platform.rb +1 -1
  105. data/lib/htty/preferences.rb +1 -1
  106. data/lib/htty/request.rb +3 -13
  107. data/lib/htty/requests_util.rb +1 -5
  108. data/lib/htty/response.rb +1 -4
  109. data/lib/htty/session.rb +1 -3
  110. data/lib/htty/tempfile_preserving_extname.rb +1 -2
  111. data/lib/htty/uri.rb +1 -2
  112. data/lib/htty/version.rb +1 -1
  113. data/lib/tasks.rb +3 -0
  114. data/lib/tasks/build_doc.rake +8 -0
  115. data/lib/tasks/lib_each.rake +25 -0
  116. data/lib/tasks/spec.rake +68 -0
  117. data/lib/tasks/spec_each.rake +19 -0
  118. metadata +48 -209
  119. data/bin/htty +0 -5
  120. data/spec/integration/htty/cli/commands/query_add_spec.rb +0 -57
  121. data/spec/integration/htty/cli/commands/query_remove_spec.rb +0 -55
  122. data/spec/integration/htty/cli/commands/query_set_spec.rb +0 -78
  123. data/spec/integration/htty/cli/commands/query_unset_spec.rb +0 -43
  124. data/spec/spec_helper.rb +0 -76
  125. data/spec/unit/htty/cli/commands/address_spec.rb +0 -103
  126. data/spec/unit/htty/cli/commands/body_clear_spec.rb +0 -64
  127. data/spec/unit/htty/cli/commands/body_edit_spec.rb +0 -18
  128. data/spec/unit/htty/cli/commands/body_request_spec.rb +0 -67
  129. data/spec/unit/htty/cli/commands/body_response_spec.rb +0 -72
  130. data/spec/unit/htty/cli/commands/body_set_spec.rb +0 -71
  131. data/spec/unit/htty/cli/commands/body_unset_spec.rb +0 -69
  132. data/spec/unit/htty/cli/commands/cd_spec.rb +0 -57
  133. data/spec/unit/htty/cli/commands/cookie_add_spec.rb +0 -64
  134. data/spec/unit/htty/cli/commands/cookie_remove_spec.rb +0 -64
  135. data/spec/unit/htty/cli/commands/cookies_add_spec.rb +0 -78
  136. data/spec/unit/htty/cli/commands/cookies_clear_spec.rb +0 -64
  137. data/spec/unit/htty/cli/commands/cookies_remove_all_spec.rb +0 -73
  138. data/spec/unit/htty/cli/commands/cookies_remove_spec.rb +0 -69
  139. data/spec/unit/htty/cli/commands/cookies_spec.rb +0 -76
  140. data/spec/unit/htty/cli/commands/cookies_use_spec.rb +0 -75
  141. data/spec/unit/htty/cli/commands/delete_spec.rb +0 -64
  142. data/spec/unit/htty/cli/commands/exit_spec.rb +0 -64
  143. data/spec/unit/htty/cli/commands/follow_spec.rb +0 -70
  144. data/spec/unit/htty/cli/commands/form_add_spec.rb +0 -64
  145. data/spec/unit/htty/cli/commands/form_clear_spec.rb +0 -64
  146. data/spec/unit/htty/cli/commands/form_remove_all_spec.rb +0 -66
  147. data/spec/unit/htty/cli/commands/form_remove_spec.rb +0 -57
  148. data/spec/unit/htty/cli/commands/form_spec.rb +0 -57
  149. data/spec/unit/htty/cli/commands/fragment_clear_spec.rb +0 -64
  150. data/spec/unit/htty/cli/commands/fragment_set_spec.rb +0 -73
  151. data/spec/unit/htty/cli/commands/fragment_unset_spec.rb +0 -72
  152. data/spec/unit/htty/cli/commands/get_spec.rb +0 -64
  153. data/spec/unit/htty/cli/commands/header_set_spec.rb +0 -64
  154. data/spec/unit/htty/cli/commands/header_unset_spec.rb +0 -64
  155. data/spec/unit/htty/cli/commands/headers_clear_spec.rb +0 -64
  156. data/spec/unit/htty/cli/commands/headers_request_spec.rb +0 -81
  157. data/spec/unit/htty/cli/commands/headers_response_spec.rb +0 -77
  158. data/spec/unit/htty/cli/commands/headers_set_spec.rb +0 -74
  159. data/spec/unit/htty/cli/commands/headers_unset_all_spec.rb +0 -71
  160. data/spec/unit/htty/cli/commands/headers_unset_spec.rb +0 -63
  161. data/spec/unit/htty/cli/commands/help_spec.rb +0 -67
  162. data/spec/unit/htty/cli/commands/history_spec.rb +0 -65
  163. data/spec/unit/htty/cli/commands/history_verbose_spec.rb +0 -72
  164. data/spec/unit/htty/cli/commands/host_set_spec.rb +0 -71
  165. data/spec/unit/htty/cli/commands/http_delete_spec.rb +0 -75
  166. data/spec/unit/htty/cli/commands/http_get_spec.rb +0 -77
  167. data/spec/unit/htty/cli/commands/http_head_spec.rb +0 -69
  168. data/spec/unit/htty/cli/commands/http_options_spec.rb +0 -69
  169. data/spec/unit/htty/cli/commands/http_patch_spec.rb +0 -73
  170. data/spec/unit/htty/cli/commands/http_post_spec.rb +0 -73
  171. data/spec/unit/htty/cli/commands/http_put_spec.rb +0 -71
  172. data/spec/unit/htty/cli/commands/http_trace_spec.rb +0 -69
  173. data/spec/unit/htty/cli/commands/patch_spec.rb +0 -64
  174. data/spec/unit/htty/cli/commands/path_set_spec.rb +0 -72
  175. data/spec/unit/htty/cli/commands/port_set_spec.rb +0 -73
  176. data/spec/unit/htty/cli/commands/post_spec.rb +0 -64
  177. data/spec/unit/htty/cli/commands/put_spec.rb +0 -64
  178. data/spec/unit/htty/cli/commands/query_add_spec.rb +0 -82
  179. data/spec/unit/htty/cli/commands/query_clear_spec.rb +0 -64
  180. data/spec/unit/htty/cli/commands/query_remove_spec.rb +0 -82
  181. data/spec/unit/htty/cli/commands/query_set_spec.rb +0 -82
  182. data/spec/unit/htty/cli/commands/query_unset_all_spec.rb +0 -74
  183. data/spec/unit/htty/cli/commands/query_unset_spec.rb +0 -75
  184. data/spec/unit/htty/cli/commands/quit_spec.rb +0 -64
  185. data/spec/unit/htty/cli/commands/reuse_spec.rb +0 -72
  186. data/spec/unit/htty/cli/commands/scheme_set_spec.rb +0 -74
  187. data/spec/unit/htty/cli/commands/shared_examples_for_commands.rb +0 -55
  188. data/spec/unit/htty/cli/commands/ssl_verification_off_spec.rb +0 -67
  189. data/spec/unit/htty/cli/commands/ssl_verification_on_spec.rb +0 -60
  190. data/spec/unit/htty/cli/commands/ssl_verification_spec.rb +0 -65
  191. data/spec/unit/htty/cli/commands/status_spec.rb +0 -73
  192. data/spec/unit/htty/cli/commands/undo_spec.rb +0 -57
  193. data/spec/unit/htty/cli/commands/userinfo_clear_spec.rb +0 -64
  194. data/spec/unit/htty/cli/commands/userinfo_set_spec.rb +0 -97
  195. data/spec/unit/htty/cli/commands/userinfo_unset_spec.rb +0 -72
  196. data/spec/unit/htty/cli/display_spec.rb +0 -84
  197. data/spec/unit/htty/cli_spec.rb +0 -28
  198. data/spec/unit/htty/command.rb +0 -47
  199. data/spec/unit/htty/headers_spec.rb +0 -40
  200. data/spec/unit/htty/payload_spec.rb +0 -60
  201. data/spec/unit/htty/preferences_spec.rb +0 -8
  202. data/spec/unit/htty/request_follow_spec.rb +0 -94
  203. data/spec/unit/htty/request_spec.rb +0 -1232
  204. data/spec/unit/htty/request_userinfo_spec.rb +0 -208
  205. data/spec/unit/htty/response_spec.rb +0 -0
  206. data/spec/unit/htty/session_spec.rb +0 -10
  207. data/spec/unit/htty/shared_examples_for_requests.rb +0 -32
  208. data/spec/unit/htty/url_escaping.rb +0 -70
  209. data/spec/unit/htty/version_spec.rb +0 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 72482928586c8a1e943e97fdea7c9fed28069268
4
- data.tar.gz: e3a3ada8025df116dfc0ee95be9f98881369e6d4
3
+ metadata.gz: cfa89b632f037b19e446cf0d93caacfda4c4ee06
4
+ data.tar.gz: 91f979a8b2919e9a03875a9d0320bed63b6c6872
5
5
  SHA512:
6
- metadata.gz: 2b512a16609f816c097b96f5802f07c33099f291c951f10c219859aa0e21e01bc06db155f4b43968594e821fe8d6665f03208656a0191bfff6c9c5040900b716
7
- data.tar.gz: e20fad8c963b253c8a2961b9993424106870344410e055a9141e8316c11c4103e1a689e63950d69e24da76925f9f38714d7bd001fe0152fd95800385a60ce1b1
6
+ metadata.gz: 8eefb6673967dc17ca3748a6a2ae5862b81f13c89140c6e25c91714acb11d8cba2ab64931b2e36d7616363016bda7f24aaf76531dbbdbc7ad6e7c8893afc59d8
7
+ data.tar.gz: 6c7938e36f4f238b6e9e392b1e4977c88712d3d945a0f4c87ec774234e9a77476442dd7fe9f1b00e5aea43790a7a9a2dec9755de181569731389dfb1ab5e2fd1
data/.gitignore CHANGED
@@ -1,9 +1,12 @@
1
- .bundle/
2
- .rbx
3
- .ruby-gemset
4
- .ruby-version
5
- .yardoc/
6
- *.gem
7
- Gemfile.lock
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
@@ -1,2 +1,3 @@
1
1
  --color
2
- --format progress
2
+ --format documentation
3
+ --require spec_helper
@@ -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.0
8
- - 2.1.0
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-18mode
15
- - rbx-19mode
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-18mode
27
- - rvm: rbx-19mode
28
- - rvm: rbx-head
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 'http://rubygems.org'
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 'ruby-debug', '~> 0', :platforms => :mri_18
9
- gem 'ruby-debug19', '~> 0', :platforms => :mri_19, :require => 'ruby-debug'
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
- gem 'codeclimate-test-reporter', '~> 0', :platforms => :mri_20, :require => false
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', '~> 0', :platforms => [:ruby, :mswin, :mingw]
18
- gem 'rdiscount', :platforms => [:ruby, :mswin, :mingw]
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', '~> 3'
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', '~> 0', :require => false
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
- interactor :off
1
+ require 'guard/rspec/dsl'
2
2
 
3
- guard :rspec, :cli => '--debug' do
4
- # Run the corresponding spec(s) (or all specs) when code changes.
5
- watch(%r{^lib/(.+)\.rb$}) do |match|
6
- corresponding_specs = Dir["spec/{integration,unit}/#{match[1]}_spec.rb"]
7
- corresponding_specs.empty? ? 'spec' : corresponding_specs
8
- end
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
- # Run a spec when it changes.
11
- watch %r{^spec/.+_spec\.rb$}
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 the RSpec configuration changes.
14
- watch('.rspec' ) { 'spec' }
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') { 'spec' }
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
@@ -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
 
@@ -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] ](http://travis-ci.org/htty/htty "Travis CI build")
32
- [![Gemnasium dependencies status] ](http://gemnasium.com/htty/htty "Gemnasium dependencies analysis")
33
- [![Code Climate code quality] ](http://codeclimate.com/github/htty/htty "Code Climate analysis")
34
- [![Code Climate test coverage] ](http://codeclimate.com/github/htty/htty "Code Climate analysis")
35
- [![Inch inline documentation coverage]](http://inch-ci.org/github/htty/htty "Inch inline documentation analysis")
36
- [![RubyGems release] ](http://rubygems.org/gems/htty "RubyGems release")
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.1.
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]: https://secure.travis-ci.org/htty/htty.png?branch=master
226
- [Gemnasium dependencies status]: https://gemnasium.com/htty/htty.png
227
- [Code Climate code quality]: https://codeclimate.com/github/htty/htty.png
228
- [Code Climate test coverage]: https://codeclimate.com/github/htty/htty/coverage.png
229
- [Inch inline documentation coverage]: http://inch-ci.org/github/htty/htty.png
230
- [RubyGems release]: https://badge.fury.io/rb/htty.png
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 'rspec/core/rake_task'
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 '' => :spec
5
+ task '' => :spec
64
6
  task :default => :spec
65
-
66
- # Support the 'gem test' command.
67
- desc ''
68
- define_spec_task :test, :debug => false
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/setup'
4
+ require 'htty'
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ require 'pry'
10
+ Pry.start
@@ -0,0 +1,8 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ which bundle || gem install bundler
6
+ bundle
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'htty'
4
+
5
+ HTTY::CLI.new(ARGV).run!
@@ -1,36 +1,34 @@
1
- # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path('../lib', __FILE__)
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 |s|
6
- s.name = 'htty'
7
- s.version = HTTY::VERSION
8
- s.platform = Gem::Platform::RUBY
9
- s.authors = ['Nils Jonsson']
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
- s.required_ruby_version = '>= 1.8.7'
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
- s.add_dependency 'mime-types', '~> 1'
21
+ spec.required_ruby_version = '>= 1.8.7'
23
22
 
24
- s.add_development_dependency 'rake'
25
- s.add_development_dependency 'rspec', '~> 2'
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
- s.rubyforge_project = 'htty'
28
- s.has_rdoc = true
29
-
30
- s.files = `git ls-files`.split("\n")
31
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
32
- s.executables = `git ls-files -- bin/*`.split("\n").map do |f|
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
@@ -1,7 +1,32 @@
1
1
  # Contains the implementation of _htty_.
2
- module HTTY; end
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