ruby-qt6-rspec 2.1.0 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 32fc5f0aeccdc59ef4844766df0e5da248ab4d931be4d5e7e500ef5172de8476
4
- data.tar.gz: c938acd498e9b479c3b8985e18cbe96040085668ddef9d14969cb389a5f6476f
3
+ metadata.gz: b9f48e9bb6f936b33d5be9fd924daf88e1f8b0b73a9129d342183bbc6f89c3d0
4
+ data.tar.gz: d1c9ef69ae959c2b85a9475496b65d9042a13cdfe89930da3bb03508b21a0e7f
5
5
  SHA512:
6
- metadata.gz: d19feec79e483af0af2ce03e26fb04f88553aef11bff5675a0b6c1d0f2a6b6090a40612ceb7dbdf3e11037b13d123377196fd79bd910b57f91245cafc046f0d2
7
- data.tar.gz: 3162a2ed4f3f2f16bf84becea5fa1a49b573772d5d719662b3f1251008d1bf531411ce8748ce7e6067ece4380d6bb067ccb4cd4e5cc83bcfb33f148e9228ae86
6
+ metadata.gz: 14aba37e801e9693d55bf98e2eae01bbb09f64d1d7b668985f4ed1f7dcaa704be64048be24cbaa076fa3a6ede360b589575c649263220055d84d9f06dc77cbe7
7
+ data.tar.gz: 9613255594593f0fdd3388c49c9c4620e352428529506585c86628a72ceb68ec551ce3c2a31e485a61d46d69e650167ca3429d507d53ff4a3fdf89e306e4eba1
@@ -49,7 +49,7 @@ module RubyQt6
49
49
  end
50
50
  end
51
51
 
52
- while line == "" || line.start_with?("void Init_bando_q") || line == "{"
52
+ while line == "" || line.start_with?("void Init_bando_q", "void Init_bando_k") || line == "{"
53
53
  take_next_line
54
54
  end
55
55
  end
@@ -46,11 +46,11 @@ module RubyQt6
46
46
  raise MissingLine.new("Class rb_c...", line)
47
47
  end
48
48
 
49
- until line.start_with?("void Init_q")
49
+ until line.start_with?("void Init_q", "void Init_k")
50
50
  take_next_line
51
51
  end
52
52
 
53
- while line == "" || line.start_with?("void Init_q") || line == "{"
53
+ while line == "" || line.start_with?("void Init_q", "void Init_k") || line == "{"
54
54
  take_next_line
55
55
  end
56
56
  end
@@ -83,10 +83,10 @@ module RubyQt6
83
83
  raise MissingLine.new(expected, line)
84
84
  end
85
85
 
86
- if line.start_with?(/define_class_under<#{name}.*rb_mQt6#{qmod_name}, "#{name}"/)
86
+ if line.start_with?(/define_qlass_under<#{name}.*rb_mQt6#{qmod_name}, "#{name}"/)
87
87
  take_next_line
88
88
  else
89
- raise MissingLine.new("define_class_under<#{name}...", line)
89
+ raise MissingLine.new("define_qlass_under<#{name}...", line)
90
90
  end
91
91
 
92
92
  loop do
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RubyQt6
4
4
  module RSpec
5
- RSPEC_RUBYGEM_VERSION = "2.1.0"
5
+ RSPEC_RUBYGEM_VERSION = "6.1.0"
6
6
  end
7
7
  end
data/lib/qt6/rspec.rb CHANGED
@@ -8,8 +8,8 @@ module RubyQt6
8
8
  module RSpec
9
9
  VERIFY_QLASS_VIRTUAL_METHODS = [
10
10
  "event", "event_filter", # QObject
11
- "meta_object", # QObject
12
11
  "connect_notify", "disconnect_notify", # QObject
12
+ "parent", # QObject
13
13
  "paint_engine", # QPaintDevice
14
14
  "metric", # QPaintDevice
15
15
  "has_height_for_width", "height_for_width", # QWidget
@@ -29,12 +29,19 @@ module RubyQt6
29
29
  ]
30
30
  NO_VERIFY_QLASS_VIRTUAL_METHODS = {
31
31
  "QCoreApplication" => ["post_event", "send_event"],
32
+ "QItemSelectionRange" => ["parent"],
33
+ "QModelIndex" => ["parent"],
34
+ "QStandardItem" => ["parent"],
35
+ "QTreeWidgetItem" => ["parent"],
32
36
  "QLayoutItem" => ["has_height_for_width", "height_for_width", "maximum_size", "minimum_size", "size_hint"],
33
37
  "QLayout" => ["maximum_size", "minimum_size"],
34
38
  "QWidget" => ["maximum_size", "minimum_size", "minimum_size_hint", "size_hint"],
35
39
  "QWindow" => ["maximum_size", "minimum_size"]
36
40
  }
37
41
  NO_VERIFY_QLASS_LEADING_UNDERSCORE_METHODS = {
42
+ "QSortFilterProxyModel" => ["_parent"],
43
+ "QFileSystemModel" => ["_parent"],
44
+ "QStandardItemModel" => ["_parent"],
38
45
  "QObject" => ["_connect", "_disconnect"],
39
46
  "QApplication" => ["_all_widgets", "_top_level_widgets"]
40
47
  }
@@ -140,6 +147,7 @@ module RubyQt6
140
147
 
141
148
  return if rbfile_contents.nil?
142
149
  return if rbfile_contents.include?("# @see https://doc.qt.io/qt-6/#{qlass.name.downcase}.html")
150
+ return if rbfile_contents.include?("# @see https://api.kde.org/#{qlass.name.downcase}.html")
143
151
  raise "#{rbfile}: docs: Missing `# @see https://doc.qt.io/qt-6/...`"
144
152
  end
145
153
 
@@ -283,6 +291,14 @@ module RubyQt6
283
291
  rbfile_metamethods = rbfile_contents.scan(/(signal|slot) "(.*)"/).map { |method| method[1] }
284
292
  rbfile_metamethods = rbfile_metamethods.map { |method| method.split("(")[0] }.uniq
285
293
  raise "#{rbfile}: q_object: Mismatch `#{rbfile_metamethods}` != `#{metamethods}`" if rbfile_metamethods != metamethods
294
+
295
+ meth = qlass.methods.find { |method| method.type == :rubyqt6_defined_functions && method.rbname == "_qobject_cast" }
296
+ raise "#{cppfile}: Method _qobject_cast is missing" if meth.nil?
297
+ raise "#{cppfile}: Method _qobject_cast invalid" unless meth.rawline.include?("[](QObject *object) -> const #{qlass.name} * { return qobject_cast<#{qlass.name} *>(object); })")
298
+
299
+ meth = qlass.methods.find { |method| method.type == :rubyqt6_defined_functions && method.rbname == "_static_meta_object" }
300
+ raise "#{cppfile}: Method _static_meta_object is missing" if meth.nil?
301
+ raise "#{cppfile}: Method _static_meta_object invalid" unless meth.rawline.include?("[]() -> const QMetaObject * { return &#{qlass.name}::staticMetaObject; })")
286
302
  end
287
303
  end
288
304
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-qt6-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 6.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Doe