Hello community,
here is the log from the commit of package yast2-ruby-bindings for
openSUSE:Factory checked in at 2013-07-21 08:16:10
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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
2013-07-04 18:07:39.000000000 +0200
+++
/work/SRC/openSUSE:Factory/.yast2-ruby-bindings.new/yast2-ruby-bindings.changes
2013-07-21 08:16:11.000000000 +0200
@@ -1,0 +2,16 @@
+Wed Jul 17 11:26:35 UTC 2013 - [email protected]
+
+- added Ops.get_* shortcut methods (dmajda)
+- fix detecting of complex path in the last segment (jreidinger)
+- unload client class after running it to fully initialize includes
+ in the next run (gh#yast/ycp-killer#504)
+- 1.1.5
+
+-------------------------------------------------------------------
+Tue Jul 9 08:57:21 UTC 2013 - [email protected]
+
+- fix calling methods on namespace that is already used as nested
+ namespace (gh#yast/ycp-killer#465)
+- 1.1.4
+
+-------------------------------------------------------------------
Old:
----
yast2-ruby-bindings-1.1.3.tar.bz2
New:
----
yast2-ruby-bindings-1.1.5.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-ruby-bindings.spec ++++++
--- /var/tmp/diff_new_pack.QSInb7/_old 2013-07-21 08:16:12.000000000 +0200
+++ /var/tmp/diff_new_pack.QSInb7/_new 2013-07-21 08:16:12.000000000 +0200
@@ -21,7 +21,7 @@
#
Name: yast2-ruby-bindings
-Version: 1.1.3
+Version: 1.1.5
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source0: yast2-ruby-bindings-%{version}.tar.bz2
++++++ yast2-ruby-bindings-1.1.3.tar.bz2 -> yast2-ruby-bindings-1.1.5.tar.bz2
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-ruby-bindings-1.1.3/VERSION.cmake
new/yast2-ruby-bindings-1.1.5/VERSION.cmake
--- old/yast2-ruby-bindings-1.1.3/VERSION.cmake 2013-07-04 11:53:18.000000000
+0200
+++ new/yast2-ruby-bindings-1.1.5/VERSION.cmake 2013-07-17 14:00:56.000000000
+0200
@@ -1,3 +1,3 @@
SET(VERSION_MAJOR "1")
SET(VERSION_MINOR "1")
-SET(VERSION_PATCH "3")
+SET(VERSION_PATCH "5")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-ruby-bindings-1.1.3/package/yast2-ruby-bindings.changes
new/yast2-ruby-bindings-1.1.5/package/yast2-ruby-bindings.changes
--- old/yast2-ruby-bindings-1.1.3/package/yast2-ruby-bindings.changes
2013-07-04 11:53:18.000000000 +0200
+++ new/yast2-ruby-bindings-1.1.5/package/yast2-ruby-bindings.changes
2013-07-17 14:00:56.000000000 +0200
@@ -1,4 +1,20 @@
-------------------------------------------------------------------
+Wed Jul 17 11:26:35 UTC 2013 - [email protected]
+
+- added Ops.get_* shortcut methods (dmajda)
+- fix detecting of complex path in the last segment (jreidinger)
+- unload client class after running it to fully initialize includes
+ in the next run (gh#yast/ycp-killer#504)
+- 1.1.5
+
+-------------------------------------------------------------------
+Tue Jul 9 08:57:21 UTC 2013 - [email protected]
+
+- fix calling methods on namespace that is already used as nested
+ namespace (gh#yast/ycp-killer#465)
+- 1.1.4
+
+-------------------------------------------------------------------
Thu Jul 4 09:13:59 UTC 2013 - [email protected]
- allow passing single value to Ops.index and Ops.assign
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-ruby-bindings-1.1.3/package/yast2-ruby-bindings.spec
new/yast2-ruby-bindings-1.1.5/package/yast2-ruby-bindings.spec
--- old/yast2-ruby-bindings-1.1.3/package/yast2-ruby-bindings.spec
2013-07-04 11:54:03.000000000 +0200
+++ new/yast2-ruby-bindings-1.1.5/package/yast2-ruby-bindings.spec
2013-07-17 14:01:35.000000000 +0200
@@ -1,31 +1,48 @@
+#
+# spec file for package yast2-ruby-bindings
+#
+# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
+#
+# All modifications and additions to the file contributed by third parties
+# remain the property of their copyright owners, unless otherwise agreed
+# upon. The license for this file, and modifications and additions to the
+# file, is the same license as for the pristine package itself (unless the
+# license for the pristine package is not an Open Source License, in which
+# case the license is the MIT License). An "Open Source License" is a
+# license that conforms to the Open Source Definition (Version 1.9)
+# published by the Open Source Initiative.
+
+# Please submit bugfixes or comments via http://bugs.opensuse.org/
+#
#
# spec file for package yast2-ruby-bindings (Version 0.1)
#
-# norootforbuild
Name: yast2-ruby-bindings
-Version: 1.1.3
+Version: 1.1.5
Release: 0
-License: GPL-2.0
-Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source0: yast2-ruby-bindings-%{version}.tar.bz2
Prefix: /usr
-BuildRequires: cmake gcc-c++ yast2-core-devel
+BuildRequires: cmake
+BuildRequires: gcc-c++
+BuildRequires: yast2-core-devel
BuildRequires: yast2-devtools >= 2.16.3
# libzypp-devel is missing .la requires
-BuildRequires: ruby-devel
-BuildRequires: rubygem-fast_gettext
-Requires: rubygem-fast_gettext
-Requires: yast2-core >= 2.24.0
+BuildRequires: ruby-devel
+BuildRequires: rubygem-fast_gettext
+Requires: rubygem-fast_gettext
+Requires: yast2-core >= 2.24.0
BuildRequires: yast2-core-devel >= 2.24.0
Requires: yast2-ycp-ui-bindings >= 2.21.9
BuildRequires: yast2-ycp-ui-bindings-devel >= 2.21.9
-Requires: ruby
-Summary: Ruby bindings for the YaST platform
+Requires: ruby
+Summary: Ruby bindings for the YaST platform
+License: GPL-2.0
+Group: System/YaST
%description
The bindings allow YaST modules to be written using the Ruby language
@@ -65,3 +82,5 @@
%{_libdir}/ruby/vendor_ruby/%{rb_ver}/yast
%{_libdir}/ruby/vendor_ruby/%{rb_ver}/%{rb_arch}/*x.so
%{_libdir}/ruby/vendor_ruby/%{rb_ver}/%{rb_arch}/yast
+
+%changelog
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-ruby-bindings-1.1.3/src/ruby/yast/convert.rb
new/yast2-ruby-bindings-1.1.5/src/ruby/yast/convert.rb
--- old/yast2-ruby-bindings-1.1.3/src/ruby/yast/convert.rb 2013-06-20
22:20:53.000000000 +0200
+++ new/yast2-ruby-bindings-1.1.5/src/ruby/yast/convert.rb 2013-07-17
10:20:54.000000000 +0200
@@ -7,8 +7,7 @@
module Convert
#generate shortcuts
- [ "boolean", "string", "symbol", "integer", "float", "list", "map",
- "term", "path", "locale" ].each do |type|
+ Ops::SHORTCUT_TYPES.each do |type|
eval <<END
def self.to_#{type}(object)
convert object, :from => "any", :to => "#{type}"
@@ -17,8 +16,8 @@
end
def self.convert(object, options)
- from = options[:from]
- to = options[:to]
+ from = options[:from].dup
+ to = options[:to].dup
#ignore whitespaces and specialization in types
to.gsub!(/<.*>/, "")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-ruby-bindings-1.1.3/src/ruby/yast/ops.rb
new/yast2-ruby-bindings-1.1.5/src/ruby/yast/ops.rb
--- old/yast2-ruby-bindings-1.1.3/src/ruby/yast/ops.rb 2013-07-02
14:46:32.000000000 +0200
+++ new/yast2-ruby-bindings-1.1.5/src/ruby/yast/ops.rb 2013-07-17
10:20:54.000000000 +0200
@@ -29,7 +29,34 @@
'byteblock' => Yast::Byteblock
}
- def self.index (object, indexes, default=nil)
+ # Types for which we generate shortcut methods, e.g. Ops.get_string or
+ # Convert.to_string.
+ SHORTCUT_TYPES = [
+ "boolean",
+ "string",
+ "symbol",
+ "integer",
+ "float",
+ "list",
+ "map",
+ "term",
+ "path",
+ "locale"
+ ]
+
+ Ops::SHORTCUT_TYPES.each do |type|
+ eval <<END
+ def self.get_#{type}(*args, &block)
+ Yast::Convert.to_#{type} get(*args, &block)
+ end
+END
+ end
+
+ def self.index (*args, &block)
+ get *args, &block
+ end
+
+ def self.get (object, indexes, default=nil)
res = object
default = Yast.deep_copy(default)
indexes = [indexes] unless indexes.is_a? ::Array
@@ -65,7 +92,11 @@
return Yast.deep_copy(res)
end
- def self.assign (object, indexes, value)
+ def self.assign(*args)
+ set *args
+ end
+
+ def self.set (object, indexes, value)
return if indexes.nil? || object.nil?
indexes = [indexes] unless indexes.is_a? ::Array
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-ruby-bindings-1.1.3/src/ruby/yast/path.rb
new/yast2-ruby-bindings-1.1.5/src/ruby/yast/path.rb
--- old/yast2-ruby-bindings-1.1.3/src/ruby/yast/path.rb 2013-06-28
09:01:39.000000000 +0200
+++ new/yast2-ruby-bindings-1.1.5/src/ruby/yast/path.rb 2013-07-12
10:25:58.000000000 +0200
@@ -72,16 +72,9 @@
when :simple
if c == '.'
state = :dot
- if buffer.start_with?("-") || buffer.end_with?("-")
- Yast.y2error "Cannot have dash before or after dot '#{value}'"
- @components.clear
- return
- end
- if buffer =~ COMPLEX_CHAR_REGEX # we can get unescaped complex
path from topath builtin
- buffer.gsub!(/"/,"\\\"")
- buffer = "\"#{buffer}\""
- end
- @components << buffer
+ return if invalid_buffer?(buffer)
+
+ @components << modify_buffer(buffer)
buffer = ""
next
end
@@ -107,8 +100,31 @@
end
end
end
- # do not forget to pass content of remainint component
- @components << buffer unless buffer.empty?
+
+ unless buffer.empty?
+ return if invalid_buffer?(buffer)
+
+ @components << modify_buffer(buffer)
+ end
+ end
+
+ def invalid_buffer? buffer
+ if buffer.start_with?("-") || buffer.end_with?("-")
+ Yast.y2error "Cannot have dash before or after dot '#{value}'"
+ @components.clear
+ return true
+ end
+
+ false
+ end
+
+ def modify_buffer buffer
+ if buffer =~ COMPLEX_CHAR_REGEX # we can get unescaped complex path from
topath builtin
+ buffer = buffer.gsub(/"/,"\\\"")
+ buffer = "\"#{buffer}\""
+ end
+
+ buffer
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-ruby-bindings-1.1.3/src/ruby/yast/wfm.rb
new/yast2-ruby-bindings-1.1.5/src/ruby/yast/wfm.rb
--- old/yast2-ruby-bindings-1.1.3/src/ruby/yast/wfm.rb 2013-06-24
09:15:53.000000000 +0200
+++ new/yast2-ruby-bindings-1.1.5/src/ruby/yast/wfm.rb 2013-07-17
14:00:56.000000000 +0200
@@ -86,6 +86,21 @@
e.backtrace
)
return nil
+ ensure
+ # unload the client class to ensure that the includes will be
+ # fully initialized when running it next time
+ # (Yast.include skips initialize_<include> calls when the include
+ # module is already present in the target class)
+ client_without_suffix = File.basename(client).sub(/\.rb$/, "")
+ client_name = (client_without_suffix.
+ gsub(/^./) { |s| s.upcase }.
+ gsub(/[-_.]./) { |s| s[1].upcase } +
+ "Client").to_sym
+
+ if Yast.constants.include?(client_name)
+ Yast.y2debug "Unloading client class #{client_name}"
+ Yast.send(:remove_const, client_name)
+ end
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-ruby-bindings-1.1.3/src/ruby/yast/yast.rb
new/yast2-ruby-bindings-1.1.5/src/ruby/yast/yast.rb
--- old/yast2-ruby-bindings-1.1.3/src/ruby/yast/yast.rb 2013-07-02
13:18:57.000000000 +0200
+++ new/yast2-ruby-bindings-1.1.5/src/ruby/yast/yast.rb 2013-07-09
11:00:58.000000000 +0200
@@ -95,13 +95,20 @@
base = tmp_m
end
- # do not reimport if already imported
- return if base.constants.include?(modules.last.to_sym)
+ # do not reimport if already imported and contain some methods
+ # ( in case namespace contain some methods )
+ if base.constants.include?(modules.last.to_sym) &&
+ !(base.const_get(modules.last).methods - Object.methods()).empty?
+ return
+ end
import_pure(mname)
# do not create wrapper if module is in ruby and define itself object
- return if base.constants.include?(modules.last.to_sym)
+ if base.constants.include?(modules.last.to_sym) &&
+ !(base.const_get(modules.last).methods - Object.methods()).empty?
+ return
+ end
m = ::Module.new
symbols(mname).each do |sname,stype|
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-ruby-bindings-1.1.3/tests/ruby/ops_test.rb
new/yast2-ruby-bindings-1.1.5/tests/ruby/ops_test.rb
--- old/yast2-ruby-bindings-1.1.3/tests/ruby/ops_test.rb 2013-07-02
14:46:32.000000000 +0200
+++ new/yast2-ruby-bindings-1.1.5/tests/ruby/ops_test.rb 2013-07-17
10:20:54.000000000 +0200
@@ -4,6 +4,7 @@
require "test_helper"
require "yast/ops"
+require "yast/convert"
require "yast/path"
require "yast/term"
@@ -200,6 +201,12 @@
assert_equal "n", Yast::Ops.index(list,[0,0],"n")
end
+ def test_get_shortcuts
+ list = ["a","b"]
+ assert_equal("a", Yast::Ops.get_string(list,0,"n"))
+ assert_equal(nil, Yast::Ops.get_integer(list,0,"n"))
+ end
+
def test_assign
l = nil
Yast::Ops.assign(l,[1,2],5)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-ruby-bindings-1.1.3/tests/ruby/path_test.rb
new/yast2-ruby-bindings-1.1.5/tests/ruby/path_test.rb
--- old/yast2-ruby-bindings-1.1.3/tests/ruby/path_test.rb 2013-06-21
11:34:12.000000000 +0200
+++ new/yast2-ruby-bindings-1.1.5/tests/ruby/path_test.rb 2013-07-12
10:25:58.000000000 +0200
@@ -6,7 +6,7 @@
class PathTest < Yast::TestCase
def test_initialize
assert_equal ".etc", Yast::Path.new(".etc").to_s
- assert_equal '."et?c"', Yast::Path.new('."et?c"').to_s
+ assert_equal '."et?c"', Yast::Path.new('.et?c').to_s
end
def test_load_from_string
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]