File: patch.rb

package info (click to toggle)
mikutter 5.0.4%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 9,700 kB
  • sloc: ruby: 21,307; sh: 181; makefile: 19
file content (23 lines) | stat: -rw-r--r-- 880 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

# ruby-gnome 3.5.0 早くでないかなー!!
if GLib::BINDING_VERSION < [3, 5, 0]
  # 直接のスーパークラスより上の祖先が持つvfuncを実装できないバグの修正
  # https://github.com/ruby-gnome/ruby-gnome/pull/1433
  module GObjectIntrospection::Loader::VirtualFunctionImplementable
    def implement_virtual_function(implementor_class, name)
      unless instance_variable_defined?(:@virtual_function_implementor)
        return false
      end
      @virtual_function_implementor.implement(implementor_class.gtype,
                                              name)
    end
  end

  # 3.5.0 で定数名が変わったやつ
  module PangoCairo
    Pango.constants.filter { |name| name.to_s.start_with?('Cairo') }.each do |name|
      const_set(name.to_s.delete_prefix('Cairo'), Pango.const_get(name))
    end
  end
end