Skip to content

Commit

Permalink
update to match style with rubocop 0.29.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Mar 2, 2015
1 parent f41beef commit 34ce642
Show file tree
Hide file tree
Showing 26 changed files with 457 additions and 457 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ before_install:
# disable rvm, use system Ruby
- rvm reset
- wget https://raw.githubusercontent.com/yast/yast-devtools/master/travis-tools/travis_setup.sh
- sh ./travis_setup.sh -p "rake yast2-core yast2-devtools yast2-testsuite yast2-ruby-bindings yast2 yast2-pkg-bindings" -g "rspec:2.14.1 yast-rake gettext simplecov coveralls rubocop:0.28.0"
- sh ./travis_setup.sh -p "rake yast2-core yast2-devtools yast2-testsuite yast2-ruby-bindings yast2 yast2-pkg-bindings" -g "rspec:2.14.1 yast-rake gettext simplecov coveralls rubocop:0.29.1"
script:
- export LANG=C
- export LC_ALL=C
Expand Down
6 changes: 3 additions & 3 deletions library/commandline/src/clients/other_tools_warning.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ def main
# Translators: a warning message in a continue-cancel question
# Opscode Chef is a different way to configure the system.
message = _(
"Chef Client is running. The changes that you make\n" \
"may be overridden by Chef later.\n" \
"Continue configuration with YaST?"
"Chef Client is running. The changes that you make\n" \
"may be overridden by Chef later.\n" \
"Continue configuration with YaST?"
)
return Popup.ContinueCancel(message)
end
Expand Down
6 changes: 3 additions & 3 deletions library/commandline/src/modules/CommandLine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1599,9 +1599,9 @@ def Run(commandline)
# disable Reports, we handle them on our own
Report.Import(

"messages" => { "show" => false },
"warnings" => { "show" => false },
"errors" => { "show" => false }
"messages" => { "show" => false },
"warnings" => { "show" => false },
"errors" => { "show" => false }

)

Expand Down
2 changes: 1 addition & 1 deletion library/control/src/modules/ProductControl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1377,7 +1377,7 @@ def RunFrom(from, allow_back)
if Ops.less_than(@current_step, Ops.subtract(Builtins.size(modules), 1)) &&
!Stage.initial
if !Convert.to_boolean(
SCR.Execute(path(".target.remove"), Installation.current_step)
SCR.Execute(path(".target.remove"), Installation.current_step)
)
Builtins.y2error("Error removing step identifier")
end
Expand Down
2 changes: 1 addition & 1 deletion library/control/src/modules/WorkflowManager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1239,7 +1239,7 @@ def IntegrateWorkflow(filename)
end

if !UpdateInstFinish(
Ops.get_map(update_file, ["update", "inst_finish"], {})
Ops.get_map(update_file, ["update", "inst_finish"], {})
)
Builtins.y2error("Adding inst_finish steps failed")
return false
Expand Down
14 changes: 7 additions & 7 deletions library/cwm/src/modules/CWM.rb
Original file line number Diff line number Diff line change
Expand Up @@ -957,13 +957,13 @@ def ShowAndRunOrig(widget_names, widget_descr, contents, caption, back_button, n
fallback = deep_copy(fallback)
ShowAndRun(

"widget_names" => widget_names,
"widget_descr" => widget_descr,
"contents" => contents,
"caption" => caption,
"back_button" => back_button,
"next_button" => next_button,
"fallback_functions" => fallback
"widget_names" => widget_names,
"widget_descr" => widget_descr,
"contents" => contents,
"caption" => caption,
"back_button" => back_button,
"next_button" => next_button,
"fallback_functions" => fallback

)
end
Expand Down
18 changes: 9 additions & 9 deletions library/cwm/src/modules/CWMTsigKeys.rb
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ def Handle(widget, _key, event)
if Key2File(key2) != ""
# yes-no popup
if !Popup.YesNo(
_("The key with the specified ID exists and is used.\nRemove it?")
_("The key with the specified ID exists and is used.\nRemove it?")
)
return nil
else
Expand All @@ -392,9 +392,9 @@ def Handle(widget, _key, event)
)
# yes-no popup
if Popup.YesNo(
_(
"A key with the specified ID was found\non your disk. Remove it?"
)
_(
"A key with the specified ID was found\non your disk. Remove it?"
)
)
SCR.Execute(
path(".target.bash"),
Expand Down Expand Up @@ -459,11 +459,11 @@ def Handle(widget, _key, event)
if Ops.greater_than(Builtins.size(coliding_files), 0)
# yes-no popup
if !Popup.YesNo(
_(
"The specified file contains a TSIG key with the same\n" \
"identifier as some of already present keys.\n" \
"Old keys will be removed. Continue?"
)
_(
"The specified file contains a TSIG key with the same\n" \
"identifier as some of already present keys.\n" \
"Old keys will be removed. Continue?"
)
)
return nil
else
Expand Down
26 changes: 13 additions & 13 deletions library/cwm/src/modules/WizardHW.rb
Original file line number Diff line number Diff line change
Expand Up @@ -338,19 +338,19 @@ def RunHWDialog(settings)
# now run the dialog via CWM with handler set
CWM.ShowAndRun(

"widget_descr" => widget_descr,
"widget_names" => ["wizard_hw"],
"contents" => VBox("wizard_hw"),
"caption" => title,
"abort_button" => Ops.get_string(settings, "abort_button") do
Label.AbortButton
end,
"back_button" => Ops.get_string(settings, "back_button") do
Label.BackButton
end,
"next_button" => Ops.get_string(settings, "next_button") do
Label.NextButton
end
"widget_descr" => widget_descr,
"widget_names" => ["wizard_hw"],
"contents" => VBox("wizard_hw"),
"caption" => title,
"abort_button" => Ops.get_string(settings, "abort_button") do
Label.AbortButton
end,
"back_button" => Ops.get_string(settings, "back_button") do
Label.BackButton
end,
"next_button" => Ops.get_string(settings, "next_button") do
Label.NextButton
end

)
end
Expand Down
2 changes: 1 addition & 1 deletion library/general/src/modules/AsciiFile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def ChangeLineField(file, line, field, entry)
i = 0
while Ops.less_than(i, field)
if Builtins.size(
Ops.get_string(file.value, ["l", line, "fields", i], "")
Ops.get_string(file.value, ["l", line, "fields", i], "")
) == 0
Ops.set(file.value, ["l", line, "fields", i], "")
end
Expand Down
12 changes: 6 additions & 6 deletions library/general/src/modules/FileUtils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -300,12 +300,12 @@ def CheckAndCreatePath(pathvalue)
else
Builtins.y2milestone("Path %1 does not exist", check_path)
if Popup.YesNo(
Builtins.sformat(
# TRANSLATORS: question popup (with yes / no buttons). A user entered non-existent path
# for a share, %1 is entered path
_("The path %1 does not exist.\nCreate it now?\n"),
pathvalue
)
Builtins.sformat(
# TRANSLATORS: question popup (with yes / no buttons). A user entered non-existent path
# for a share, %1 is entered path
_("The path %1 does not exist.\nCreate it now?\n"),
pathvalue
)
)
# Directory creation successful
if Convert.to_boolean(SCR.Execute(path(".target.mkdir"), check_path))
Expand Down
14 changes: 7 additions & 7 deletions library/general/src/modules/Linuxrc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,14 @@ def SaveInstallInf(root)
if WFM.Read(path(".local.size"), inst_if_file) != -1
Builtins.y2milestone("Copying %1 to %2", inst_if_file, root)
if Convert.to_integer(
WFM.Execute(
path(".local.bash"),
Builtins.sformat(
"grep -vi '^Sourcemounted' '%1' > %2/%1; chmod 0600 %2/%1",
inst_if_file,
root
)
WFM.Execute(
path(".local.bash"),
Builtins.sformat(
"grep -vi '^Sourcemounted' '%1' > %2/%1; chmod 0600 %2/%1",
inst_if_file,
root
)
)
) != 0
Builtins.y2error(
"Cannot SaveInstallInf %1 to %2",
Expand Down
8 changes: 4 additions & 4 deletions library/log/examples/logview4.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ def main

LogView.Display(

"file" => "/var/log/messages",
"grep" => "conf",
"save" => true,
"actions" => [["Jump", fun_ref(method(:Jump), "void ()")]]
"file" => "/var/log/messages",
"grep" => "conf",
"save" => true,
"actions" => [["Jump", fun_ref(method(:Jump), "void ()")]]

)

Expand Down
76 changes: 38 additions & 38 deletions library/network/src/modules/CWMFirewallInterfaces.rb
Original file line number Diff line number Diff line change
Expand Up @@ -517,12 +517,12 @@ def InterfacesValidate(_widget, _key, _event)
if Builtins.size(ifaces) == 0
# question popup
if !Popup.YesNo(
_(
"No interface is selected. Service will not\n" \
"be available for other computers.\n" \
"\n" \
"Continue?"
)
_(
"No interface is selected. Service will not\n" \
"be available for other computers.\n" \
"\n" \
"Continue?"
)
)
return false
end
Expand All @@ -545,17 +545,17 @@ def InterfacesValidate(_widget, _key, _event)
if Ops.greater_than(Builtins.size(added_ifaces), 0)
ifaces_list = Builtins.mergestring(added_ifaces, "\n")
if !Popup.YesNo(
Builtins.sformat(
# yes-no popup
_(
"Because of SuSE Firewall settings, the port\n" \
"on the following interfaces will additionally be open:\n" \
"%1\n" \
"\n" \
"Continue?"
),
ifaces_list
)
Builtins.sformat(
# yes-no popup
_(
"Because of SuSE Firewall settings, the port\n" \
"on the following interfaces will additionally be open:\n" \
"%1\n" \
"\n" \
"Continue?"
),
ifaces_list
)
)
return false
end
Expand All @@ -564,17 +564,17 @@ def InterfacesValidate(_widget, _key, _event)
if Ops.greater_than(Builtins.size(removed_ifaces), 0)
ifaces_list = Builtins.mergestring(removed_ifaces, "\n")
if !Popup.YesNo(
Builtins.sformat(
# yes-no popup
_(
"Because of SuSE Firewall settings, the port\n" \
"on the following interfaces cannot be opened:\n" \
"%1\n" \
"\n" \
"Continue?"
),
ifaces_list
)
Builtins.sformat(
# yes-no popup
_(
"Because of SuSE Firewall settings, the port\n" \
"on the following interfaces cannot be opened:\n" \
"%1\n" \
"\n" \
"Continue?"
),
ifaces_list
)
)
return false
end
Expand Down Expand Up @@ -619,16 +619,16 @@ def CheckPossbilityToChangeFirewall(new_status)
ifaces_list = Builtins.mergestring(@buggy_ifaces, "\n")
# yes-no popup
if Popup.YesNo(
Builtins.sformat(
_(
"Because of SuSE Firewall settings, the port\n" \
"on the following interfaces cannot be opened:\n" \
"%1\n" \
"\n" \
"Continue?"
),
ifaces_list
)
Builtins.sformat(
_(
"Because of SuSE Firewall settings, the port\n" \
"on the following interfaces cannot be opened:\n" \
"%1\n" \
"\n" \
"Continue?"
),
ifaces_list
)
)
# all known ifaces are buggy
if Builtins.size(@buggy_ifaces) == Builtins.size(all_ifaces)
Expand Down
4 changes: 2 additions & 2 deletions library/network/test/susefirewall_services_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def setup_data_dir
describe "#service_details" do
it "returns non-empty service definition" do
allow(Yast::SuSEFirewallServices).to receive(:all_services).and_return(
"service:dns-server" => Yast::SuSEFirewallServicesClass::DEFAULT_SERVICE.merge("tcp_ports" => ["a", "b"]),
"service:dhcp-server" => Yast::SuSEFirewallServicesClass::DEFAULT_SERVICE.merge("udp_ports" => ["x", "y"])
"service:dns-server" => Yast::SuSEFirewallServicesClass::DEFAULT_SERVICE.merge("tcp_ports" => ["a", "b"]),
"service:dhcp-server" => Yast::SuSEFirewallServicesClass::DEFAULT_SERVICE.merge("udp_ports" => ["x", "y"])
)
expect(Yast::SuSEFirewallServices.service_details("service:dns-server")).not_to be_nil
expect(Yast::SuSEFirewallServices.service_details("service:dns-server")["tcp_ports"]).to eq(["a", "b"])
Expand Down
2 changes: 1 addition & 1 deletion library/network/testsuite/tests/SuSEFirewall.rb
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ def main
], nil)
TEST(lambda do
SuSEFirewall.SetBroadcastAllowedPorts(
"INT" => [], "DMZ" => ["5", "3", "1"], "EXT" => ["22", "33", "44"]
"INT" => [], "DMZ" => ["5", "3", "1"], "EXT" => ["22", "33", "44"]
)
end, [
@READ,
Expand Down
Loading

0 comments on commit 34ce642

Please sign in to comment.