Hello community,

here is the log from the commit of package yast2-ruby-bindings for 
openSUSE:Factory checked in at 2014-03-01 14:38:20
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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  
2014-02-21 13:48:19.000000000 +0100
+++ 
/work/SRC/openSUSE:Factory/.yast2-ruby-bindings.new/yast2-ruby-bindings.changes 
    2014-03-01 14:38:21.000000000 +0100
@@ -1,0 +2,20 @@
+Thu Feb 27 12:10:11 UTC 2014 - [email protected]
+
+- fix precedence of loading files in lib
+- 3.1.13
+
+-------------------------------------------------------------------
+Wed Feb 26 12:22:48 UTC 2014 - [email protected]
+
+- added N_() and Nn_() gettext equivalents (to only mark a text
+  for translation)
+- 3.1.12
+
+-------------------------------------------------------------------
+Thu Feb 20 07:58:32 UTC 2014 - [email protected]
+
+- always log full backtrace when type conversion failed, to help
+  with debugging
+- 3.1.11
+
+-------------------------------------------------------------------

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

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

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

Other differences:
------------------
++++++ yast2-ruby-bindings.spec ++++++
--- /var/tmp/diff_new_pack.NRhbns/_old  2014-03-01 14:38:22.000000000 +0100
+++ /var/tmp/diff_new_pack.NRhbns/_new  2014-03-01 14:38:22.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-ruby-bindings
-Version:        3.1.10
+Version:        3.1.13
 Release:        0
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 Source0:        yast2-ruby-bindings-%{version}.tar.bz2

++++++ yast2-ruby-bindings-3.1.10.tar.bz2 -> yast2-ruby-bindings-3.1.13.tar.bz2 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-ruby-bindings-3.1.10/package/yast2-ruby-bindings.changes 
new/yast2-ruby-bindings-3.1.13/package/yast2-ruby-bindings.changes
--- old/yast2-ruby-bindings-3.1.10/package/yast2-ruby-bindings.changes  
2014-02-19 13:30:29.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.13/package/yast2-ruby-bindings.changes  
2014-02-27 16:11:12.000000000 +0100
@@ -1,4 +1,24 @@
 -------------------------------------------------------------------
+Thu Feb 27 12:10:11 UTC 2014 - [email protected]
+
+- fix precedence of loading files in lib
+- 3.1.13
+
+-------------------------------------------------------------------
+Wed Feb 26 12:22:48 UTC 2014 - [email protected]
+
+- added N_() and Nn_() gettext equivalents (to only mark a text
+  for translation)
+- 3.1.12
+
+-------------------------------------------------------------------
+Thu Feb 20 07:58:32 UTC 2014 - [email protected]
+
+- always log full backtrace when type conversion failed, to help
+  with debugging
+- 3.1.11
+
+-------------------------------------------------------------------
 Mon Feb 17 10:34:13 UTC 2014 - [email protected]
 
 - fix stack level too deep (BNC#864056,BNC#864180)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-ruby-bindings-3.1.10/package/yast2-ruby-bindings.spec 
new/yast2-ruby-bindings-3.1.13/package/yast2-ruby-bindings.spec
--- old/yast2-ruby-bindings-3.1.10/package/yast2-ruby-bindings.spec     
2014-02-19 13:30:29.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.13/package/yast2-ruby-bindings.spec     
2014-02-27 16:11:12.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-ruby-bindings
-Version:        3.1.10
+Version:        3.1.13
 Release:        0
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 Source0:        yast2-ruby-bindings-%{version}.tar.bz2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-ruby-bindings-3.1.10/src/ruby/yast/convert.rb 
new/yast2-ruby-bindings-3.1.13/src/ruby/yast/convert.rb
--- old/yast2-ruby-bindings-3.1.10/src/ruby/yast/convert.rb     2014-02-19 
13:30:29.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.13/src/ruby/yast/convert.rb     2014-02-27 
16:11:12.000000000 +0100
@@ -38,7 +38,7 @@
       return object if from == to
 
       if from == "any" && allowed_type(object,to)
-        return object 
+        return object
       elsif to == "float"
         return nil unless (object.is_a? Fixnum) || (object.is_a? Bignum)
         return object.to_f
@@ -51,7 +51,7 @@
       elsif to == "string" && from == "locale"
         return object
       else
-        Yast.y2warning "Cannot convert #{object.class} from '#{from}' to 
'#{to}'"
+        Yast.y2warning -1, "Cannot convert #{object.class} from '#{from}' to 
'#{to}'"
         return nil
       end
     end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-ruby-bindings-3.1.10/src/ruby/yast/i18n.rb 
new/yast2-ruby-bindings-3.1.13/src/ruby/yast/i18n.rb
--- old/yast2-ruby-bindings-3.1.10/src/ruby/yast/i18n.rb        2014-02-19 
13:30:29.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.13/src/ruby/yast/i18n.rb        2014-02-27 
16:11:12.000000000 +0100
@@ -48,6 +48,43 @@
       FastGettext.text_domain = old_text_domain
     end
 
+    # No translation, only marks the text to be found by gettext when creating 
POT file,
+    # the text needs to be translated by {#_} later.
+    #
+    # @example Error messages
+    #  begin
+    #    # does not translate, the exception contains the untranslated string,
+    #    # but it's recognized by gettext like normal _()
+    #    raise FooError, N_("Foo failed.")
+    #  rescue FooError => e
+    #    # log the original (untranslated) error
+    #    log.error e.message
+    #
+    #    # but display translated error to the user,
+    #    # _() does the actual translation
+    #    Popup.Error(_(e.message))
+    #  end
+    #
+    # @example Translating Constants
+    #  class Foo
+    #    # ERROR_MSG will not be translated, but the string will be found
+    #    # by gettext when creating the POT file
+    #    ERROR_MSG = N_("Something failed")
+    #  end
+    #
+    #  # here the string will be translated using the current locale
+    #  puts _(Foo::ERROR_MSG)
+    #
+    def N_(str)
+      str
+    end
+
+    # No translation, only marks the texts to be found by gettext when 
creating POT file,
+    # the texts need to be translated by {#n_} later.
+    def Nn_(*keys)
+      keys
+    end
+
     # Gets translation based on number.
     # @param (String) singular text for translators for single value
     # @param (String) plural text for translators for bigger value
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-ruby-bindings-3.1.10/src/ruby/yast.rb 
new/yast2-ruby-bindings-3.1.13/src/ruby/yast.rb
--- old/yast2-ruby-bindings-3.1.10/src/ruby/yast.rb     2014-02-19 
13:30:29.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.13/src/ruby/yast.rb     2014-02-27 
16:11:12.000000000 +0100
@@ -44,8 +44,9 @@
 require "yast/ui_shortcuts"
 require "yast/wfm"
 
-#add yast specific path for ruby libraries, similar to lib directory in rails
-Yast.y2paths.each do |p|
+# add yast specific path for ruby libraries, similar to lib directory in rails
+# unshift it in reverse order to keep precedence
+Yast.y2paths.reverse.each do |p|
   dir_path = File.join(p, "lib")
   if File.exists? dir_path
     $LOAD_PATH.unshift dir_path
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-ruby-bindings-3.1.10/tests/ruby/CMakeLists.txt 
new/yast2-ruby-bindings-3.1.13/tests/ruby/CMakeLists.txt
--- old/yast2-ruby-bindings-3.1.10/tests/ruby/CMakeLists.txt    2014-02-19 
13:30:29.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.13/tests/ruby/CMakeLists.txt    2014-02-27 
16:11:12.000000000 +0100
@@ -14,5 +14,5 @@
 FILE(GLOB Specs "*_spec.rb")
 
 foreach(test ${Specs})
-    ADD_TEST(${test}   rspec ${test})
+    ADD_TEST(${test}   rspec --format doc ${test})
 endforeach(test)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-ruby-bindings-3.1.10/tests/ruby/i18n_spec.rb 
new/yast2-ruby-bindings-3.1.13/tests/ruby/i18n_spec.rb
--- old/yast2-ruby-bindings-3.1.10/tests/ruby/i18n_spec.rb      1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.13/tests/ruby/i18n_spec.rb      2014-02-27 
16:11:12.000000000 +0100
@@ -0,0 +1,30 @@
+#!/usr/bin/env rspec
+
+require_relative "test_helper_rspec"
+
+require "yast"
+
+include Yast::I18n
+
+module Yast
+  describe I18n do
+
+    describe ".N_" do
+      it "returns the original parameter" do
+        input = "INPUT TEST"
+        expect(N_(input)).to be input
+      end
+    end
+
+    describe ".Nn_" do
+      it "returns the original parameters" do
+        singular = "singular"
+        plural = "plural"
+        count = 42
+
+        expect(Nn_(singular, plural, count)).to eq [singular, plural, count]
+      end
+    end
+
+  end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-ruby-bindings-3.1.10/tests/ruby/import_test.rb 
new/yast2-ruby-bindings-3.1.13/tests/ruby/import_test.rb
--- old/yast2-ruby-bindings-3.1.10/tests/ruby/import_test.rb    2014-02-19 
13:30:29.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.13/tests/ruby/import_test.rb    1970-01-01 
01:00:00.000000000 +0100
@@ -1,25 +0,0 @@
-#
-# Test Ycp.import
-#
-
-require_relative "test_helper_test_unit"
-
-require "yast"
-
-class YcpImportTest < Yast::TestCase
-  def test_import
-    Yast.import( "ExampleTestModule" )
-    assert Yast::ExampleTestModule.respond_to?(:sparc_map)
-    assert Yast::ExampleTestModule.respond_to?(:is_xen)
-    assert Yast::ExampleTestModule.respond_to?(:arch_short)
-    assert Yast::ExampleTestModule.respond_to?(:example_string)
-    assert Yast::ExampleTestModule.respond_to?(:example_string=)
-  end
-
-  def test_method_call
-    Yast.import "ExampleTestModule"
-    assert_equal false, Yast::ExampleTestModule.is_xen
-    assert_equal "ZX Spectrum", Yast::ExampleTestModule.arch_short
-    assert_equal ({"one" => 1, "two" => 2}), Yast::ExampleTestModule.sparc_map
-  end
-end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-ruby-bindings-3.1.10/tests/ruby/include_test.rb 
new/yast2-ruby-bindings-3.1.13/tests/ruby/include_test.rb
--- old/yast2-ruby-bindings-3.1.10/tests/ruby/include_test.rb   2014-02-19 
13:30:29.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.13/tests/ruby/include_test.rb   1970-01-01 
01:00:00.000000000 +0100
@@ -1,46 +0,0 @@
-#
-# Test Ycp.import
-#
-
-require_relative "test_helper_test_unit"
-
-require "yast"
-
-module Yast
-  class IncludeTest < Module
-    def initialize
-      @test = 5
-      Yast.include self, "example.rb"
-    end
-
-    attr_reader :test
-  end
-  IT = IncludeTest.new
-
-  class DoubleIncludeTest < Module
-    def initialize
-      Yast.include self, "example.rb"
-      @test = 5
-      # second include should not call again init, so @test is kept to 5
-      Yast.include self, "example.rb"
-    end
-
-    attr_reader :test
-  end
-  DIT = DoubleIncludeTest.new
-end
-
-
-class IncludeTest < Yast::TestCase
-  def test_include
-    assert_equal 15, Yast::IT.test
-  end
-
-  def test_included_method_call
-    assert_equal 20, Yast::IT.test_plus_five
-  end
-
-  def test_double_include
-    assert_equal 5, Yast::DIT.test
-  end
-end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-ruby-bindings-3.1.10/tests/ruby/test_module/include/cyclic_yang.rb 
new/yast2-ruby-bindings-3.1.13/tests/ruby/test_module/include/cyclic_yang.rb
--- 
old/yast2-ruby-bindings-3.1.10/tests/ruby/test_module/include/cyclic_yang.rb    
    1970-01-01 01:00:00.000000000 +0100
+++ 
new/yast2-ruby-bindings-3.1.13/tests/ruby/test_module/include/cyclic_yang.rb    
    2014-02-27 16:11:12.000000000 +0100
@@ -0,0 +1,11 @@
+module Yast
+  module CyclicYangInclude
+    def initialize_cyclic_yang(include_target)
+      Yast.include include_target, "cyclic_yin.rb"
+    end
+
+    def yang
+      "YANG"
+    end
+  end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-ruby-bindings-3.1.10/tests/ruby/test_module/include/cyclic_yin.rb 
new/yast2-ruby-bindings-3.1.13/tests/ruby/test_module/include/cyclic_yin.rb
--- old/yast2-ruby-bindings-3.1.10/tests/ruby/test_module/include/cyclic_yin.rb 
1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.13/tests/ruby/test_module/include/cyclic_yin.rb 
2014-02-27 16:11:12.000000000 +0100
@@ -0,0 +1,11 @@
+module Yast
+  module CyclicYinInclude
+    def initialize_cyclic_yin(include_target)
+      Yast.include include_target, "cyclic_yang.rb"
+    end
+
+    def yin
+      "YIN"
+    end
+  end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-ruby-bindings-3.1.10/tests/ruby/yast_spec.rb 
new/yast2-ruby-bindings-3.1.13/tests/ruby/yast_spec.rb
--- old/yast2-ruby-bindings-3.1.10/tests/ruby/yast_spec.rb      1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.13/tests/ruby/yast_spec.rb      2014-02-27 
16:11:12.000000000 +0100
@@ -0,0 +1,49 @@
+#!/usr/bin/env rspec
+
+require_relative "test_helper_rspec"
+
+require "yast"
+
+describe Yast do
+  describe ".include" do
+    it "include methods to target class set as first argument" do
+      include_test = Class.new Yast::Module
+      include_test_instance = include_test.new
+
+      Yast.include(include_test_instance, "example.rb")
+
+      expect(include_test_instance).to be_respond_to(:test_plus_five)
+    end
+
+    it "call its initialization method" do
+      include_test = Class.new Yast::Module
+      include_test.send(:define_method, :initialize) do
+        @test = 5
+        # initialization set @test value to 15
+        Yast.include self, "example.rb"
+      end
+      include_test.send(:attr_reader, :test)
+      include_test_instance = include_test.new
+
+      expect(include_test_instance.test).to be 15
+    end
+
+    it "call its initialization only during first include" do
+      include_test = Class.new Yast::Module
+      include_test.send(:define_method, :initialize) do
+        Yast.include self, "example.rb"
+        @test = 5
+        # second initialization should no set @test value to 15
+        Yast.include self, "example.rb"
+      end
+      include_test.send(:attr_reader, :test)
+      include_test_instance = include_test.new
+
+      expect(include_test_instance.test).to be 5
+    end
+
+    it "does not loop endlessly on cyclic includes" do
+      expect { Yast.include(Class.new.new, "cyclic_yin.rb") }.not_to 
raise_error
+    end
+  end
+end

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to