xot 0.3.3 β 0.3.5
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/.github/PULL_REQUEST_TEMPLATE.md +12 -0
- data/CONTRIBUTING.md +7 -0
- data/ChangeLog.md +12 -0
- data/README.md +47 -2
- data/VERSION +1 -1
- data/lib/xot/hookable.rb +6 -8
- data/lib/xot/rake/util.rb +4 -4
- data/test/test_hookable.rb +11 -7
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb32bfca53b907bc70eda1e106532a0122abb189b0ff74fe150213bfc4b54e27
|
4
|
+
data.tar.gz: 5ab847804b982c1f5ab647237a87bd4665e2fbf5713d9b072b88aa409f8b9896
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1e9dab3c783e57d0c2623955a575a8f1f097ae00246695275b11407d2ee7c338f23785eac5f371179d259765bd177a36e005ca96d680c7e5f2a1e0d4692bfe6
|
7
|
+
data.tar.gz: 03f3adb2c666002145f1d3874221721dc23d04e93431574b163387fda9ccaa13430b292dd554af7d9f239577852297e2e7327f7edd7627ba100041006d338db1
|
@@ -0,0 +1,12 @@
|
|
1
|
+
## Pull Requests Not Accepted π«
|
2
|
+
|
3
|
+
Thank you for your interest in contributing!
|
4
|
+
However, this repository does not accept pull requests directly.
|
5
|
+
|
6
|
+
### Where to Contribute?
|
7
|
+
|
8
|
+
Please submit your changes to the [xord/all](https://github.com/xord/all) monorepo, which serves as the primary repository for all our main libraries.
|
9
|
+
|
10
|
+
For more details, please refer to our [contribution guidelines](../CONTRIBUTING.md).
|
11
|
+
|
12
|
+
Thanks for your understanding! π
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
# Contribution Guide
|
2
|
+
|
3
|
+
Thank you for your interest in contributing!
|
4
|
+
However, this repository does not accept pull requests.
|
5
|
+
Instead, please submit your changes to the [xord/all](https://github.com/xord/all) monorepo, which serves as the primary repository for all our main libraries.
|
6
|
+
|
7
|
+
For any questions, feel free to open an issue.
|
data/ChangeLog.md
CHANGED
@@ -1,6 +1,18 @@
|
|
1
1
|
# xot ChangeLog
|
2
2
|
|
3
3
|
|
4
|
+
## [v0.3.5] - 2025-03-24
|
5
|
+
|
6
|
+
- Add PULL_REQUEST_TEMPLATE.md
|
7
|
+
- Add CONTRIBUTING.md
|
8
|
+
|
9
|
+
|
10
|
+
## [v0.3.4] - 2025-03-07
|
11
|
+
|
12
|
+
- Hookable passes keyword args
|
13
|
+
- Xot::Hookable#on defines methods that contain the 'on_' prefix
|
14
|
+
|
15
|
+
|
4
16
|
## [v0.3.3] - 2025-01-23
|
5
17
|
|
6
18
|
- Fix '=bar' in CFLAGS when '-Wfoo=bar' is included in CFLAGS, which leaves only '=bar' in CFLAGS and causes a compile error
|
data/README.md
CHANGED
@@ -1,4 +1,49 @@
|
|
1
|
+
# Xot - Some useful utility classes and functions
|
1
2
|
|
2
|
-
|
3
|
+

|
4
|
+

|
5
|
+

|
3
6
|
|
4
|
-
|
7
|
+
## β οΈ Notice
|
8
|
+
|
9
|
+
This repository is a read-only mirror of our monorepo.
|
10
|
+
We do not accept pull requests or direct contributions here.
|
11
|
+
|
12
|
+
### π Where to Contribute?
|
13
|
+
|
14
|
+
All development happens in our [xord/all](https://github.com/xord/all) monorepo, which contains all our main libraries.
|
15
|
+
If you'd like to contribute, please submit your changes there.
|
16
|
+
|
17
|
+
For more details, check out our [Contribution Guidelines](./CONTRIBUTING.md).
|
18
|
+
|
19
|
+
Thanks for your support! π
|
20
|
+
|
21
|
+
## π About
|
22
|
+
|
23
|
+
**Xot** is a small utility library that was extracted for internal use to provide basic helper classes and functions across our own Ruby gems.
|
24
|
+
|
25
|
+
Itβs not intended for general public use, but rather serves as a simple collection of utilities to make our own development process more efficient and consistent.
|
26
|
+
|
27
|
+
Feel free to explore, but please note that itβs not actively maintained or intended for broad adoption.
|
28
|
+
|
29
|
+
## π¦ Installation
|
30
|
+
|
31
|
+
Add this line to your Gemfile:
|
32
|
+
```ruby
|
33
|
+
$ gem 'xot'
|
34
|
+
```
|
35
|
+
|
36
|
+
Then, install gem:
|
37
|
+
```bash
|
38
|
+
$ bundle install
|
39
|
+
```
|
40
|
+
|
41
|
+
Or install it directly:
|
42
|
+
```bash
|
43
|
+
$ gem install xot
|
44
|
+
```
|
45
|
+
|
46
|
+
## π License
|
47
|
+
|
48
|
+
**Xot** is licensed under the MIT License.
|
49
|
+
See the [LICENSE](./LICENSE) file for details.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.5
|
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
@@ -207,10 +207,10 @@ module Xot
|
|
207
207
|
s = flags.dup
|
208
208
|
s << warning_opts.map {|s| " -W#{s}"}.join
|
209
209
|
s << " -arch arm64" if RUBY_PLATFORM =~ /arm64-darwin/
|
210
|
-
s << ' -std=c++20'
|
211
|
-
s << ' -std=c++20 -stdlib=libc++ -mmacosx-version-min=10.
|
212
|
-
s << ' ' + RbConfig::CONFIG['debugflags']
|
213
|
-
s.gsub!(/-O\d?\w*/, '-O0')
|
210
|
+
s << ' -std=c++20' if gcc?
|
211
|
+
s << ' -std=c++20 -stdlib=libc++ -mmacosx-version-min=10.10' if clang?
|
212
|
+
s << ' ' + RbConfig::CONFIG['debugflags'] if debug?
|
213
|
+
s.gsub!(/-O\d?\w*/, '-O0') if debug?
|
214
214
|
s
|
215
215
|
end
|
216
216
|
|
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.5
|
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-23 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++.
|
@@ -18,10 +18,12 @@ extensions:
|
|
18
18
|
- Rakefile
|
19
19
|
extra_rdoc_files: []
|
20
20
|
files:
|
21
|
+
- ".github/PULL_REQUEST_TEMPLATE.md"
|
21
22
|
- ".github/workflows/release-gem.yml"
|
22
23
|
- ".github/workflows/tag.yml"
|
23
24
|
- ".github/workflows/test.yml"
|
24
25
|
- ".github/workflows/utils.rb"
|
26
|
+
- CONTRIBUTING.md
|
25
27
|
- ChangeLog.md
|
26
28
|
- Gemfile
|
27
29
|
- Gemfile.lock
|