ruby-qt6-rspec 2.1.0 → 6.0.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: 7fbcd5cbd6dfd31f9edb28a0e5576607c17e7c2e803e43db515c31ceea0de7a1
4
+ data.tar.gz: ffde495e82226cbd878290b4eb2d7aff01885d3187628b6330bc1aa5451d521c
5
5
  SHA512:
6
- metadata.gz: d19feec79e483af0af2ce03e26fb04f88553aef11bff5675a0b6c1d0f2a6b6090a40612ceb7dbdf3e11037b13d123377196fd79bd910b57f91245cafc046f0d2
7
- data.tar.gz: 3162a2ed4f3f2f16bf84becea5fa1a49b573772d5d719662b3f1251008d1bf531411ce8748ce7e6067ece4380d6bb067ccb4cd4e5cc83bcfb33f148e9228ae86
6
+ metadata.gz: 2826989b192638079818e8c660b88bfafac82369793732be5a82733b408782ee01789a02dffc89689285117c42a72a6134ed2e17cade8c164a95e16521ab7f3b
7
+ data.tar.gz: 749d88cc076324a586c238e0ea36347adc3c75050a76fe6fa33a1f0bf378e78ccc13e53ecef95abceb1e4795404826f04c5d42801cc8ebc58dfa5acf792b1283
@@ -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.0.0"
6
6
  end
7
7
  end
data/lib/qt6/rspec.rb CHANGED
@@ -8,7 +8,6 @@ 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
13
12
  "paint_engine", # QPaintDevice
14
13
  "metric", # QPaintDevice
@@ -140,6 +139,7 @@ module RubyQt6
140
139
 
141
140
  return if rbfile_contents.nil?
142
141
  return if rbfile_contents.include?("# @see https://doc.qt.io/qt-6/#{qlass.name.downcase}.html")
142
+ return if rbfile_contents.include?("# @see https://api.kde.org/#{qlass.name.downcase}.html")
143
143
  raise "#{rbfile}: docs: Missing `# @see https://doc.qt.io/qt-6/...`"
144
144
  end
145
145
 
@@ -283,6 +283,14 @@ module RubyQt6
283
283
  rbfile_metamethods = rbfile_contents.scan(/(signal|slot) "(.*)"/).map { |method| method[1] }
284
284
  rbfile_metamethods = rbfile_metamethods.map { |method| method.split("(")[0] }.uniq
285
285
  raise "#{rbfile}: q_object: Mismatch `#{rbfile_metamethods}` != `#{metamethods}`" if rbfile_metamethods != metamethods
286
+
287
+ meth = qlass.methods.find { |method| method.type == :rubyqt6_defined_functions && method.rbname == "_qobject_cast" }
288
+ raise "#{cppfile}: Method _qobject_cast is missing" if meth.nil?
289
+ raise "#{cppfile}: Method _qobject_cast invalid" unless meth.rawline.include?("[](QObject *object) -> const #{qlass.name} * { return qobject_cast<#{qlass.name} *>(object); })")
290
+
291
+ meth = qlass.methods.find { |method| method.type == :rubyqt6_defined_functions && method.rbname == "_static_meta_object" }
292
+ raise "#{cppfile}: Method _static_meta_object is missing" if meth.nil?
293
+ raise "#{cppfile}: Method _static_meta_object invalid" unless meth.rawline.include?("[]() -> const QMetaObject * { return &#{qlass.name}::staticMetaObject; })")
286
294
  end
287
295
  end
288
296
  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.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Doe