libui 0.2.1-x86_64-linux → 0.2.2-x86_64-linux

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: 1b9ba21a2d68109dad1c30c167439b247b7aab8bcd5ea7ebe4244ae7d0c5704a
4
- data.tar.gz: 3302994f98cc786b78bebb46f7e5cec3010b29044e20a84ef0d3679ccb4c0cca
3
+ metadata.gz: 19f94055bcaf8d77d1a3400b92cc9c2ea871e2683d1f67bca77e5df92369f7d4
4
+ data.tar.gz: d9868e00988881499b935aea1d5bb2b06534395c1742d2751a7878a75214221b
5
5
  SHA512:
6
- metadata.gz: e03e94b59042b1dc298c1d394682e08a00f287cfc2d4e3b320497e658f9ac66b7681bb73045215effcb243d0e128a21d6fe80ed0b837590e44273da1de53288b
7
- data.tar.gz: b030da1888c2b1eed3413ff9ca0e686bbf361c5628704f5f08eec510ccb5eb012a4c7ff8db9617eec977b006ef9d4752be314b6b351e35408617c9cf6c920cbb
6
+ metadata.gz: 9d4601a5b785c8caf0feac08b427b23e5570e0f4f14a426b6fba82e2c919e03afb77ec22c09468e25dbf7bf0049b111bf2ec556674cbe85392f783d7cd46707a
7
+ data.tar.gz: 4b95ac42fd8ec00d13ad5a0943d3b563c52feb7eb46296ce7a1d67eb3d383b04e8d11c6e3cbb19f4e84568c0126cd637275df3013cc7273af96efac8755ea6df
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # LibUI
2
2
 
3
3
  [![test](https://github.com/kojix2/LibUI/actions/workflows/test.yml/badge.svg)](https://github.com/kojix2/LibUI/actions/workflows/test.yml)
4
- [![Gem Version](https://badge.fury.io/rb/libui.svg)](https://badge.fury.io/rb/libui)
4
+ [![Gem Version](https://img.shields.io/badge/dynamic/json?label=gem%20version&query=%24%5B0%5D.number&url=https%3A%2F%2Frubygems.org%2Fapi%2Fv1%2Fversions%2Flibui.json&color=brightgreen)](https://rubygems.org/gems/libui/versions)
5
5
  <a href="https://github.com/AndyObtiva/glimmer-dsl-libui"><img alt="glimmer-dsl-libui" src="https://github.com/AndyObtiva/glimmer/blob/master/images/glimmer-logo-hi-res.svg" width="50" height="50" align="right"></a>
6
6
  [![Pre-build](https://github.com/kojix2/libui-ng/actions/workflows/pre-build.yml/badge.svg?branch=pre-build)](https://github.com/kojix2/libui-ng/actions/workflows/pre-build.yml)
7
7
  [![Lines of Code](https://img.shields.io/endpoint?url=https%3A%2F%2Ftokei.kojix2.net%2Fbadge%2Fgithub%2Fkojix2%2FLibUI%2Flines)](https://tokei.kojix2.net/github/kojix2/LibUI)
@@ -86,7 +86,6 @@ LibUI is not object-oriented because it is a thin Ruby wrapper (binding) for the
86
86
  To build actual applications, it is recommended to use a DSL for LibUI, as they enable writing object-oriented code the Ruby way (instead of procedural code the C way):
87
87
 
88
88
  - [Glimmer DSL for LibUI](https://github.com/AndyObtiva/glimmer-dsl-libui)
89
- - [libui_paradise](https://rubygems.org/gems/libui_paradise)
90
89
 
91
90
  ### Working with fiddle pointers
92
91
 
data/lib/libui/ffi.rb CHANGED
@@ -3,7 +3,6 @@ require_relative 'fiddle_patch'
3
3
  require_relative 'error'
4
4
 
5
5
  module LibUI
6
-
7
6
  module FFI
8
7
  extend Fiddle::Importer
9
8
  extend FiddlePatch
@@ -11,9 +11,9 @@ module LibUI
11
11
  def parse_signature(signature, tymap = nil)
12
12
  tymap ||= {}
13
13
  ctype, func, args = case compact(signature)
14
- when /^(?:[\w\*\s]+)\(\*(\w+)\((.*?)\)\)(?:\[\w*\]|\(.*?\));?$/
14
+ when /^(?:[\w*\s]+)\(\*(\w+)\((.*?)\)\)(?:\[\w*\]|\(.*?\));?$/
15
15
  [TYPE_VOIDP, Regexp.last_match(1), Regexp.last_match(2)]
16
- when /^([\w\*\s]+[*\s])(\w+)\((.*?)\);?$/
16
+ when /^([\w*\s]+[*\s])(\w+)\((.*?)\);?$/
17
17
  [parse_ctype(Regexp.last_match(1).strip, tymap), Regexp.last_match(2), Regexp.last_match(3)]
18
18
  else
19
19
  raise("can't parse the function prototype: #{signature}")
@@ -22,12 +22,12 @@ module LibUI
22
22
  callback_argument_types = {} # Added
23
23
  argtype = split_arguments(args).collect.with_index do |arg, idx| # Added with_index
24
24
  # Check if it is a function pointer or not
25
- if arg =~ /\(\*.*\)\(.*\)/ # Added
25
+ if arg =~ /\(\*.*\)\(.*\)/ # Added
26
26
  # From the arguments, create a notation that looks like a function declaration
27
27
  # int(*f)(int *, void *) -> int f(int *, void *)
28
- func_arg = arg.sub('(*', ' ').sub(')', '') # Added
28
+ func_arg = arg.sub('(*', ' ').sub(')', '') # Added
29
29
  # Use Fiddle's parse_signature method again.
30
- callback_argument_types[idx] = parse_signature(func_arg) # Added
30
+ callback_argument_types[idx] = parse_signature(func_arg) # Added
31
31
  end
32
32
  parse_ctype(arg, tymap)
33
33
  end
@@ -41,8 +41,8 @@ module LibUI
41
41
  func = import_function(symname, ctype, argtype, opt[:call_type])
42
42
 
43
43
  # callback_argument_types
44
- func.instance_variable_set(:@callback_argument_types,
45
- callback_argument_types) # Added
44
+ func.instance_variable_set(:@callback_argument_types,
45
+ callback_argument_types) # Added
46
46
  # attr_reader
47
47
  def func.callback_argument_types
48
48
  @callback_argument_types
@@ -68,9 +68,9 @@ module LibUI
68
68
  @func_map[name] = func
69
69
  # define_method(name){|*args,&block| f.call(*args,&block)}
70
70
  begin
71
- /^(.+?):(\d+)/ =~ caller.first
72
- file = Regexp.last_match(1)
73
- line = Regexp.last_match(2).to_i
71
+ location = caller_locations(1, 1).first
72
+ file = location.path
73
+ line = location.lineno
74
74
  rescue StandardError
75
75
  file, line = __FILE__, __LINE__ + 3
76
76
  end
data/lib/libui/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module LibUI
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
3
3
  end
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - kojix2