From 5b5a303b06b5ec97ad75ced17f9a1708c16cad41 Mon Sep 17 00:00:00 2001 From: Josef Reidinger Date: Thu, 14 Dec 2023 22:01:30 +0100 Subject: [PATCH] make rubocop happy --- src/lib/y2firstboot/clients/wsl_product_selection.rb | 11 ++++++----- src/lib/y2firstboot/dialogs/wsl_product_selection.rb | 10 +++++++--- .../y2firstboot/clients/wsl_product_selection_test.rb | 6 +++--- .../y2firstboot/dialogs/wsl_product_selection_test.rb | 10 +++++----- 4 files changed, 21 insertions(+), 16 deletions(-) diff --git a/src/lib/y2firstboot/clients/wsl_product_selection.rb b/src/lib/y2firstboot/clients/wsl_product_selection.rb index b64d63e..271532d 100644 --- a/src/lib/y2firstboot/clients/wsl_product_selection.rb +++ b/src/lib/y2firstboot/clients/wsl_product_selection.rb @@ -38,15 +38,15 @@ def run return :auto if products.none? dialog = Dialogs::WSLProductSelection.new(products, - default_product: product, - wsl_gui_pattern: wsl_gui_pattern?, + default_product: product, + wsl_gui_pattern: wsl_gui_pattern?, wsl_systemd_pattern: wsl_systemd_pattern?) result = dialog.run if result == :next - save(product: dialog.product, - wsl_gui_pattern: dialog.wsl_gui_pattern, + save(product: dialog.product, + wsl_gui_pattern: dialog.wsl_gui_pattern, wsl_systemd_pattern: dialog.wsl_systemd_pattern) end @@ -137,7 +137,8 @@ def wsl_systemd_pattern=(value) # @see Registration::Storage::InstallationOptions def update_registration yaml_product = WSLConfig.instance.product - force_registration = WSLConfig.instance.product_switched? || wsl_gui_pattern? | wsl_systemd_pattern? + force_registration = WSLConfig.instance.product_switched? || + wsl_gui_pattern? || wsl_systemd_pattern? Registration::Storage::InstallationOptions.instance.yaml_product = yaml_product Registration::Storage::InstallationOptions.instance.force_registration = force_registration diff --git a/src/lib/y2firstboot/dialogs/wsl_product_selection.rb b/src/lib/y2firstboot/dialogs/wsl_product_selection.rb index ab12a78..97cdc09 100644 --- a/src/lib/y2firstboot/dialogs/wsl_product_selection.rb +++ b/src/lib/y2firstboot/dialogs/wsl_product_selection.rb @@ -49,7 +49,9 @@ class WSLProductSelection < ::UI::InstallationDialog # @param products [Array] All possible products # @param default_product [Hash] Product selected by default # @param wsl_gui_pattern [Boolean] Whether WSL GUI pattern is selected by default - def initialize(products, default_product: nil, wsl_gui_pattern: false, wsl_systemd_pattern: false) + # @param wsl_systemd_pattern [Boolean] Whether WSL systemd pattern is selected by default + def initialize(products, default_product: nil, wsl_gui_pattern: false, + wsl_systemd_pattern: false) textdomain "firstboot" super() @@ -111,10 +113,12 @@ def help_text _("

Select the product to use with Windows Subsystem for Linux (WSL). " \ "Some products might require registration.

") + # TRANSLATORS: help text (2/3) - _("

For smoother experience with graphical programs in WSL the WSL GUI pattern provides recommended config, tools and libraries. " \ + _("

For smoother experience with graphical programs in WSL " \ + "the WSL GUI pattern provides recommended config, tools and libraries. " \ "In that case the system needs to be registered as well.

") + # TRANSLATORS: help text (3/3) - _("

For enablement of systemd in WSL the WSL systemd pattern provides wsl.conf and /sbin/init adjustments. " \ + _("

For enablement of systemd in WSL the WSL systemd pattern provides wsl.conf " \ + "and /sbin/init adjustments. " \ "In that case the system needs to be registered as well.

") end diff --git a/test/y2firstboot/clients/wsl_product_selection_test.rb b/test/y2firstboot/clients/wsl_product_selection_test.rb index 3ec11c8..d7ced79 100755 --- a/test/y2firstboot/clients/wsl_product_selection_test.rb +++ b/test/y2firstboot/clients/wsl_product_selection_test.rb @@ -104,9 +104,9 @@ class InstallationOptions let(:dialog) do instance_double(Y2Firstboot::Dialogs::WSLProductSelection, - run: dialog_result, - product: selected_product, - wsl_gui_pattern: wsl_gui_pattern, + run: dialog_result, + product: selected_product, + wsl_gui_pattern: wsl_gui_pattern, wsl_systemd_pattern: wsl_systemd_pattern) end diff --git a/test/y2firstboot/dialogs/wsl_product_selection_test.rb b/test/y2firstboot/dialogs/wsl_product_selection_test.rb index a53753a..0516a57 100755 --- a/test/y2firstboot/dialogs/wsl_product_selection_test.rb +++ b/test/y2firstboot/dialogs/wsl_product_selection_test.rb @@ -43,10 +43,9 @@ def find_widget(regexp, content) subject do described_class.new(products, - default_product: default_product, - wsl_gui_pattern: wsl_gui_pattern, - wsl_systemd_pattern: wsl_systemd_pattern - ) + default_product: default_product, + wsl_gui_pattern: wsl_gui_pattern, + wsl_systemd_pattern: wsl_systemd_pattern) end let(:products) { [sles, sled] } @@ -141,7 +140,8 @@ def find_widget(regexp, content) before do allow(Yast::UI).to receive(:QueryWidget).and_call_original allow(Yast::UI).to receive(:QueryWidget).with(Id(:wsl_gui_pattern), :Value).and_return(true) - allow(Yast::UI).to receive(:QueryWidget).with(Id(:wsl_systemd_pattern), :Value).and_return(true) + allow(Yast::UI).to receive(:QueryWidget).with(Id(:wsl_systemd_pattern), :Value) + .and_return(true) allow(Yast::UI).to receive(:QueryWidget).with(Id(:product_selector), :Value) .and_return("SLES:15.4") end