From ea4ee1632e6c39923d314f37fdb3d4c9089394ec Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Tue, 21 Jul 2026 13:05:41 +0100 Subject: [PATCH] README.md: Update server/client code This commit fixes the server/client code example on README.md fixing the following rubocop issues. * C: [Correctable] Layout/SpaceAroundOperators: Surrounding space missing for operator =. * C: [Correctable] Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. * C: [Correctable] Layout/EmptyLinesAroundClassBody: Extra empty line detected at class body beginning. * C: [Correctable] Layout/EmptyLinesAroundClassBody: Extra empty line detected at class body end. * C: Naming/AccessorMethodName: Do not prefix reader method names with get_. --- README.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 04cd71c..7ca0ecd 100644 --- a/README.md +++ b/README.md @@ -37,18 +37,16 @@ starting the server code first. require 'drb/drb' # The URI for the server to connect to -URI="druby://localhost:8787" +URI = 'druby://localhost:8787' class TimeServer - - def get_current_time - return Time.now + def current_time + Time.now end - end # The object that handles requests on the server -FRONT_OBJECT=TimeServer.new +FRONT_OBJECT = TimeServer.new DRb.start_service(URI, FRONT_OBJECT) # Wait for the drb server thread to finish before exiting. @@ -61,7 +59,7 @@ DRb.thread.join require 'drb/drb' # The URI to connect to -SERVER_URI="druby://localhost:8787" +SERVER_URI = 'druby://localhost:8787' # Start a local DRbServer to handle callbacks. @@ -74,7 +72,7 @@ SERVER_URI="druby://localhost:8787" DRb.start_service timeserver = DRbObject.new_with_uri(SERVER_URI) -puts timeserver.get_current_time +puts timeserver.current_time ``` #### Security