xot 0.3.2 → 0.3.4
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 +4 -4
- data/ChangeLog.md +11 -0
- data/VERSION +1 -1
- data/lib/xot/hookable.rb +6 -8
- data/lib/xot/rake/util.rb +1 -1
- data/test/test_hookable.rb +11 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a26e9fa724bc739101d50ca597db562c45579a6838e58b499500f8fde36fc2cd
|
4
|
+
data.tar.gz: fda8ebb7d831ea1089a99eddfe804d6b4ed954ecf4b9fd3e1132b8eb89eee9c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d557d7cb96560fac93a415a4e4c518a3cbea52ca55ea8a915a8119147128996fcd95fe6bf289e058c85335e0a5021ae6f5b08277b9ea51fa4c5c85d0361bdc50
|
7
|
+
data.tar.gz: 7a42fcd477c066a267074882ca44c8a27c07b656a7a853d7e06efa9c6a0fde5400bfdf7eeb67900939e3b0c557cea69ef80bc4ff314c7fb46564b77c16406e1b
|
data/ChangeLog.md
CHANGED
@@ -1,6 +1,17 @@
|
|
1
1
|
# xot ChangeLog
|
2
2
|
|
3
3
|
|
4
|
+
## [v0.3.4] - 2025-03-07
|
5
|
+
|
6
|
+
- Hookable passes keyword args
|
7
|
+
- Xot::Hookable#on defines methods that contain the 'on_' prefix
|
8
|
+
|
9
|
+
|
10
|
+
## [v0.3.3] - 2025-01-23
|
11
|
+
|
12
|
+
- Fix '=bar' in CFLAGS when '-Wfoo=bar' is included in CFLAGS, which leaves only '=bar' in CFLAGS and causes a compile error
|
13
|
+
|
14
|
+
|
4
15
|
## [v0.3.2] - 2025-01-14
|
5
16
|
|
6
17
|
- Update workflow files
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.4
|
data/lib/xot/hookable.rb
CHANGED
@@ -9,21 +9,19 @@ module Xot
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def on(name, &block)
|
12
|
-
hook name
|
13
|
-
block.call(*a, &b)
|
14
|
-
end
|
12
|
+
hook "on_#{name}", &block
|
15
13
|
end
|
16
14
|
|
17
15
|
def before(name, &block)
|
18
|
-
hook name do |*a, &b|
|
19
|
-
super(*a, &b) unless block.call(*a, &b) == :skip
|
16
|
+
hook name do |*a, **k, &b|
|
17
|
+
super(*a, **k, &b) unless block.call(*a, **k, &b) == :skip
|
20
18
|
end
|
21
19
|
end
|
22
20
|
|
23
21
|
def after(name, &block)
|
24
|
-
hook name do |*a, &b|
|
25
|
-
ret = super(*a, &b)
|
26
|
-
block.call(*a, &b)
|
22
|
+
hook name do |*a, **k, &b|
|
23
|
+
ret = super(*a, **k, &b)
|
24
|
+
block.call(*a, **k, &b)
|
27
25
|
ret
|
28
26
|
end
|
29
27
|
end
|
data/lib/xot/rake/util.rb
CHANGED
@@ -250,7 +250,7 @@ module Xot
|
|
250
250
|
def cxxflags(warnings = true)
|
251
251
|
cflags = env :CFLAGS, RbConfig::CONFIG['CFLAGS']
|
252
252
|
cxxflags = env :CXXFLAGS, RbConfig::CONFIG['CXXFLAGS']
|
253
|
-
cflags = cflags.gsub(/-W[\w
|
253
|
+
cflags = cflags.gsub(/-W[\w\-\=]+/, '') + ' -w' unless warnings
|
254
254
|
make_cflags "#{cflags} #{cxxflags}"
|
255
255
|
end
|
256
256
|
|
data/test/test_hookable.rb
CHANGED
@@ -21,6 +21,10 @@ class TestHookable < Test::Unit::TestCase
|
|
21
21
|
@log << 0
|
22
22
|
end
|
23
23
|
|
24
|
+
def on_one()
|
25
|
+
@log << 1
|
26
|
+
end
|
27
|
+
|
24
28
|
end# Temp
|
25
29
|
|
26
30
|
def temp(*args)
|
@@ -41,23 +45,23 @@ class TestHookable < Test::Unit::TestCase
|
|
41
45
|
|
42
46
|
def test_before()
|
43
47
|
o = temp
|
44
|
-
o.before(:zero) {o.log <<
|
48
|
+
o.before(:zero) {o.log << 9}
|
45
49
|
o.zero
|
46
|
-
assert_equal [
|
50
|
+
assert_equal [9, 0], o.log
|
47
51
|
end
|
48
52
|
|
49
53
|
def test_after()
|
50
54
|
o = temp
|
51
|
-
o.after(:zero) {o.log <<
|
55
|
+
o.after(:zero) {o.log << 9}
|
52
56
|
o.zero
|
53
|
-
assert_equal [0,
|
57
|
+
assert_equal [0, 9], o.log
|
54
58
|
end
|
55
59
|
|
56
60
|
def test_on()
|
57
61
|
o = temp
|
58
|
-
o.on(:
|
59
|
-
o.
|
60
|
-
assert_equal [
|
62
|
+
o.on(:one) {o.log << 9}
|
63
|
+
o.on_one
|
64
|
+
assert_equal [9], o.log
|
61
65
|
end
|
62
66
|
|
63
67
|
def test_hook_self()
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- xordog
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: This library include some useful utility classes and functions for development
|
14
14
|
with C++.
|