From 4a11097383681110ff641a2cb44480470cde88b8 Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Tue, 6 Aug 2024 08:43:00 +0200 Subject: [PATCH 1/4] man page: Avoid generating the preamble This would look confusing in man pages. --- rakelib/doc.rake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rakelib/doc.rake b/rakelib/doc.rake index 1dbff0ee..8696d519 100644 --- a/rakelib/doc.rake +++ b/rakelib/doc.rake @@ -91,7 +91,8 @@ class Doc content = ::File.read(to_file) content.gsub!("](./", "](docs/") content.gsub!(/\A---(.|\n)*?---/, "") - ::File.write to_file, "\n#{content}" + prefix = format == "man" ? "" : "\n" + ::File.write to_file, "#{prefix}#{content}" end def export_path(dir, filename) From 2ff4a7b925d7a35922e7442ae6231907be711865 Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Tue, 6 Aug 2024 08:43:33 +0200 Subject: [PATCH 2/4] docs: Regenerate docs --- docs/gemstash-configuration.5.md | 16 ++++++++-------- docs/gemstash-private-gems.7.md | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/gemstash-configuration.5.md b/docs/gemstash-configuration.5.md index a7590023..36d4ec04 100644 --- a/docs/gemstash-configuration.5.md +++ b/docs/gemstash-configuration.5.md @@ -221,10 +221,10 @@ Boolean values `true` or `false` `:fetch_timeout` This is the number of seconds to allow for fetching a gem from upstream. -It covers establishing the connection and receiving the response. Fetching -gems over a slow connection may cause timeout errors. If you experience -timeout errors, you may want to increase this value. The default is `20` -seconds. +It covers establishing the connection and receiving the response. +Fetching gems over a slow connection may cause timeout errors. If you +experience timeout errors, you may want to increase this value. The +default is `20` seconds. ## Default value @@ -239,10 +239,10 @@ Integer value with a minimum of `1` `:open_timeout` The timeout setting for opening the connection to an upstream gem -server. On high-latency networks, even establishing the connection -to an upstream gem server can take a while. If you experience -connection failures instead of timeout errors, you may want to -increase this value. The default is `2` seconds. +server. On high-latency networks, even establishing the connection to an +upstream gem server can take a while. If you experience connection +failures instead of timeout errors, you may want to increase this value. +The default is `2` seconds. ## Default value diff --git a/docs/gemstash-private-gems.7.md b/docs/gemstash-private-gems.7.md index f68b60f1..80f687ae 100644 --- a/docs/gemstash-private-gems.7.md +++ b/docs/gemstash-private-gems.7.md @@ -5,7 +5,7 @@ Stashing private gems in your Gemstash server requires a bit of additional setup. If you haven’t read through the [Quickstart -Guide](../README.md#quickstart-guide), you should do that first. By the +Guide](../readme.md#quickstart-guide), you should do that first. By the end of this guide, you will be able to interact with your Gemstash server to store and retrieve your private gems. From 2a5e7e108a80b51e8f36c9c3bd4d585a3f7b0cc8 Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Tue, 6 Aug 2024 09:03:02 +0200 Subject: [PATCH 3/4] Revert "Enable Lint/UriEscapeUnescape" This reverts commit 7a79c769b4ab28342f32b6eae6f60678b1422ca6. --- .rubocop-bundler.yml | 4 ---- lib/gemstash/env.rb | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.rubocop-bundler.yml b/.rubocop-bundler.yml index 9ae7ace2..c5a7bd5f 100644 --- a/.rubocop-bundler.yml +++ b/.rubocop-bundler.yml @@ -15,10 +15,6 @@ Lint/AssignmentInCondition: Lint/UnusedMethodArgument: Enabled: false -Lint/UriEscapeUnescape: - Enabled: true - - # Style Layout/EndAlignment: diff --git a/lib/gemstash/env.rb b/lib/gemstash/env.rb index 2a16db4a..6feb5f9f 100644 --- a/lib/gemstash/env.rb +++ b/lib/gemstash/env.rb @@ -129,7 +129,7 @@ def db db = if RUBY_PLATFORM == "java" Sequel.connect("jdbc:sqlite:#{db_path}", config.database_connection_config) else - Sequel.connect("sqlite://#{CGI.escape(db_path)}", config.database_connection_config) + Sequel.connect("sqlite://#{URI.escape(db_path)}", config.database_connection_config) end when "postgres", "mysql", "mysql2" db_url = config[:db_url] From 14126caf5fb3355c9f89cb7932617fa7bdb1f122 Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Tue, 6 Aug 2024 09:14:57 +0200 Subject: [PATCH 4/4] SQLite connect to database not with a URL-encoded path I guess this will fail on "space in the path" paths. --- lib/gemstash/env.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/gemstash/env.rb b/lib/gemstash/env.rb index 6feb5f9f..221aa1c7 100644 --- a/lib/gemstash/env.rb +++ b/lib/gemstash/env.rb @@ -129,7 +129,7 @@ def db db = if RUBY_PLATFORM == "java" Sequel.connect("jdbc:sqlite:#{db_path}", config.database_connection_config) else - Sequel.connect("sqlite://#{URI.escape(db_path)}", config.database_connection_config) + Sequel.connect("sqlite://#{db_path}", config.database_connection_config) end when "postgres", "mysql", "mysql2" db_url = config[:db_url]