glaze 0.1.1 → 0.1.2

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: 2807368c730ea7329947aeb52a3a5a848b7e42dc3edf1455f256b3a9d4128981
4
- data.tar.gz: bb86bb486e0ae01db8ee5ae27a14fbcf7db5938d99946409da2a421832c91842
3
+ metadata.gz: 02a2d488f5bfb897c5a7f9601c2f59aae727683d21546fc2818015955ac0b516
4
+ data.tar.gz: 5d4a73208421209319ce504eadf9b56c29abe16dbafcdb629a9fa272502c126d
5
5
  SHA512:
6
- metadata.gz: 3e20fb329b64b4a780c10a22c37a431efd2a552c985b1c1a6ed960b3c85cde71a687e6afee233ad758376a06c005c529b1ace332e4d4b75febca01fd9fa2f21e
7
- data.tar.gz: 3488aa51f146f6007e920e9d1c5d4e0031d5f6206ec223476ac1b7167d00ec3d511cb13d9170569bc0be6bd92d9594f819acfdeb6e9b309e93db2a4e78c46731
6
+ metadata.gz: '08df158ff5871893382126bb719254fc5e2d61d6f87d27cdee72a978686faad4d3a881db4b55a53f24203cb1d5f902dd200618190621f7b0cc83c4ea1b7c82ac'
7
+ data.tar.gz: 3bddc9b1dd2782c83fe40b811e83673dd7e229810866c0899a759eb9f5b4400aa13cbb421414241ba1c84893b37294c9afb18fee0142a437e715d68704a6fe4f
data/.codespellignore ADDED
@@ -0,0 +1 @@
1
+ WRONLY
data/.yamllint ADDED
@@ -0,0 +1,16 @@
1
+ extends: default
2
+ ignore: |
3
+ build/
4
+ node_modules/
5
+ runtime/build/
6
+ tmp/
7
+ **/*.dSYM/**
8
+
9
+ rules:
10
+ comments:
11
+ min-spaces-from-content: 1
12
+ document-start: disable
13
+ line-length:
14
+ max: 200
15
+ truthy:
16
+ check-keys: false
data/CHANGELOG.md CHANGED
@@ -1,8 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.2] - 2026-09-26
4
+
5
+ - Prevent `glaze new` from overwriting an existing shader.
6
+ - Reject non-finite shader uniform defaults.
7
+
3
8
  ## [0.1.1] - 2026-09-25
4
9
 
5
- - Include the shared WebGPU runner in the published gem.
10
+ - Make the shared WebGPU runner available in the installed gem.
6
11
  - Stream recorded shader frames to GIF or APNG with the optional Flipbook gem.
7
12
 
8
13
  ## [0.1.0] - 2026-09-23
data/exe/glaze CHANGED
@@ -12,7 +12,9 @@ when "new"
12
12
  raise ArgumentError, "shader name must contain only letters, digits and underscores" unless name.match?(/\A[a-zA-Z][a-zA-Z0-9_]*\z/)
13
13
  path = File.join("shaders", "#{name}.rb")
14
14
  FileUtils.mkdir_p(File.dirname(path))
15
- File.write(path, "Glaze.shader :#{name} do\n fragment do |frag_coord, resolution, u|\n uv = frag_coord / resolution\n vec3(uv.x, uv.y, 0.2)\n end\nend\n")
15
+ File.open(path, File::WRONLY | File::CREAT | File::EXCL) do |file|
16
+ file.write("Glaze.shader :#{name} do\n fragment do |frag_coord, resolution, u|\n uv = frag_coord / resolution\n vec3(uv.x, uv.y, 0.2)\n end\nend\n")
17
+ end
16
18
  puts path
17
19
  when "run"
18
20
  path = ARGV.first&.start_with?("-") ? nil : ARGV.shift
data/lib/glaze/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Glaze
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
data/lib/glaze.rb CHANGED
@@ -57,6 +57,7 @@ module Glaze
57
57
  case type
58
58
  when :float
59
59
  raise TypeError, "float uniform default must be numeric" unless default.is_a?(Numeric)
60
+ raise ArgumentError, "float uniform default must be finite" unless default.real? && default.to_f.finite?
60
61
  when :int
61
62
  raise TypeError, "int uniform default must be an integer" unless default.is_a?(Integer)
62
63
  when :bool
@@ -66,6 +67,7 @@ module Glaze
66
67
  raise TypeError, "vector uniform default must be an array" unless default.is_a?(Array)
67
68
  raise ArgumentError, "vector uniform default has the wrong length" unless default.length == size
68
69
  raise TypeError, "vector uniform default must be numeric" unless default.all? { |value| value.is_a?(Numeric) }
70
+ raise ArgumentError, "vector uniform default must be finite" unless default.all? { |value| value.real? && value.to_f.finite? }
69
71
  end
70
72
  if range
71
73
  raise ArgumentError, "uniform range is only valid for numeric uniforms" unless %i[float int].include?(type)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glaze
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yudai Takada
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-09-25 00:00:00.000000000 Z
11
+ date: 2026-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tessel
@@ -72,6 +72,8 @@ executables:
72
72
  extensions: []
73
73
  extra_rdoc_files: []
74
74
  files:
75
+ - ".codespellignore"
76
+ - ".yamllint"
75
77
  - CHANGELOG.md
76
78
  - LICENSE.txt
77
79
  - README.md