Hello community,

here is the log from the commit of package yast2-ruby-bindings for 
openSUSE:Factory checked in at 2017-12-01 17:17:49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-ruby-bindings (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-ruby-bindings.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-ruby-bindings"

Fri Dec  1 17:17:49 2017 rev:86 rq:546777 version:4.0.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-ruby-bindings/yast2-ruby-bindings.changes  
2017-11-30 12:35:32.895392136 +0100
+++ 
/work/SRC/openSUSE:Factory/.yast2-ruby-bindings.new/yast2-ruby-bindings.changes 
    2017-12-01 17:17:51.186301103 +0100
@@ -1,0 +2,6 @@
+Fri Nov 24 14:26:14 UTC 2017 - mvid...@suse.com
+
+- Better backtrace for dynamically defined methods (bsc#1066290)
+- 4.0.2
+
+-------------------------------------------------------------------

Old:
----
  yast2-ruby-bindings-4.0.1.tar.bz2

New:
----
  yast2-ruby-bindings-4.0.2.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ yast2-ruby-bindings.spec ++++++
--- /var/tmp/diff_new_pack.d1LWMe/_old  2017-12-01 17:17:51.758280539 +0100
+++ /var/tmp/diff_new_pack.d1LWMe/_new  2017-12-01 17:17:51.758280539 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-ruby-bindings
-Version:        4.0.1
+Version:        4.0.2
 Release:        0
 Url:            https://github.com/yast/yast-ruby-bindings
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build

++++++ yast2-ruby-bindings-4.0.1.tar.bz2 -> yast2-ruby-bindings-4.0.2.tar.bz2 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-ruby-bindings-4.0.1/package/yast2-ruby-bindings.changes 
new/yast2-ruby-bindings-4.0.2/package/yast2-ruby-bindings.changes
--- old/yast2-ruby-bindings-4.0.1/package/yast2-ruby-bindings.changes   
2017-11-23 15:33:45.502444639 +0100
+++ new/yast2-ruby-bindings-4.0.2/package/yast2-ruby-bindings.changes   
2017-11-30 16:19:34.000000000 +0100
@@ -1,4 +1,10 @@
 -------------------------------------------------------------------
+Fri Nov 24 14:26:14 UTC 2017 - mvid...@suse.com
+
+- Better backtrace for dynamically defined methods (bsc#1066290)
+- 4.0.2
+
+-------------------------------------------------------------------
 Thu Nov 23 09:45:04 UTC 2017 - lsle...@suse.cz
 
 - Hardcode the Ruby version in the y2start script to always use
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-ruby-bindings-4.0.1/package/yast2-ruby-bindings.spec 
new/yast2-ruby-bindings-4.0.2/package/yast2-ruby-bindings.spec
--- old/yast2-ruby-bindings-4.0.1/package/yast2-ruby-bindings.spec      
2017-11-23 15:33:45.502444639 +0100
+++ new/yast2-ruby-bindings-4.0.2/package/yast2-ruby-bindings.spec      
2017-11-30 16:19:34.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-ruby-bindings
-Version:        4.0.1
+Version:        4.0.2
 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-4.0.1/src/ruby/yast/convert.rb 
new/yast2-ruby-bindings-4.0.2/src/ruby/yast/convert.rb
--- old/yast2-ruby-bindings-4.0.1/src/ruby/yast/convert.rb      2017-11-23 
15:33:45.562444639 +0100
+++ new/yast2-ruby-bindings-4.0.2/src/ruby/yast/convert.rb      2017-11-30 
16:19:34.000000000 +0100
@@ -37,11 +37,9 @@
     # @!method  self.to_locale(        object )
     #   @return        [String, nil]  *object*, or `nil` if it is not a String
     Ops::SHORTCUT_TYPES.each do |type|
-      eval <<END
-        def self.to_#{type}(object)
-          convert object, :from => "any", :to => "#{type}"
-        end
-END
+      define_singleton_method("to_#{type}") do |object|
+        convert object, :from => "any", :to => type
+      end
     end
 
     # Converts object from given type to target one.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-ruby-bindings-4.0.1/src/ruby/yast/ops.rb 
new/yast2-ruby-bindings-4.0.2/src/ruby/yast/ops.rb
--- old/yast2-ruby-bindings-4.0.1/src/ruby/yast/ops.rb  2017-11-23 
15:33:45.566444639 +0100
+++ new/yast2-ruby-bindings-4.0.2/src/ruby/yast/ops.rb  2017-11-30 
16:19:34.000000000 +0100
@@ -66,11 +66,9 @@
     # @!method                     self.get_locale(       obj, idx, def )
     #   @return [String, nil]   {Convert.to_locale}({get}(obj, idx, def))
     Ops::SHORTCUT_TYPES.each do |type|
-      eval <<END, binding, __FILE__, __LINE__ + 1
-        def self.get_#{type}(object, indexes, default=nil, &block)
-          Yast::Convert.to_#{type} get(object, indexes, default, 1, &block)
-        end
-END
+      define_singleton_method("get_#{type}") do |object, indexes, default=nil, 
&block|
+        Yast::Convert.public_send("to_#{type}", get(object, indexes, default, 
1, &block))
+      end
     end
 
     # To log the caller frame we need to skip 3 frames as 1 is method itself
@@ -404,17 +402,17 @@
     end
 
     TYPES_MAP.keys.each do |type|
-      class_eval "def self.is_#{type}? (object)
-        Ops.is(object, \"#{type}\")
-      end"
+      define_singleton_method("is_#{type}?") do |object|
+        Ops.is(object, type)
+      end
     end
 
     # Checks if object is given YCP type. There is also shorfcuts for most of 
types in
     # format is_<type>
     def self.is(object, type)
       type = "function" if type =~ /\(.*\)/ # reference to function
-      type.gsub!(/<.*>/, "")
-      type.gsub!(/\s+/, "")
+      type = type.gsub(/<.*>/, "")
+      type = type.gsub(/\s+/, "")
       classes = TYPES_MAP[type]
       raise "Invalid type to detect in is '#{type}'" unless classes
       classes = [classes] unless classes.is_a? ::Array
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-ruby-bindings-4.0.1/src/ruby/yast/wfm.rb 
new/yast2-ruby-bindings-4.0.2/src/ruby/yast/wfm.rb
--- old/yast2-ruby-bindings-4.0.1/src/ruby/yast/wfm.rb  2017-11-23 
15:33:45.610444639 +0100
+++ new/yast2-ruby-bindings-4.0.2/src/ruby/yast/wfm.rb  2017-11-30 
16:19:34.000000000 +0100
@@ -250,7 +250,8 @@
 
     # Handles a generic Exception
     private_class_method def self.handle_exception(e, client)
-      Builtins.y2error("Client call failed with '%1' (%2).\nBacktrace:\n%3",
+      Builtins.y2error("Client %1 failed with '%2' (%3).\nBacktrace:\n%4",
+        client,
         e.message,
         e.class,
         e.backtrace.join("\n"))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-ruby-bindings-4.0.1/src/ruby/yast/yast.rb 
new/yast2-ruby-bindings-4.0.2/src/ruby/yast/yast.rb
--- old/yast2-ruby-bindings-4.0.1/src/ruby/yast/yast.rb 2017-11-23 
15:33:45.614444639 +0100
+++ new/yast2-ruby-bindings-4.0.2/src/ruby/yast/yast.rb 2017-11-30 
16:19:34.000000000 +0100
@@ -191,21 +191,17 @@
     symbols(mname).each do |sname, stype|
       next if sname.empty?
       if stype == :function
-        m.module_eval <<-"END"
-          def self.#{sname}(*args)
-            caller(1,1).first.match BACKTRACE_REGEXP
-            return Yast::call_yast_function("#{mname}", :#{sname}, $1, 
$2.to_i, *args)
-          end
-        END
+        m.define_singleton_method(sname) do |*args|
+          caller(1,1).first.match BACKTRACE_REGEXP
+          next Yast::call_yast_function(mname, :"#{sname}", $1, $2.to_i, *args)
+        end
       elsif stype == :variable
-        m.module_eval <<-"END"
-          def self.#{sname}
-            return Yast::call_yast_function("#{mname}", :#{sname})
-          end
-          def self.#{sname}= (value)
-            return Yast::call_yast_function("#{mname}", :#{sname}, value)
-          end
-        END
+        m.define_singleton_method(sname) do
+          Yast::call_yast_function(mname, :"#{sname}")
+        end
+        m.define_method("#{sname}=") do |value|
+          Yast::call_yast_function(mname, :"#{sname}", value)
+        end
       end
     end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-ruby-bindings-4.0.1/tests/ops_spec.rb 
new/yast2-ruby-bindings-4.0.2/tests/ops_spec.rb
--- old/yast2-ruby-bindings-4.0.1/tests/ops_spec.rb     2017-11-23 
15:33:45.666444639 +0100
+++ new/yast2-ruby-bindings-4.0.2/tests/ops_spec.rb     2017-11-30 
16:19:34.000000000 +0100
@@ -201,6 +201,18 @@
       expect(Yast::Ops.get_integer(list, 0, "n")).to eq(nil)
     end
 
+    it "returns nil for index out of range" do
+      expect(Yast::Ops.get_string(list, 5)).to eq(nil)
+    end
+
+    it "returns the specified default" do
+      expect(Yast::Ops.get_string(list, 5, "c")).to eq("c")
+    end
+
+    it "returns the block-specified default" do
+      expect(Yast::Ops.get_string(list, 5){"n"}).to eq("n")
+    end
+
     it "warns when the container is nil" do
       any_frame = kind_of(Integer)
       expect(Yast).to receive(:y2milestone).with(any_frame, /called on nil/)


Reply via email to