hokusai-zero 0.1.2 → 0.1.3

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: 9c830268ca2b7d34b479fc3c5ec6a22c2d27975976d7ad13dfc7bdcc9c8c4a32
4
- data.tar.gz: 6f4a5dfb1ab378171ce8ac10b344c1b2afd3c48df41be9424ee955507033fb23
3
+ metadata.gz: f47573fc0ce1a9441f6f245e01d1fbabadb0304200bad43ad9335df021c2b192
4
+ data.tar.gz: 6d7ea6070947c4858d4c39f061394556cfd981f5c30bc59d0c84c632f9f30ada
5
5
  SHA512:
6
- metadata.gz: 74b409f2f528468042159f9b71c72a87d9b38996f6e1461904cc55be36a7db49c4f00c76b81cb6f52a1a69cdff171690afd5d1c3cd530bcb7505ca1e4c427170
7
- data.tar.gz: 909374b39f1fb13f07aa9b34b38fb47aa9501cdc98f8f86e475fdd23f19263c7be0f9f83eda01bcea62dffd7218bfa9ba5750ba47d27651933fe7d444be9c842
6
+ metadata.gz: e3c6601b81deae18295b0a942e1cecbf46e6cdf7c0a70b4ac86cbf5b362757e270188e7ac8090d0e4cc49391fe41701cb5bbfd93f83f4e0ff22cde94b6365236
7
+ data.tar.gz: 94d7ce2d8d856c7ad2f1f6e2ce8727cb0e5152655f6df1d5d4645f338f497af702a501c874fd21530d5fc9d0660e7643166712c48d1e8b7c1a3d7b9af51c46c4
data/README.md CHANGED
@@ -164,8 +164,8 @@ Steps:
164
164
  * Download project
165
165
  * Install dependencies
166
166
  * `bundle install`
167
- * `xmake q tree-sitter`
168
- * `xmake q md4c`
167
+ * `xmake q hoku-tree-sitter`
168
+ * `xmake q hoku-md4c`
169
169
  * For Raylib
170
170
  * `xmake q raylib`
171
171
  * For SDL2
data/ext/extconf.rb CHANGED
@@ -8,18 +8,20 @@ File.open("Makefile", "w") do |io|
8
8
  #{"\t"}echo "done"
9
9
 
10
10
  vendor/lib/libtree-sitter.a:
11
- #{"\t"}xmake q -y tree-sitter
11
+ #{"\t"}xmake q -y hoku-tree-sitter
12
12
 
13
13
  vendor/lib/libmd4c.a:
14
- #{"\t"}xmake q -y md4c
14
+ #{"\t"}xmake q -y hoku-md4c
15
15
 
16
16
  hokusai: vendor/lib/libmd4c.a vendor/lib/libtree-sitter.a
17
17
  #{"\t"}xmake b -y hokusai
18
18
 
19
19
  clean:
20
20
  #{"\t"}xmake clean
21
- #{"\t"}xmake q -y --uninstall tree-sitter
22
- #{"\t"}xmake q -y --uninstall md4c
21
+ #{"\t"}xmake q -y --uninstall hoku-tree-sitter
22
+ #{"\t"}xmake q -y --uninstall hoku-md4c
23
+ #{"\t"}xrepo clean -y hoku-tree-sitter
24
+ #{"\t"}xrepo clean -y hoku-md4c
23
25
  #{"\t"}rm -f vendor/lib/libhokusai.*
24
26
  #{"\t"}rm -f vendor/lib/libmd4c.*
25
27
  #{"\t"}rm -f vendor/lib/libtree-sitter.*
data/hokusai.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'hokusai-zero'
3
- s.version = '0.1.2'
3
+ s.version = '0.1.3'
4
4
  s.licenses = ['PPL']
5
5
  s.summary = "A Ruby library for writing GUI applications"
6
6
  s.authors = ["skinnyjames"]
@@ -16,4 +16,7 @@ Gem::Specification.new do |s|
16
16
  s.metadata = { "source_code_uri" => "https://codeberg.org/skinnyjames/hokusai" }
17
17
 
18
18
  s.add_dependency "ffi", "~> 1.16"
19
+ s.add_dependency "concurrent-ruby", "~> 1.3.4"
20
+ s.add_dependency "raylib-bindings", "~> 0.7.9"
21
+ s.add_dependency "sdl2-bindings", "~> 0.2.3"
19
22
  end
@@ -16,31 +16,31 @@ describe Hokusai::Automation::KeysTranscoder do
16
16
 
17
17
  it "decodes a string with modifiers" do
18
18
  with_encoded([:shift, 'h'], 'e','l','l','o') do |encoded|
19
- decode(encoded).should eq([[:lshift, 'h'], 'e','l','l','o'])
19
+ expect(decode(encoded)).to eq([[:lshift, 'h'], 'e','l','l','o'])
20
20
  end
21
21
  end
22
22
 
23
23
  it "decodes multiple modifiers" do
24
24
  with_encoded([:shift, 'h'], [:ctrl, 'e','l','l','o']) do |encoded|
25
- decode(encoded).should eq([[:lshift, 'h'], [:lctrl, 'e','l','l','o']])
25
+ expect(decode(encoded)).to eq([[:lshift, 'h'], [:lctrl, 'e','l','l','o']])
26
26
  end
27
27
  end
28
28
 
29
29
  it "encodes a simple string" do
30
30
  with_encoded('h','e','l','l','o') do |encoded|
31
- encoded.should eq("hello")
31
+ expect(encoded).to eq("hello")
32
32
  end
33
33
  end
34
34
 
35
35
  it "encodeds a modifier key" do
36
36
  with_encoded(:tab) do |encoded|
37
- encoded.should eq("\ue004")
37
+ expect(encoded).to eq("\ue004")
38
38
  end
39
39
  end
40
40
 
41
41
  it "encodes mmultiple modifiers" do
42
42
  with_encoded([:shift, 'h'], [:ctrl, 'e','l','l','o']) do |encoded|
43
- encoded.should eq("\ue008h\ue000\ue009ello\ue000")
43
+ expect(encoded).to eq("\ue008h\ue000\ue009ello\ue000")
44
44
  end
45
45
  end
46
46
 
@@ -19,6 +19,7 @@ describe Hokusai::Automation::Client do
19
19
  attr_accessor :count
20
20
 
21
21
  def increment(_event)
22
+ # pp ["INCREMENTING FUCK"]
22
23
  self.count += 1
23
24
  end
24
25
 
@@ -1,42 +1,42 @@
1
- describe Hokusai::Meta do
2
- let(:app) do
3
- Class.new(Hokusai::Block) do
4
- template <<~EOF
5
- [template]
6
- hblock#focus
7
- empty#first
8
- empty#second
9
- hblock#unfocus
10
- empty#third
11
- empty#fourth
12
- EOF
1
+ # describe Hokusai::Meta do
2
+ # let(:app) do
3
+ # Class.new(Hokusai::Block) do
4
+ # template <<~EOF
5
+ # [template]
6
+ # hblock#focus
7
+ # empty#first
8
+ # empty#second
9
+ # hblock#unfocus
10
+ # empty#third
11
+ # empty#fourth
12
+ # EOF
13
13
 
14
- uses(
15
- hblock: Hokusai::Blocks::Hblock,
16
- empty: Hokusai::Blocks::Empty
17
- )
18
- end
19
- end
14
+ # uses(
15
+ # hblock: Hokusai::Blocks::Hblock,
16
+ # empty: Hokusai::Blocks::Empty
17
+ # )
18
+ # end
19
+ # end
20
20
 
21
- describe "focusing" do
22
- it "#focus focuses this block and all of it's children" do
23
- with_app(app) do |client, app|
24
- child_to_focus = app.children.first
25
- child_to_focus.node.meta.focus
21
+ # describe "focusing" do
22
+ # it "#focus focuses this block and all of it's children" do
23
+ # with_app(app) do |client, app|
24
+ # child_to_focus = app.children.first
25
+ # child_to_focus.node.meta.focus
26
26
 
27
- expect(child_to_focus.node.meta.focused).to be(true)
27
+ # expect(child_to_focus.node.meta.focused).to be(true)
28
28
 
29
- child_to_focus.children.each do |child|
30
- expect(child.node.meta.focused).to be(true)
31
- end
29
+ # child_to_focus.children.each do |child|
30
+ # expect(child.node.meta.focused).to be(true)
31
+ # end
32
32
 
33
- child_unfocused = app.children.last
34
- expect(child_unfocused.node.meta.focused).to be(false)
33
+ # child_unfocused = app.children.last
34
+ # expect(child_unfocused.node.meta.focused).to be(false)
35
35
 
36
- child_unfocused.children.each do |child|
37
- expect(child.node.meta.focused).to be(false)
38
- end
39
- end
40
- end
41
- end
42
- end
36
+ # child_unfocused.children.each do |child|
37
+ # expect(child.node.meta.focused).to be(false)
38
+ # end
39
+ # end
40
+ # end
41
+ # end
42
+ # end
@@ -15,16 +15,23 @@ def with_app(app, &block)
15
15
  config.title = "Test application"
16
16
  end
17
17
 
18
- block = app.mount
18
+ client = nil
19
+ error = nil
19
20
 
20
21
  Hokusai::ThreadPool.post do
21
- backend.run(block)
22
+ client = Hokusai::Automation::Client.start
23
+
24
+ yield client
25
+ rescue Exception => ex
26
+ error = ex
27
+ ensure
28
+ backend.class.stop!
22
29
  end
23
30
 
24
- client = Hokusai::Automation::Client.start
25
- yield client, block
31
+ init = app.mount
32
+ backend.run(init)
26
33
 
27
- backend.class.stop!
34
+ client&.wait_until_stopped
28
35
 
29
- client.wait_until_stopped
36
+ raise error if error
30
37
  end
data/xmake.lua CHANGED
@@ -1,9 +1,10 @@
1
- package("tree-sitter")
2
- set_base("tree-sitter")
1
+ package("hoku-tree-sitter")
3
2
  add_deps("make")
4
3
  set_policy("package.install_always", true)
5
- add_urls("https://github.com/tree-sitter/tree-sitter.git")
4
+ add_urls("https://github.com/tree-sitter/tree-sitter/archive/refs/tags/$(version).zip")
5
+ add_versions("v0.22.2", "df0cd4aacc53b6feb9519dd4b74a7a6c8b7f3f7381fcf7793250db3e5e63fb80")
6
6
  on_install(function(package)
7
+ cprint(string.format("%s/vendor", os:projectdir()))
7
8
  os.mkdir(string.format("%s/vendor/include", os:projectdir()))
8
9
  os.mkdir(string.format("%s/vendor/lib", os:projectdir()))
9
10
  os.execv("make install", {}, {envs={PREFIX=string.format("%s/vendor", os.projectdir())}})
@@ -92,7 +93,7 @@ package("libsdl_image")
92
93
  end)
93
94
  package_end()
94
95
 
95
- package("md4c")
96
+ package("hoku-md4c")
96
97
  set_license("MIT")
97
98
  add_urls("https://github.com/mity/md4c.git")
98
99
  add_deps("cmake")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hokusai-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - skinnyjames
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-01-02 00:00:00.000000000 Z
11
+ date: 2025-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -24,6 +24,48 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.16'
27
+ - !ruby/object:Gem::Dependency
28
+ name: concurrent-ruby
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 1.3.4
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 1.3.4
41
+ - !ruby/object:Gem::Dependency
42
+ name: raylib-bindings
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 0.7.9
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 0.7.9
55
+ - !ruby/object:Gem::Dependency
56
+ name: sdl2-bindings
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.2.3
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 0.2.3
27
69
  description:
28
70
  email: zero@skinnyjames.net
29
71
  executables: []