Hello community,
here is the log from the commit of package yast2-ruby-bindings for
openSUSE:Factory checked in at 2016-09-20 13:18:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-ruby-bindings (Old)
and /work/SRC/openSUSE:Factory/.yast2-ruby-bindings.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-ruby-bindings"
Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-ruby-bindings/yast2-ruby-bindings.changes
2016-07-07 15:09:56.000000000 +0200
+++
/work/SRC/openSUSE:Factory/.yast2-ruby-bindings.new/yast2-ruby-bindings.changes
2016-09-20 13:18:28.000000000 +0200
@@ -1,0 +2,7 @@
+Fri Sep 16 10:28:16 UTC 2016 - [email protected]
+
+- Rescue "invalid byte sequence in UTF-8", with a custom message
+ (bsc#992821).
+- 3.1.51
+
+-------------------------------------------------------------------
Old:
----
yast2-ruby-bindings-3.1.50.tar.bz2
New:
----
yast2-ruby-bindings-3.1.51.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-ruby-bindings.spec ++++++
--- /var/tmp/diff_new_pack.bm8a5k/_old 2016-09-20 13:18:29.000000000 +0200
+++ /var/tmp/diff_new_pack.bm8a5k/_new 2016-09-20 13:18:29.000000000 +0200
@@ -17,7 +17,7 @@
Name: yast2-ruby-bindings
-Version: 3.1.50
+Version: 3.1.51
Release: 0
Url: https://github.com/yast/yast-ruby-bindings
BuildRoot: %{_tmppath}/%{name}-%{version}-build
++++++ yast2-ruby-bindings-3.1.50.tar.bz2 -> yast2-ruby-bindings-3.1.51.tar.bz2
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-ruby-bindings-3.1.50/.rubocop.yml
new/yast2-ruby-bindings-3.1.51/.rubocop.yml
--- old/yast2-ruby-bindings-3.1.50/.rubocop.yml 2016-06-30 14:15:47.000000000
+0200
+++ new/yast2-ruby-bindings-3.1.51/.rubocop.yml 2016-09-16 14:02:43.000000000
+0200
@@ -24,6 +24,10 @@
Metrics/ClassLength:
Max: 107
+# Legacy Ops module is long
+Metrics/ModuleLength:
+ Max: 553
+
# Offense count: 20
Metrics/CyclomaticComplexity:
Max: 17
@@ -72,3 +76,7 @@
Lint/Debugger:
Exclude:
- src/ruby/yast/debugger.rb
+
+# alias method is more convenient method for method aliasing
+Style/Alias:
+ EnforcedStyle: prefer_alias_method
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-ruby-bindings-3.1.50/.travis.yml
new/yast2-ruby-bindings-3.1.51/.travis.yml
--- old/yast2-ruby-bindings-3.1.50/.travis.yml 2016-06-30 14:15:47.000000000
+0200
+++ new/yast2-ruby-bindings-3.1.51/.travis.yml 2016-09-16 14:02:43.000000000
+0200
@@ -5,7 +5,7 @@
# 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 "docbook-xsl xsltproc yast2-core-dev
yast2-devtools libxcrypt-dev cmake yast2-ycp-ui-bindings-dev ruby2.1
ruby2.1-dev rake ruby-fast-gettext language-pack-en language-pack-cs screen" -g
"yast-rake rspec:3.3.0 rubocop:0.29.1"
+ - sh ./travis_setup.sh -p "docbook-xsl xsltproc yast2-core-dev
yast2-devtools libxcrypt-dev cmake yast2-ycp-ui-bindings-dev ruby2.1
ruby2.1-dev rake ruby-fast-gettext language-pack-en language-pack-cs screen" -g
"yast-rake rspec:3.3.0 rubocop:0.41.2"
script:
- rake check:syntax
- rubocop
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-ruby-bindings-3.1.50/CONTRIBUTING.md
new/yast2-ruby-bindings-3.1.51/CONTRIBUTING.md
--- old/yast2-ruby-bindings-3.1.50/CONTRIBUTING.md 2016-06-30
14:15:47.000000000 +0200
+++ new/yast2-ruby-bindings-3.1.51/CONTRIBUTING.md 2016-09-16
14:02:43.000000000 +0200
@@ -3,7 +3,7 @@
YaST is an open source project and as such it welcomes all kinds of
contributions. If you decide to contribute, please follow these guidelines to
-ensure the process is effective and pleasant both for you and YaST maintainers.
+ensure the process is effective and pleasant both for you and the YaST
maintainers.
There are two main forms of contribution: reporting bugs and performing code
changes.
@@ -17,13 +17,11 @@
registration](https://secure-www.novell.com/selfreg/jsp/createSimpleAccount.jsp)
if you don't have an account yet.)
-If you find a problem, please report it either using
-[Bugzilla](https://bugzilla.suse.com/) or GitHub issues. We can't guarantee
-that every bug will be fixed, but we'll try.
-
When creating a bug report, please follow our [bug reporting
guidelines](http://en.opensuse.org/openSUSE:Report_a_YaST_bug).
+We can't guarantee that every bug will be fixed, but we'll try.
+
Code Changes
------------
@@ -44,15 +42,22 @@
to the [Ruby style
guide](https://github.com/SUSE/style-guides/blob/master/Ruby.md).
- 4. Make sure your change didn't break anything by building the RPM package
+ 4. Update the package version (in `packages/*.spec`, usually by
+ `rake version:bump`) and add a new entry to the `package/*.changes` file
+ (by `osc vc package`).
+ For bigger changes or changes which need longer discussion it is advised
to
+ add this as a separate last commit so it can be easily updated when
another
+ change is merged in the meantime.
+
+ 5. Make sure your change didn't break anything by building the RPM package
(`rake osc:build`). The build process includes running the full testsuite.
- 5. Publish the branch and create a pull request.
+ 6. Publish the branch and create a pull request.
- 6. YaST developers will review your change and possibly point out issues.
+ 7. YaST developers will review your change and possibly point out issues.
Adapt the code under their guidance until they are all resolved.
- 7. Finally, the pull request will get merged or rejected.
+ 8. Finally, the pull request will get merged or rejected.
See also [GitHub's guide on
contributing](https://help.github.com/articles/fork-a-repo).
@@ -60,9 +65,6 @@
If you want to do multiple unrelated changes, use separate branches and pull
requests.
-Do not change the `VERSION` and `*.changes` files as this could lead to
-conflicts.
-
### Commits
Each commit in the pull request should do only one thing, which is clearly
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-ruby-bindings-3.1.50/package/yast2-ruby-bindings.changes
new/yast2-ruby-bindings-3.1.51/package/yast2-ruby-bindings.changes
--- old/yast2-ruby-bindings-3.1.50/package/yast2-ruby-bindings.changes
2016-06-30 14:15:47.000000000 +0200
+++ new/yast2-ruby-bindings-3.1.51/package/yast2-ruby-bindings.changes
2016-09-16 14:02:43.000000000 +0200
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Fri Sep 16 10:28:16 UTC 2016 - [email protected]
+
+- Rescue "invalid byte sequence in UTF-8", with a custom message
+ (bsc#992821).
+- 3.1.51
+
+-------------------------------------------------------------------
Thu Jun 30 09:24:32 UTC 2016 - [email protected]
- Fix segfault when running rspec tests caused by added ruby
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-ruby-bindings-3.1.50/package/yast2-ruby-bindings.spec
new/yast2-ruby-bindings-3.1.51/package/yast2-ruby-bindings.spec
--- old/yast2-ruby-bindings-3.1.50/package/yast2-ruby-bindings.spec
2016-06-30 14:15:47.000000000 +0200
+++ new/yast2-ruby-bindings-3.1.51/package/yast2-ruby-bindings.spec
2016-09-16 14:02:43.000000000 +0200
@@ -17,7 +17,7 @@
Name: yast2-ruby-bindings
-Version: 3.1.50
+Version: 3.1.51
Url: https://github.com/yast/yast-ruby-bindings
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-ruby-bindings-3.1.50/src/ruby/yast/builtins.rb
new/yast2-ruby-bindings-3.1.51/src/ruby/yast/builtins.rb
--- old/yast2-ruby-bindings-3.1.50/src/ruby/yast/builtins.rb 2016-06-30
14:15:47.000000000 +0200
+++ new/yast2-ruby-bindings-3.1.51/src/ruby/yast/builtins.rb 2016-09-16
14:02:43.000000000 +0200
@@ -50,11 +50,7 @@
# @deprecated use ruby native select method
def self.filter(object, &block)
# TODO: investigate break and continue with filter as traverse workflow
is different for ruby
- if object.is_a?(::Array) || object.is_a?(::Hash)
- Yast.deep_copy(object).select(&block)
- else
- return nil
- end
+ (object.is_a?(::Array) || object.is_a?(::Hash)) ?
Yast.deep_copy(object).select(&block) : nil
end
# find() Yast built-in
@@ -350,7 +346,7 @@
value.reduce([]) do |acc, i|
return nil if i.nil?
- acc.push(*Yast.deep_copy(i))
+ acc.concat(Yast.deep_copy(i))
end
end
@@ -361,11 +357,11 @@
def self.reduce(*params, &block)
return nil if params.first.nil?
list = if params.size == 2 # so first is default and second is list
- return nil if params[1].nil?
- [params.first].concat(Yast.deep_copy(params[1]))
- else
- params.first
- end
+ return nil if params[1].nil?
+ [params.first].concat(Yast.deep_copy(params[1]))
+ else
+ params.first
+ end
Yast.deep_copy(list).reduce(&block)
end
@@ -426,7 +422,7 @@
def self.prepend(list, element)
return nil if list.nil?
- [Yast.deep_copy(element)].push(*Yast.deep_copy(list))
+ [Yast.deep_copy(element)].concat(Yast.deep_copy(list))
end
# setcontains() Yast built-in
@@ -445,10 +441,10 @@
return nil if array.nil?
res = if block_given?
- array.sort { |x, y| block.call(x, y) ? -1 : 1 }
- else
- array.sort { |x, y| Yast::Ops.comparable_object(x) <=> y }
- end
+ array.sort { |x, y| block.call(x, y) ? -1 : 1 }
+ else
+ array.sort { |x, y| Yast::Ops.comparable_object(x) <=> y }
+ end
Yast.deep_copy(res)
end
@@ -465,7 +461,7 @@
end
# @private we must mark somehow default value for length
- DEF_LENGHT = "default"
+ DEF_LENGHT = "default".freeze
# Extracts a sublist
# - sublist(<list>, <offset>)
# - sublist(<list>, <offset>, <length>)
@@ -547,11 +543,7 @@
# Evaluate a Yast value.
# @deprecated for lazy evaluation use builtin lambda or block calls
def self.eval(object)
- if object.respond_to? :call
- return object.call
- else
- return Yast.deep_copy(object)
- end
+ object.respond_to?(:call) ? object.call : Yast.deep_copy(object)
end
# Change or add an environment variable
@@ -717,10 +709,10 @@
# tm_isdst > 0 -> in effect
# tm_isdst = 0 -> not in effect
# tm_isdst < 0 -> unknown
- if time.respond_to?(:isdst)
- tm[:tm_isdst] = time.isdst ? 1 : 0
+ tm[:tm_isdst] = if time.respond_to?(:isdst)
+ time.isdst ? 1 : 0
else
- tm[:tm_isdst] = -1
+ -1
end
tm
end
@@ -977,7 +969,7 @@
# There is also extra "any" in lists/maps:
# Yast: <YCPRef:list <map> bar (list <map> a)>
# Ruby: <YCPRef:list <map<any,any>> bar (list <map<any,any>>)>
- val.signature.match(/(.*)\((.*)\)/)
+ val.signature =~ /(.*)\((.*)\)/
"<YCPRef:#{Regexp.last_match(1)}#{val.remote_method.name}
(#{Regexp.last_match(2)})>"
else
y2warning 1, "tostring builtin called on wrong type #{val.class}"
@@ -987,11 +979,7 @@
# @private string is handled diffent if string is inside other structure
def self.inside_tostring(val)
- if val.is_a? ::String
- return val.inspect
- else
- tostring val
- end
+ val.is_a?(::String) ? val.inspect : tostring(val)
end
# toupper() Yast built-in
@@ -1090,15 +1078,11 @@
case symbol
when ::String
- return Yast::Term.new(symbol.to_sym)
+ Yast::Term.new(symbol.to_sym)
when ::Symbol
- if list == DEF_LENGHT
- return Yast::Term.new(symbol)
- else
- return Yast::Term.new(symbol, *list)
- end
+ list == DEF_LENGHT ? Yast::Term.new(symbol) : Yast::Term.new(symbol,
*list)
when Yast::Term
- return symbol
+ symbol
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-ruby-bindings-3.1.50/src/ruby/yast/convert.rb
new/yast2-ruby-bindings-3.1.51/src/ruby/yast/convert.rb
--- old/yast2-ruby-bindings-3.1.50/src/ruby/yast/convert.rb 2016-06-30
14:15:47.000000000 +0200
+++ new/yast2-ruby-bindings-3.1.51/src/ruby/yast/convert.rb 2016-09-16
14:02:43.000000000 +0200
@@ -64,23 +64,21 @@
return nil if object.nil?
return object if from == to
- if from == "any" && allowed_type(object, to)
- return object
- elsif to == "float"
+ return object if from == "any" && allowed_type(object, to)
+ if to == "float"
return nil unless (object.is_a? Fixnum) || (object.is_a? Bignum)
return object.to_f
elsif to == "integer"
return nil unless object.is_a? Float
Yast.y2warning "Conversion from integer to float lead to loose
precision."
return object.to_i
- elsif to == "locale" && from == "string"
- return object
- elsif to == "string" && from == "locale"
- return object
- else
- Yast.y2warning(-1, "Cannot convert #{object.class} from '#{from}' to
'#{to}'")
- return nil
end
+
+ return object if to == "locale" && from == "string"
+ return object if to == "string" && from == "locale"
+
+ Yast.y2warning(-1, "Cannot convert #{object.class} from '#{from}' to
'#{to}'")
+ nil
end
# @private
@@ -90,7 +88,7 @@
types = [types] unless types.is_a? Array
- types.any? { |t| object.is_a? t }
+ types.any? { |t| object.is_a? t }
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-ruby-bindings-3.1.50/src/ruby/yast/debugger.rb
new/yast2-ruby-bindings-3.1.51/src/ruby/yast/debugger.rb
--- old/yast2-ruby-bindings-3.1.50/src/ruby/yast/debugger.rb 2016-06-30
14:15:47.000000000 +0200
+++ new/yast2-ruby-bindings-3.1.51/src/ruby/yast/debugger.rb 2016-09-16
14:02:43.000000000 +0200
@@ -147,7 +147,7 @@
end
# start the debugger client in an xterm session
- exec "xterm", "-e", "byebug", "-R", "#{port}"
+ exec "xterm", "-e", "byebug", "-R", port.to_s
end
# detach the process, we do not wait for it so avoid zombies
@@ -167,10 +167,10 @@
remote_ips = Socket.ip_address_list.select { |a| a.ipv4? &&
!a.ipv4_loopback? }
cmd = remote_ips.map { |a| debugger_cmd(a.ip_address, port)
}.join("\n")
- if remote_ips.size > 1
- prefix = "To connect to the debugger from a remote machine use one
of these commands:"
+ prefix = if remote_ips.size > 1
+ "To connect to the debugger from a remote machine use one of these
commands:"
else
- prefix = "To connect to the debugger from a remote machine use
this command:"
+ "To connect to the debugger from a remote machine use this
command:"
end
else
prefix = "To start the debugger switch to another console and run:"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-ruby-bindings-3.1.50/src/ruby/yast/i18n.rb
new/yast2-ruby-bindings-3.1.51/src/ruby/yast/i18n.rb
--- old/yast2-ruby-bindings-3.1.50/src/ruby/yast/i18n.rb 2016-06-30
14:15:47.000000000 +0200
+++ new/yast2-ruby-bindings-3.1.51/src/ruby/yast/i18n.rb 2016-09-16
14:02:43.000000000 +0200
@@ -5,9 +5,9 @@
module I18n
# @private
# TODO: load alternative in development recent translation
- LOCALE_DIR = "/usr/share/YaST2/locale"
+ LOCALE_DIR = "/usr/share/YaST2/locale".freeze
# if every heuristic fails then use the default for locale
- DEFAULT_LOCALE = "en_US"
+ DEFAULT_LOCALE = "en_US".freeze
# sets new text domain
def textdomain(domain)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-ruby-bindings-3.1.50/src/ruby/yast/ops.rb
new/yast2-ruby-bindings-3.1.51/src/ruby/yast/ops.rb
--- old/yast2-ruby-bindings-3.1.50/src/ruby/yast/ops.rb 2016-06-30
14:15:47.000000000 +0200
+++ new/yast2-ruby-bindings-3.1.51/src/ruby/yast/ops.rb 2016-09-16
14:02:43.000000000 +0200
@@ -27,7 +27,7 @@
"locale" => ::String,
"function" => [Yast::FunRef, Yast::YReference],
"byteblock" => Yast::Byteblock
- }
+ }.freeze
# Types for which we generate shortcut methods,
# e.g. {Yast::Ops.get_string}
@@ -43,7 +43,7 @@
"term",
"path",
"locale"
- ]
+ ].freeze
# @!method self.get_boolean( obj, idx, def )
# @return [Boolean, nil] {Convert.to_boolean}({get}(obj, idx, def))
@@ -121,7 +121,7 @@
case res
when ::Array, Yast::Term
if i.is_a? Fixnum
- if (0..res.size - 1).include? i
+ if (0..res.size - 1).cover? i
res = res[i]
else
Yast.y2milestone skip_frames, "Index #{i} is out of array size"
@@ -132,11 +132,9 @@
return block_given? ? yield : default
end
when ::Hash
- if res.key? i
- res = res[i]
- else
- return block_given? ? yield : default
- end
+ return block_given? ? yield : default unless res.key?(i)
+
+ res = res[i]
when ::NilClass
Yast.y2milestone skip_frames, "Ops.get called on nil."
return block_given? ? yield : default
@@ -192,31 +190,34 @@
last = indexes.pop
res = object
+ # return here is needed for quick exit of method and workaround with any
or
+ # all is nasty and decrease readability
+ # rubocop:disable Lint/NonLocalExitFromIterator
indexes.each do |i|
case res
when ::Array, Yast::Term
- if i.is_a? Fixnum
- if (0..res.size - 1).include? i
- res = res[i]
- else
- Yast.y2warning OUTER_LOOP_FRAME, "Index #{i} is out of array
size"
- return
- end
- else
+ if !i.is_a?(Fixnum)
Yast.y2warning OUTER_LOOP_FRAME, "Passed #{i.inspect} as index key
for array."
return
end
- when ::Hash
- if res.key? i
- res = res[i]
- else
+
+ if !(0..res.size - 1).cover?(i)
+ Yast.y2warning OUTER_LOOP_FRAME, "Index #{i} is out of array size"
return
end
+
+ res = res[i]
+ when ::Hash
+ return unless res.key? i
+
+ res = res[i]
else
Yast.y2warning OUTER_LOOP_FRAME, "Builtin assign called on wrong
type #{res.class}"
return
end
end
+ # rubocop:enable Lint/NonLocalExitFromIterator
+
case res
when ::Array, Yast::Term, ::Hash
res[last] = Yast.deep_copy(value)
@@ -233,17 +234,15 @@
case first
when ::Array
- if second.is_a? ::Array
- return Yast.deep_copy(first + second)
- else
- return Yast.deep_copy(first).push(Yast.deep_copy(second))
- end
+ return Yast.deep_copy(first + second) if second.is_a?(::Array)
+
+ Yast.deep_copy(first).push(Yast.deep_copy(second))
when ::Hash
- return Yast.deep_copy(first).merge Yast.deep_copy(second)
+ Yast.deep_copy(first).merge(Yast.deep_copy(second))
when ::String
- return first + second.to_s
+ first + second.to_s
else
- return first + second
+ first + second
end
end
@@ -495,29 +494,23 @@
# ordered classes from low priority to high
# Only tricky part is Fixnum/Bignum, which is in fact same, so it has
special handling in code
CLASS_ORDER = [::NilClass, ::FalseClass, ::TrueClass, ::Fixnum,
::Bignum, ::Float,
- ::String, Yast::Path, ::Symbol, ::Array, Yast::Term,
::Hash]
+ ::String, Yast::Path, ::Symbol, ::Array, Yast::Term,
::Hash].freeze
def <=>(other)
if @value.class == other.class
case @value
when ::Array
- return ListComparator.new(@value, @localized) <=> other
+ ListComparator.new(@value, @localized) <=> other
when ::NilClass
- return 0 # comparison of two nils is equality
+ 0 # comparison of two nils is equality
when ::Hash
- return HashComparator.new(@value, @localized) <=> other
+ HashComparator.new(@value, @localized) <=> other
when ::String
- if @localized
- return Yast.strcoll(@value, other)
- else
- return @value <=> other
- end
+ @localized ? Yast.strcoll(@value, other) : (@value <=> other)
else
@value <=> other
end
else
- if @value.is_a?(::Numeric) && other.is_a?(::Numeric)
- return @value <=> other
- end
+ return @value <=> other if @value.is_a?(::Numeric) &&
other.is_a?(::Numeric)
CLASS_ORDER.index(@value.class) <=> CLASS_ORDER.index(other.class)
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-ruby-bindings-3.1.50/src/ruby/yast/path.rb
new/yast2-ruby-bindings-3.1.51/src/ruby/yast/path.rb
--- old/yast2-ruby-bindings-3.1.50/src/ruby/yast/path.rb 2016-06-30
14:15:47.000000000 +0200
+++ new/yast2-ruby-bindings-3.1.51/src/ruby/yast/path.rb 2016-09-16
14:02:43.000000000 +0200
@@ -72,16 +72,16 @@
state = :dot
when :dot
raise "Invalid path '#{value}'" if c == "."
- if c == '"'
- state = :complex
+ state = if c == '"'
+ :complex
else
- state = :simple
+ :simple
end
buffer << c
when :simple
if c == "."
state = :dot
- return if invalid_buffer?(buffer)
+ break if invalid_buffer?(buffer)
@components << modify_buffer(buffer)
buffer = ""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-ruby-bindings-3.1.50/src/ruby/yast/profiler.rb
new/yast2-ruby-bindings-3.1.51/src/ruby/yast/profiler.rb
--- old/yast2-ruby-bindings-3.1.50/src/ruby/yast/profiler.rb 2016-06-30
14:15:47.000000000 +0200
+++ new/yast2-ruby-bindings-3.1.51/src/ruby/yast/profiler.rb 2016-09-16
14:02:43.000000000 +0200
@@ -6,7 +6,7 @@
class << self
include Yast::Logger
- RESULT_PATH = "/var/log/YaST2/profiler_result.txt"
+ RESULT_PATH = "/var/log/YaST2/profiler_result.txt".freeze
# Start the Ruby Profiler. It start profilling. It also disables ruby VM
# optimizations, so code execution will be slower.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-ruby-bindings-3.1.50/src/ruby/yast/ui_shortcuts.rb
new/yast2-ruby-bindings-3.1.51/src/ruby/yast/ui_shortcuts.rb
--- old/yast2-ruby-bindings-3.1.50/src/ruby/yast/ui_shortcuts.rb
2016-06-30 14:15:47.000000000 +0200
+++ new/yast2-ruby-bindings-3.1.51/src/ruby/yast/ui_shortcuts.rb
2016-09-16 14:02:43.000000000 +0200
@@ -80,7 +80,7 @@
:item,
:header,
:opt
- ]
+ ].freeze
# for each symbol define a util function that will create a term
UI_TERMS.each do |term_name|
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-ruby-bindings-3.1.50/src/ruby/yast/wfm.rb
new/yast2-ruby-bindings-3.1.51/src/ruby/yast/wfm.rb
--- old/yast2-ruby-bindings-3.1.50/src/ruby/yast/wfm.rb 2016-06-30
14:15:47.000000000 +0200
+++ new/yast2-ruby-bindings-3.1.51/src/ruby/yast/wfm.rb 2016-09-16
14:02:43.000000000 +0200
@@ -194,9 +194,16 @@
# @param [Exception] e the caught exception
# @return [String] human readable exception description
def self.internal_error_msg(e)
- "Internal error. Please report a bug report with logs.\n" \
- "Details: #{e.message}\n" \
- "Caller: #{e.backtrace.first}"
+ msg = "Internal error. Please report a bug report with logs.\n"
+
+ if e.is_a?(ArgumentError) && e.message =~ /invalid byte sequence in
UTF-8/
+ msg += "A string was encountered that is not valid in UTF-8.\n" \
+ "The system encoding is #{Encoding.locale_charmap.inspect}.\n" \
+ "Refer to https://www.suse.com/support/kb/doc?id=7018056.\n\n"
+ end
+
+ msg + "Details: #{e.message}\n" \
+ "Caller: #{e.backtrace.first}"
end
# @private wrapper to run client in ruby
@@ -221,8 +228,7 @@
begin
Builtins.y2error("Client call failed with '%1' and backtrace %2",
e.message,
- e.backtrace
- )
+ e.backtrace)
msg = internal_error_msg(e)
@@ -246,8 +252,7 @@
rescue Exception => e
Builtins.y2internal("Error reporting failed with '%1' and backtrace
%2",
e.message,
- e.backtrace
- )
+ e.backtrace)
end
return false
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-ruby-bindings-3.1.50/src/ruby/yast/yast.rb
new/yast2-ruby-bindings-3.1.51/src/ruby/yast/yast.rb
--- old/yast2-ruby-bindings-3.1.50/src/ruby/yast/yast.rb 2016-06-30
14:15:47.000000000 +0200
+++ new/yast2-ruby-bindings-3.1.51/src/ruby/yast/yast.rb 2016-09-16
14:02:43.000000000 +0200
@@ -105,9 +105,9 @@
def self.include(target, path)
path_without_suffix = path.sub(/\.rb$/, "")
module_name = path_without_suffix
- .gsub(/^./) { |s| s.upcase }
- .gsub(/\/./) { |s| s[1].upcase }
- .gsub(/[-_.]./) { |s| s[1].upcase } +
+ .gsub(/^./, &:upcase)
+ .gsub(/\/./) { |s| s[1].upcase }
+ .gsub(/[-_.]./) { |s| s[1].upcase } +
"Include"
loaded = Yast.constants.include? module_name.to_sym
@@ -151,10 +151,10 @@
# Handle multilevel modules like YaPI::Network
modules[0..-2].each do |module_|
tmp_m = if base.constants.include?(module_.to_sym)
- base.const_get(module_)
- else
- base.const_set(module_, ::Module.new)
- end
+ base.const_get(module_)
+ else
+ base.const_set(module_, ::Module.new)
+ end
base = tmp_m
end
@@ -174,13 +174,13 @@
end
m = if base.constants.include?(modules.last.to_sym)
- base.const_get(modules.last)
- else
- ::Module.new
- end
+ base.const_get(modules.last)
+ else
+ ::Module.new
+ end
symbols(mname).each do |sname, stype|
next if sname.empty?
- if (stype == :function)
+ if stype == :function
m.module_eval <<-"END"
def self.#{sname}(*args)
caller(1,1).first.match BACKTRACE_REGEXP
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-ruby-bindings-3.1.50/tests/ruby/builtins_casts_spec.rb
new/yast2-ruby-bindings-3.1.51/tests/ruby/builtins_casts_spec.rb
--- old/yast2-ruby-bindings-3.1.50/tests/ruby/builtins_casts_spec.rb
2016-06-30 14:15:47.000000000 +0200
+++ new/yast2-ruby-bindings-3.1.51/tests/ruby/builtins_casts_spec.rb
2016-09-16 14:02:43.000000000 +0200
@@ -38,7 +38,7 @@
[Yast::Path.new(".etc.syconfig.\"-arg\""), ".etc.syconfig.\"-arg\""],
[Yast::Term.new(:id, ["test", :lest]), "`id ([\"test\", `lest])"],
[{ test: "data" }, "$[`test:\"data\"]"]
- ]
+ ].freeze
it "works as expected" do
TOSTRING_TEST_DATA.each do |input, result|
@@ -111,7 +111,7 @@
["89.3", 89.3],
["test", 0.0],
[:test, nil]
- ]
+ ].freeze
it "works as expected" do
TOFLOAT_TESTDATA.each do |value, result|
@@ -152,7 +152,7 @@
[:test, Yast::Term.new(:test)],
[[:test, [:lest, :srst]], Yast::Term.new(:test, :lest, :srst)],
[[Yast::Term.new(:test)], Yast::Term.new(:test)]
- ]
+ ].freeze
it "works as expected" do
TOTERM_TEST_DATA.each do |input, res|
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-ruby-bindings-3.1.50/tests/ruby/builtins_list_spec.rb
new/yast2-ruby-bindings-3.1.51/tests/ruby/builtins_list_spec.rb
--- old/yast2-ruby-bindings-3.1.50/tests/ruby/builtins_list_spec.rb
2016-06-30 14:15:47.000000000 +0200
+++ new/yast2-ruby-bindings-3.1.51/tests/ruby/builtins_list_spec.rb
2016-09-16 14:02:43.000000000 +0200
@@ -63,7 +63,7 @@
[[0, 1, 2, 3], 0, 2, [2, 1, 0, 3]],
[[0, 1, 2, 3], 1, 3, [0, 3, 2, 1]],
[[0, 1, 2, 3], 2, 2, [0, 1, 2, 3]]
- ]
+ ].freeze
it "works as expected" do
SWAP_TESTDATA.each do |list, offset1, offset2, result|
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-ruby-bindings-3.1.50/tests/ruby/builtins_spec.rb
new/yast2-ruby-bindings-3.1.51/tests/ruby/builtins_spec.rb
--- old/yast2-ruby-bindings-3.1.50/tests/ruby/builtins_spec.rb 2016-06-30
14:15:47.000000000 +0200
+++ new/yast2-ruby-bindings-3.1.51/tests/ruby/builtins_spec.rb 2016-09-16
14:02:43.000000000 +0200
@@ -25,7 +25,7 @@
Yast::Path.new(".etc.sysconfig")],
[Yast::Path.new(".etc"), "sysconfig", Yast::Path.new(".etc.sysconfig")],
[Yast::Term.new(:a, :b), :c, Yast::Term.new(:a, :b, :c)]
- ]
+ ].freeze
it "works as expected" do
ADD_TEST_DATA.each do |object, element, result|
@@ -137,7 +137,7 @@
h = { a: 1, b: 2 }
res = Yast::Builtins.change(h, :c, 3)
expect(res).to eq(a: 1, b: 2, c: 3)
- expect(h).to eq(({ a: 1, b: 2 }))
+ expect(h).to eq(a: 1, b: 2)
end
end
@@ -350,7 +350,7 @@
[[1, 2, 3, 1], [3, 4], [1, 2, 3, 4]],
[[1, 2, nil], [3, nil, 4], [1, 2, nil, 3, 4]],
[{ 1 => 2, 2 => 3 }, { 2 => 10, 4 => 5 }, { 1 => 2, 2 => 10, 4 => 5 }]
- ]
+ ].freeze
it "works as expected" do
UNION_TESTDATA.each do |first, second, result|
@@ -367,7 +367,7 @@
[[[1, 2], [3, nil]], [1, 2, 3, nil]],
[[[0, 1], [2, [3, 4]]], [0, 1, 2, [3, 4]]],
[[[0, 1], [2, 3], [3, 4]], [0, 1, 2, 3, 3, 4]]
- ]
+ ].freeze
it "works as expected" do
FLATTEN_TESTDATA.each do |value, result|
@@ -389,7 +389,7 @@
[nil, 5, nil],
[[0, 1], 5, [5, 0, 1]],
[[1, 2], nil, [nil, 1, 2]]
- ]
+ ].freeze
it "works as expected" do
PREPEND_TESTDATA.each do |list, element, result|
@@ -409,7 +409,7 @@
[[0, 1], 1, 2, nil],
[[0, 1], 1, 1, [1]],
[[0, 1], 1, 0, []]
- ]
+ ].freeze
SUBLIST_TEST_DATA_WITHOUT_LEN = [
[nil, 1, nil],
@@ -417,7 +417,7 @@
[[0, 1], 2, nil],
[[0, 1], 0, [0, 1]],
[[0, 1], 1, [1]]
- ]
+ ].freeze
it "works as expected with len" do
SUBLIST_TEST_DATA_WITH_LEN.each do |list, offset, length, result|
@@ -496,7 +496,7 @@
["abcdefg", "cxdv", 2],
["\s\t\n", "\s", 0],
["\s\t\n", "\n", 2]
- ]
+ ].freeze
it "works as expected" do
FINDFIRSTOF_TESTDATA.each do |string, chars, result|
@@ -513,7 +513,7 @@
["abcdefg", "cxdv", 0],
["\s\t\n", "\s", 1],
["\n\n\t", "\n", 2]
- ]
+ ].freeze
it "works as expected" do
FINDFIRSTNOTOF_TESTDATA.each do |string, chars, result|
@@ -530,7 +530,7 @@
["abcdefg", "cxdv", 3],
["\s\t\n", "\s", 0],
["\s\t\n", "\n", 2]
- ]
+ ].freeze
it "works as expected" do
FINDLASTOF_TESTDATA.each do |string, chars, result|
@@ -547,7 +547,7 @@
["abcdefg", "cxdv", 6],
["\s\t\s", "\s", 1],
["\t\n\n", "\n", 0]
- ]
+ ].freeze
it "works as expected" do
FINDLASTNOTOF_TESTDATA.each do |string, chars, result|
@@ -589,7 +589,7 @@
[nil, nil],
[5, 5],
[proc { "15" }, "15"]
- ]
+ ].freeze
it "works as expected" do
EVAL_TEST_DATA.each do |input, result|
@@ -607,7 +607,7 @@
["abc", "cde", "ab"],
["abc", "a-c", "b"],
["abc", "^ab", "c"]
- ]
+ ].freeze
it "works as expected" do
DELETECHARS_TEST_DATA.each do |input1, input2, result|
@@ -625,7 +625,7 @@
["abc", "cde", "c"],
["abc", "a-c", "ac"],
["abc", "^ab", "ab"]
- ]
+ ].freeze
it "works as expected" do
FILTERCHARS_TEST_DATA.each do |input1, input2, result|
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-ruby-bindings-3.1.50/tests/ruby/convert_spec.rb
new/yast2-ruby-bindings-3.1.51/tests/ruby/convert_spec.rb
--- old/yast2-ruby-bindings-3.1.50/tests/ruby/convert_spec.rb 2016-06-30
14:15:47.000000000 +0200
+++ new/yast2-ruby-bindings-3.1.51/tests/ruby/convert_spec.rb 2016-09-16
14:02:43.000000000 +0200
@@ -24,7 +24,7 @@
[5.5, "any", "integer", 5],
[5.9, "any", "integer", 5],
[5, "any", "float", 5.0]
- ]
+ ].freeze
it "tests convert" do
CONVERT_TESTDATA.each do |object, from, to, result|
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-ruby-bindings-3.1.50/tests/ruby/exportable_spec.rb
new/yast2-ruby-bindings-3.1.51/tests/ruby/exportable_spec.rb
--- old/yast2-ruby-bindings-3.1.50/tests/ruby/exportable_spec.rb
2016-06-30 14:15:47.000000000 +0200
+++ new/yast2-ruby-bindings-3.1.51/tests/ruby/exportable_spec.rb
2016-09-16 14:02:43.000000000 +0200
@@ -38,7 +38,7 @@
it "tests variable definition" do
MyTest.variable_a = ({ a: 15 })
- expect(MyTest.variable_a).to eq(({ a: 15 }))
+ expect(MyTest.variable_a).to eq(a: 15)
end
it "tests type full specification" do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-ruby-bindings-3.1.50/tests/ruby/ops_spec.rb
new/yast2-ruby-bindings-3.1.51/tests/ruby/ops_spec.rb
--- old/yast2-ruby-bindings-3.1.50/tests/ruby/ops_spec.rb 2016-06-30
14:15:47.000000000 +0200
+++ new/yast2-ruby-bindings-3.1.51/tests/ruby/ops_spec.rb 2016-09-16
14:02:43.000000000 +0200
@@ -266,7 +266,7 @@
["s", 15, "s15"],
["s", :c, "sc"],
["s", Yast::Path.new(".etc"), "s.etc"]
- ]
+ ].freeze
it "tests add" do
ADD_TESTCASES.each do |first, second, result|
@@ -281,7 +281,7 @@
[nil, nil, nil],
[1, 2, -1],
[1.1, 1.1, 0.0]
- ]
+ ].freeze
it "tests subtract" do
SUBTRACT_TESTCASES.each do |first, second, result|
@@ -296,7 +296,7 @@
[nil, nil, nil],
[1, 2, 2],
[1.5, 2.0, 3.0]
- ]
+ ].freeze
it "tests multiply" do
MULTIPLY_TESTCASES.each do |first, second, result|
@@ -312,7 +312,7 @@
[2, 0, nil], # yes fantastic yast allows division by zero
[2, 1, 2],
[3.0, 1.5, 2.0]
- ]
+ ].freeze
it "tests divide" do
DIVIDE_TESTCASES.each do |first, second, result|
@@ -326,7 +326,7 @@
[1, nil, nil],
[nil, nil, nil],
[5, 2, 1]
- ]
+ ].freeze
it "tests modulo" do
MODULO_TESTCASES.each do |first, second, result|
@@ -341,7 +341,7 @@
[nil, nil, nil],
[5, 3, 1],
[5, 4, 4]
- ]
+ ].freeze
it "tests bitwise and" do
BITWISE_AND_TESTCASES.each do |first, second, result|
@@ -356,7 +356,7 @@
[nil, nil, nil],
[5, 3, 7],
[5, 4, 5]
- ]
+ ].freeze
it "tests bitwise or" do
BITWISE_OR_TESTCASES.each do |first, second, result|
@@ -371,7 +371,7 @@
[nil, nil, nil],
[5, 3, 6],
[5, 4, 1]
- ]
+ ].freeze
it "tests bitwise xor" do
BITWISE_XOR_TESTCASES.each do |first, second, result|
@@ -386,7 +386,7 @@
[nil, nil, nil],
[1, 2, 4],
[2, 2, 8]
- ]
+ ].freeze
it "tests shift left" do
SHIFT_LEFT_TESTCASES.each do |first, second, result|
@@ -401,7 +401,7 @@
[nil, nil, nil],
[4, 2, 1],
[8, 2, 2]
- ]
+ ].freeze
it "tests shift right" do
SHIFT_RIGHT_TESTCASES.each do |first, second, result|
@@ -416,7 +416,7 @@
[nil, nil, false],
[true, false, false],
[true, true, true]
- ]
+ ].freeze
it "tests logical and" do
LOGICAL_AND_TESTCASES.each do |first, second, result|
@@ -431,7 +431,7 @@
[nil, nil, false],
[true, false, true],
[true, true, true]
- ]
+ ].freeze
it "tests logical or" do
LOGICAL_OR_TESTCASES.each do |first, second, result|
@@ -444,7 +444,7 @@
[nil, nil],
[1, -1],
[5.5, -5.5]
- ]
+ ].freeze
it "tests unary minus" do
UNARY_MINUS_TESTCASES.each do |value, result|
@@ -457,7 +457,7 @@
[nil, nil],
[true, false],
[false, true]
- ]
+ ].freeze
it "tests logical not" do
LOGICAL_NOT_TESTCASES.each do |value, result|
@@ -471,7 +471,7 @@
[5, -6],
[8_589_934_592, -8_589_934_593],
[-558_589_934_592, 558_589_934_591]
- ]
+ ].freeze
it "tests bitwise not" do
BITWISE_NOT_TESTCASES.each do |value, result|
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-ruby-bindings-3.1.50/tests/ruby/rspec_scr_spec.rb
new/yast2-ruby-bindings-3.1.51/tests/ruby/rspec_scr_spec.rb
--- old/yast2-ruby-bindings-3.1.50/tests/ruby/rspec_scr_spec.rb 2016-06-30
14:15:47.000000000 +0200
+++ new/yast2-ruby-bindings-3.1.51/tests/ruby/rspec_scr_spec.rb 2016-09-16
14:02:43.000000000 +0200
@@ -7,7 +7,7 @@
describe Yast::RSpec::SCR do
let(:chroot) { File.join(File.dirname(__FILE__), "chroot") }
- class DummyError < Exception; end
+ class DummyError < RuntimeError; end
def root_content
Yast::SCR.Read(path(".target.dir"), "/")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-ruby-bindings-3.1.50/tests/ruby/term_spec.rb
new/yast2-ruby-bindings-3.1.51/tests/ruby/term_spec.rb
--- old/yast2-ruby-bindings-3.1.50/tests/ruby/term_spec.rb 2016-06-30
14:15:47.000000000 +0200
+++ new/yast2-ruby-bindings-3.1.51/tests/ruby/term_spec.rb 2016-09-16
14:02:43.000000000 +0200
@@ -43,7 +43,7 @@
end
end
- describe "#<<" do # " <- unconfuse Emacs string highlighting
+ describe "#<<" do # " <- unconfuse Emacs string highlighting
it "appends parameter to params" do
t = term(:HBox, 1, 2)
t << 3
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-ruby-bindings-3.1.50/tests/ruby/test_helper.rb
new/yast2-ruby-bindings-3.1.51/tests/ruby/test_helper.rb
--- old/yast2-ruby-bindings-3.1.50/tests/ruby/test_helper.rb 2016-06-30
14:15:47.000000000 +0200
+++ new/yast2-ruby-bindings-3.1.51/tests/ruby/test_helper.rb 2016-09-16
14:02:43.000000000 +0200
@@ -9,5 +9,5 @@
FileUtils.ln_s binary_path, "#{binary_path}/plugin"
end
$LOAD_PATH.unshift binary_path # yastx.so
-$LOAD_PATH.unshift "#{ROOT_DIR}/src/ruby" # yast.rb
+$LOAD_PATH.unshift "#{ROOT_DIR}/src/ruby" # yast.rb
ENV["Y2DIR"] = binary_path + ":" + File.dirname(__FILE__) + "/test_module"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-ruby-bindings-3.1.50/tests/ruby/y2logger_spec.rb
new/yast2-ruby-bindings-3.1.51/tests/ruby/y2logger_spec.rb
--- old/yast2-ruby-bindings-3.1.50/tests/ruby/y2logger_spec.rb 2016-06-30
14:15:47.000000000 +0200
+++ new/yast2-ruby-bindings-3.1.51/tests/ruby/y2logger_spec.rb 2016-09-16
14:02:43.000000000 +0200
@@ -6,7 +6,7 @@
module Yast
describe Y2Logger do
- TEST_MESSAGE = "Testing"
+ TEST_MESSAGE = "Testing".freeze
before do
@test_logger = Y2Logger.instance