Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/SLE-12-GA' into merge_SLE12
Browse files Browse the repository at this point in the history
Conflicts:
	.travis.yml
	Rakefile
	library/general/src/modules/Arch.rb
	library/general/test/agents_test/proc_meminfo_agent_test.rb
	library/general/test/test_helper.rb
	library/system/src/clients/view_anymsg.rb
	library/types/src/modules/IP.rb
	library/types/test/ip_test.rb
	package/yast2.changes
  • Loading branch information
jreidinger committed Jan 16, 2015
2 parents 8fdb036 + 0b029d7 commit 16a6eff
Show file tree
Hide file tree
Showing 245 changed files with 6,433 additions and 6,851 deletions.
89 changes: 89 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# use the shared Yast defaults
inherit_from:
/usr/share/YaST2/data/devtools/data/rubocop_yast_style.yml

# Offense count: 493
Metrics/AbcSize:
Max: 446

# Offense count: 51
Metrics/BlockNesting:
Max: 6

# Offense count: 84
# Configuration parameters: CountComments.
Metrics/ClassLength:
Max: 2880

# Offense count: 184
Metrics/CyclomaticComplexity:
Max: 63

# Offense count: 1820
# Configuration parameters: AllowURI, URISchemes.
Metrics/LineLength:
Max: 274

# Offense count: 824
# Configuration parameters: CountComments.
Metrics/MethodLength:
Max: 931

# Offense count: 20
# Configuration parameters: CountKeywordArgs.
Metrics/ParameterLists:
Max: 11

# Offense count: 179
Metrics/PerceivedComplexity:
Max: 76

# Configuration parameters: EnforcedStyle, SupportedStyles.
# JR: I personally think that having this variable on class level is much more readable
# and easier to recognize that access visibility changed
Style/AccessModifierIndentation:
EnforcedStyle: outdent

Style/AccessorMethodName:
# keep backward compatibility, but do not allow new code to be non-ruby style
Exclude:
- library/systemd/src/modules/systemd_target.rb

# Keep non-ascii comments as it contains e.g. examples for Punycode
Style/AsciiComments:
Enabled: false

# UI_ID module is not camel case
Style/ClassAndModuleCamelCase:
Enabled: false

# ensure new code is properly documented
Style/Documentation:
Include:
- "library/*/src/lib/**/*.rb"

# keep double negation as conversion to boolean
Style/DoubleNegation:
Enabled: false

Style/FileName:
Include:
- "library/*/src/lib/**/*.rb"

Style/MethodName:
Include:
- "library/*/src/lib/**/*.rb"

# keep it as it is part of API for old code
Style/PredicateName:
Include:
- "library/*/src/lib/**/*.rb"

# for old code keep it as often methods names are wrong and part of API
Style/TrivialAccessors:
Include:
- "library/*/src/lib/**/*.rb"

Style/VariableName:
Include:
- "library/*/src/lib/**/*.rb"
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ 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"
- 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 rubocop:0.28.0"
script:
- rake check:syntax
- rake check:pot
- rubocop
- make -f Makefile.cvs
- make
- sudo make install
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require "yast/rake"

Yast::Tasks.configuration do |conf|
#lets ignore license check for now
# lets ignore license check for now
conf.skip_license_check << /.*/
end
14 changes: 8 additions & 6 deletions doc/examples/ask_resize_windows_partition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ class AskResizeWindowsPartitionClient < Client
def main
Yast.import "Popup"

@long_text = "Resizing the windows partition works well in most cases,\n" +
"but there are pathological cases where this might fail.\n" + "\n" +
"You might lose all data on that disk. So please make sure\n" +
"you have an up-to-date backup of all relevant data\n" +
"for disaster recovery.\n" + "\n" +
"If you are unsure, it might be a good idea to abort the installation\n" +
@long_text = "Resizing the windows partition works well in most cases,\n" \
"but there are pathological cases where this might fail.\n" \
"\n" \
"You might lose all data on that disk. So please make sure\n" \
"you have an up-to-date backup of all relevant data\n" \
"for disaster recovery.\n" \
"\n" \
"If you are unsure, it might be a good idea to abort the installation\n" \
"right now and make a backup."

@answer = Popup.YesNoHeadline("Resize Windows Partition?", @long_text)
Expand Down
36 changes: 18 additions & 18 deletions doc/examples/popups1.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ def main
Yast.import "Label"
Yast.import "Popup"


UI.OpenDialog(
VBox(
PushButton(Id(:msg), Opt(:hstretch), "&Message Popup"),
Expand Down Expand Up @@ -66,44 +65,45 @@ def main
)
)


@button_id = :dummy
@ok = false
begin
loop do
@button_id = Convert.to_symbol(UI.UserInput)

if @button_id == :msg
case @button_id
when :msg
Popup.Message("Hello, world!")
elsif @button_id == :notify
when :notify
Popup.Notify("Notify the world!")
elsif @button_id == :warn
when :warn
Popup.Warning("This is the only world we have!")
elsif @button_id == :err
when :err
Popup.Error("Cannot delete world -\nthis is the only world we have!")
elsif @button_id == :timed_msg
when :timed_msg
Popup.TimedMessage("Just some seconds left to save the world...", 20)
elsif @button_id == :timed_warn
when :timed_warn
Popup.TimedWarning("Time is running out to save the world...", 20)
elsif @button_id == :timed_err
when :timed_err
Popup.TimedError("This world will be deleted...", 20)
elsif @button_id == :yesNo
when :yesNo
@ok = Popup.YesNo("Really delete world?")
elsif @button_id == :contCancel
when :contCancel
@ok = Popup.ContinueCancel("World will be deleted.")
elsif @button_id == :abort
when :abort
@ok = Popup.ReallyAbort(false)
elsif @button_id == :abort_ch
when :abort_ch
@ok = Popup.ReallyAbort(true)
elsif @button_id == :show_file
when :show_file
Popup.ShowFile("Boot Messages", "/var/log/boot.msg")
elsif @button_id == :show_text
when :show_text
@text = Convert.to_string(
SCR.Read(path(".target.string"), "/var/log/boot.msg")
)
Popup.ShowText("Boot Messages", @text)
when :close
break
end
end while @button_id != :close

end

UI.CloseDialog

Expand Down
96 changes: 48 additions & 48 deletions doc/examples/popups2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ def main
Yast.import "Label"
Yast.import "Popup"


UI.OpenDialog(
VBox(
PushButton(
Expand All @@ -49,84 +48,85 @@ def main
)
)


@button_id = :dummy
begin
loop do
@button_id = Convert.to_symbol(UI.UserInput)

if @button_id == :yesNo
case @button_id
when :yesNo
Popup.YesNoHeadline(
"Really delete world?",
"You in your infinite wisdom have chosen to delete this only world of ours.\n" +
"This will mean the end to all of mankind and all life in the only known planet\n" +
"known to habitate intelligent or other life in the entire universe.\n" +
"\n" +
"Even though it is well known that mankind and human character are far from perfect,\n" +
"we urgently request you to reconsider that decision.\n" +
"\n" +
"You in your infinite wisdom have chosen to delete this only world of ours.\n" \
"This will mean the end to all of mankind and all life in the only known planet\n" \
"known to habitate intelligent or other life in the entire universe.\n" \
"\n" \
"Even though it is well known that mankind and human character are far from perfect,\n" \
"we urgently request you to reconsider that decision.\n" \
"\n" \
"Are you absolutely sure you wish to delete this world?"
)
elsif @button_id == :generic2
when :generic2
Popup.AnyQuestion(
"Great Dilemma",
"You must now decide how to save the world.\n" +
"\n" +
"\n" +
"\n" +
"If make the wrong decision, creatures from outer space may decide\n" +
"\n" +
"to get rid of that planet of ours to make room for some interstellar\n" +
"\n" +
"hyper expressway.\n" +
"\n" +
"\n" +
"\n" +
"So: Do you fail to be aware to recognize the lack of not being able\n" +
"\n" +
"You must now decide how to save the world.\n" \
"\n" \
"\n" \
"\n" \
"If make the wrong decision, creatures from outer space may decide\n" \
"\n" \
"to get rid of that planet of ours to make room for some interstellar\n" \
"\n" \
"hyper expressway.\n" \
"\n" \
"\n" \
"\n" \
"So: Do you fail to be aware to recognize the lack of not being able\n" \
"\n" \
"to face this kind of indecision may kill all of mankind?",
"&Everything you say",
"I'll &buy one of it",
:focus_no
)
elsif @button_id == :generic3
when :generic3
Popup.AnyQuestion3(
"Greatest Dilemma of the Millennium",
"You must now decide how to save the world.\n" +
"\n" +
"\n" +
"\n" +
"If make the wrong decision, creatures from outer space may decide\n" +
"\n" +
"to get rid of that planet of ours to make room for some interstellar\n" +
"\n" +
"hyper expressway.\n" +
"\n" +
"\n" +
"\n" +
"So: Do you fail to be aware to recognize the lack of not being able\n" +
"\n" +
"You must now decide how to save the world.\n" \
"\n" \
"\n" \
"\n" \
"If make the wrong decision, creatures from outer space may decide\n" \
"\n" \
"to get rid of that planet of ours to make room for some interstellar\n" \
"\n" \
"hyper expressway.\n" \
"\n" \
"\n" \
"\n" \
"So: Do you fail to be aware to recognize the lack of not being able\n" \
"\n" \
"to face this kind of indecision may kill all of mankind?",
"&Everything you say",
"I'll &buy one of it",
"But I don't have a &car",
:focus_no
)
elsif @button_id == :longText
when :longText
Popup.LongText(
"Bad News",
RichText(
"<p>Due to unforeseen circumstances it is necessary to <b>format your hard disk</b>.</p>\n" +
"<p>This may sound bad enough, but we must <b>format your brain</b>, too.</p>\n" +
"<p>And once this is done, you will fail to notice that in the process\n" +
"the entire planet will undergo substantial <b>rearranging of the continental shelves</b>:\n" +
"<p>Due to unforeseen circumstances it is necessary to <b>format your hard disk</b>.</p>\n" \
"<p>This may sound bad enough, but we must <b>format your brain</b>, too.</p>\n" \
"<p>And once this is done, you will fail to notice that in the process\n" \
"the entire planet will undergo substantial <b>rearranging of the continental shelves</b>:\n" \
"The continents will all be lowered to eight feet below sea level.</p>\n"
),
50, # width
10
) # height
when :close
break
end
end while @button_id != :close

end

UI.CloseDialog

Expand Down
15 changes: 9 additions & 6 deletions doc/examples/popups3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,22 @@ def main
)

@button_id = :dummy
begin
loop do
@button_id = Convert.to_symbol(UI.UserInput)

if @button_id == :painless
case @button_id
when :painless
Popup.ConfirmAbort(:painless)
elsif @button_id == :incomplete
when :incomplete
Popup.ConfirmAbort(:incomplete)
elsif @button_id == :unusable
when :unusable
Popup.ConfirmAbort(:unusable)
elsif @button_id == :error
when :error
Popup.ModuleError("The module inst_games.ycp does not work.")
when :close
break
end
end while @button_id != :close
end

UI.CloseDialog

Expand Down
7 changes: 4 additions & 3 deletions library/commandline/src/clients/other_tools_warning.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#
# ***************************************************************************

#*
# *
# There may be different ways to configure the system than YaST, e.g. Chef.
# It will periodically overwrite files under its control.
# If it is running, now is a good time to tell the user
Expand All @@ -41,13 +41,14 @@ 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" +
"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

nil
end
end
end
Expand Down
Loading

0 comments on commit 16a6eff

Please sign in to comment.