aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Étienne Deparis 2020-12-30 08:50:24 +0100
committerGravatar Étienne Deparis 2020-12-30 08:50:24 +0100
commit3f979b2a84fc437db275e33c03a0e16e1fc021a9 (patch)
treee07b3a0cb7e2e1db6180832a7a3c9d7ff9c42040
parent16c13206b49b0a6869686628dd55a20f5656da9d (diff)
parentfbb0b5dbfa39b0a1da5b207a863fa18f68efef35 (diff)
downloadruby-net-text-3f979b2a84fc437db275e33c03a0e16e1fc021a9.tar.gz
ruby-net-text-3f979b2a84fc437db275e33c03a0e16e1fc021a9.tar.xz
ruby-net-text-3f979b2a84fc437db275e33c03a0e16e1fc021a9.zip
Merge branch 'v0.0.4-dev'v0.0.4
-rwxr-xr-xbin/test_thread.rb15
-rw-r--r--lib/net/gemini/request.rb2
-rw-r--r--ruby-net-text.gemspec2
3 files changed, 17 insertions, 2 deletions
diff --git a/bin/test_thread.rb b/bin/test_thread.rb
new file mode 100755
index 0000000..423a6b3
--- /dev/null
+++ b/bin/test_thread.rb
@@ -0,0 +1,15 @@
+#!/usr/bin/env -S ruby -I lib -w
+# frozen_string_literal: true
+
+require 'net/gemini'
+
+all_threads = []
+
+100.times do
+ all_threads << Thread.new(ARGV[0]) do |arg|
+ response = Net::Gemini.get_response URI(arg)
+ puts "#{response.status} - #{response.meta}"
+ end
+end
+
+sleep 0.5 while Thread.list.length > 1
diff --git a/lib/net/gemini/request.rb b/lib/net/gemini/request.rb
index 4706d06..ce057f8 100644
--- a/lib/net/gemini/request.rb
+++ b/lib/net/gemini/request.rb
@@ -42,7 +42,7 @@ module Net
# - 2 bytes for <CR><LF>
str = sock.gets($INPUT_RECORD_SEPARATOR, 1026)
m = /\A(.*)\r\n\z/.match(str)
- raise GeminiBadRequest, "Malformed request: #{str.dump}" if m.nil?
+ raise GeminiBadRequest, "Malformed request: #{str&.dump}" if m.nil?
new(m[1])
end
end
diff --git a/ruby-net-text.gemspec b/ruby-net-text.gemspec
index 76a2d03..80ac6f3 100644
--- a/ruby-net-text.gemspec
+++ b/ruby-net-text.gemspec
@@ -2,7 +2,7 @@
Gem::Specification.new do |s|
s.name = 'ruby-net-text'
- s.version = '0.0.3'
+ s.version = '0.0.4'
s.summary = 'Gemini, Gopher, and Finger support for Net::* and URI::*'
s.authors = ['Étienne Deparis']
s.email = 'etienne@depar.is'