yass-css 0.1.0-aarch64-linux → 0.3.0-aarch64-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 +4 -4
- data/CHANGELOG.md +11 -1
- data/README.md +107 -11
- data/Rakefile +83 -2
- data/codegen/ruby_module_tree.rb +178 -0
- data/codegen/rust_file_set.rb +84 -0
- data/codegen/utils.rb +27 -0
- data/dockerfiles/windows.dockerfile +1 -1
- data/examples/basic_example.rb +32 -0
- data/examples/font_example.rb +19 -0
- data/examples/media_example.rb +31 -0
- data/examples/visitor_example.rb +41 -0
- data/ext/yass/src/.DS_Store +0 -0
- data/ext/yass/src/declarations/.DS_Store +0 -0
- data/lib/yass/3.2/yass.so +0 -0
- data/lib/yass/3.3/yass.so +0 -0
- data/lib/yass/3.4/yass.so +0 -0
- data/lib/yass/4.0/yass.so +0 -0
- data/lib/yass/declarations.rb +7975 -0
- data/lib/yass/general.rb +31 -0
- data/lib/yass/node.rb +9 -0
- data/lib/yass/rules.rb +515 -0
- data/lib/yass/selectors.rb +325 -0
- data/lib/yass/stylesheet.rb +13 -0
- data/lib/yass/version.rb +1 -1
- data/lib/yass/visitor.rb +2463 -0
- data/lib/yass.rb +35 -0
- data/scripts/build_all.sh +44 -0
- data/scripts/detect.rb +39 -0
- data/scripts/wpt.rb +20 -0
- metadata +21 -3
- data/sig/yass.rbs +0 -4
data/lib/yass.rb
CHANGED
|
@@ -10,5 +10,40 @@ rescue LoadError
|
|
|
10
10
|
require_relative "yass/yass"
|
|
11
11
|
end
|
|
12
12
|
|
|
13
|
+
require "yass/node"
|
|
14
|
+
require "yass/stylesheet"
|
|
15
|
+
|
|
16
|
+
require "yass/general"
|
|
17
|
+
require "yass/declarations"
|
|
18
|
+
require "yass/rules"
|
|
19
|
+
require "yass/selectors"
|
|
20
|
+
|
|
13
21
|
module Yass
|
|
22
|
+
autoload :Visitor, "yass/visitor"
|
|
23
|
+
|
|
24
|
+
def self.serialize(obj)
|
|
25
|
+
case obj
|
|
26
|
+
when Integer, String, Symbol
|
|
27
|
+
obj
|
|
28
|
+
when Float
|
|
29
|
+
if obj == Float::INFINITY
|
|
30
|
+
"inf"
|
|
31
|
+
elsif obj == -Float::INFINITY
|
|
32
|
+
"-inf"
|
|
33
|
+
elsif obj.nan?
|
|
34
|
+
"NaN"
|
|
35
|
+
else
|
|
36
|
+
obj
|
|
37
|
+
end
|
|
38
|
+
when Array
|
|
39
|
+
obj.map { |elem| serialize(elem) }
|
|
40
|
+
else
|
|
41
|
+
if obj.class.const_defined?(:RUBY_METHODS)
|
|
42
|
+
obj.class::RUBY_METHODS.each_with_object({}) do |method_name, memo|
|
|
43
|
+
plain_method_name = method_name.to_s.chomp("?")
|
|
44
|
+
memo[plain_method_name.to_sym] = serialize(obj.send(method_name))
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
14
49
|
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# /bin/bash
|
|
2
|
+
|
|
3
|
+
# This script is for testing the build process locally. Actual releases
|
|
4
|
+
# are done by creating a new release on GitHub.
|
|
5
|
+
|
|
6
|
+
ruby_versions="~> 3.2,~> 3.3,~> 3.4,~> 4.0"
|
|
7
|
+
|
|
8
|
+
#### LINUX ####
|
|
9
|
+
|
|
10
|
+
bundle exec rb-sys-dock \
|
|
11
|
+
--platform x86_64-linux \
|
|
12
|
+
--ruby-versions "$ruby_versions" \
|
|
13
|
+
--build
|
|
14
|
+
|
|
15
|
+
bundle exec rb-sys-dock \
|
|
16
|
+
--platform aarch64-linux \
|
|
17
|
+
--ruby-versions "$ruby_versions" \
|
|
18
|
+
--build
|
|
19
|
+
|
|
20
|
+
#### MAC OS ####
|
|
21
|
+
|
|
22
|
+
bundle exec rb-sys-dock \
|
|
23
|
+
--platform x86_64-darwin \
|
|
24
|
+
--ruby-versions "$ruby_versions" \
|
|
25
|
+
--build
|
|
26
|
+
|
|
27
|
+
bundle exec rb-sys-dock \
|
|
28
|
+
--platform arm64-darwin \
|
|
29
|
+
--ruby-versions "$ruby_versions" \
|
|
30
|
+
--build
|
|
31
|
+
|
|
32
|
+
#### WINDOWS ####
|
|
33
|
+
|
|
34
|
+
docker build \
|
|
35
|
+
--platform linux/amd64 \
|
|
36
|
+
-f dockerfiles/windows.dockerfile \
|
|
37
|
+
-t camertron/rbsys-x64-mingw-ucrt:latest \
|
|
38
|
+
dockerfiles/
|
|
39
|
+
|
|
40
|
+
RCD_IMAGE=camertron/rbsys-x64-mingw-ucrt:latest \
|
|
41
|
+
bundle exec rb-sys-dock \
|
|
42
|
+
--platform x64-mingw-ucrt \
|
|
43
|
+
--ruby-versions "$ruby_versions" \
|
|
44
|
+
--build
|
data/scripts/detect.rb
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Tries to find places where CachedValue or CachedValueList is used without an
|
|
2
|
+
# accompanying mark function
|
|
3
|
+
|
|
4
|
+
rust_files = Dir.glob("ext/yass/src/**/*.rs")
|
|
5
|
+
|
|
6
|
+
rust_files.flat_map do |rust_file|
|
|
7
|
+
rust_code = File.read(rust_file)
|
|
8
|
+
|
|
9
|
+
rust_code.scan(/#\[magnus(?:\:\:wrap)?\(class = "([\w:]+)"(, mark)?\)\]\s+pub struct (\w+)/).map do |ruby_class_name, mark, rust_struct_name|
|
|
10
|
+
next unless ruby_class_name && rust_struct_name
|
|
11
|
+
|
|
12
|
+
m = rust_code.match(/impl\s+#{rust_struct_name}\s+(\{)/)
|
|
13
|
+
next unless m
|
|
14
|
+
|
|
15
|
+
start = pos = m.end(1)
|
|
16
|
+
count = 1
|
|
17
|
+
|
|
18
|
+
while count > 0
|
|
19
|
+
case rust_code[pos]
|
|
20
|
+
when "{"
|
|
21
|
+
count += 1
|
|
22
|
+
when "}"
|
|
23
|
+
count -= 1
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
pos += 1
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
impl_body = rust_code[start..pos]
|
|
30
|
+
|
|
31
|
+
implements_data_type_functions = rust_code.include?("impl DataTypeFunctions for #{rust_struct_name}")
|
|
32
|
+
|
|
33
|
+
if impl_body.include?("CachedValue")
|
|
34
|
+
if !mark || !implements_data_type_functions
|
|
35
|
+
puts rust_file
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
data/scripts/wpt.rb
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
require "nokogiri"
|
|
2
|
+
require "fileutils"
|
|
3
|
+
|
|
4
|
+
Dir.chdir("wpt/css") do
|
|
5
|
+
Dir.glob("**/*.html") do |html_path|
|
|
6
|
+
doc = Nokogiri::HTML(File.read(html_path))
|
|
7
|
+
|
|
8
|
+
dirname = File.dirname(html_path)
|
|
9
|
+
basename = File.basename(html_path)
|
|
10
|
+
|
|
11
|
+
css_dirname = File.join("../../spec/wpt/fixtures", dirname)
|
|
12
|
+
css_basename = "#{basename.chomp(".html")}.css"
|
|
13
|
+
css_path = File.join(css_dirname, css_basename)
|
|
14
|
+
|
|
15
|
+
FileUtils.mkdir_p(css_dirname)
|
|
16
|
+
File.write(css_path, doc.css("style").map(&:inner_text).join("\n"))
|
|
17
|
+
|
|
18
|
+
puts "Wrote #{css_path}"
|
|
19
|
+
end
|
|
20
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: yass-css
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: aarch64-linux
|
|
6
6
|
authors:
|
|
7
7
|
- Cameron Dutro
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-04-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: The Stylo CSS parser wrapped in a Ruby embrace.
|
|
14
14
|
email:
|
|
@@ -22,15 +22,33 @@ files:
|
|
|
22
22
|
- LICENSE.txt
|
|
23
23
|
- README.md
|
|
24
24
|
- Rakefile
|
|
25
|
+
- codegen/ruby_module_tree.rb
|
|
26
|
+
- codegen/rust_file_set.rb
|
|
27
|
+
- codegen/utils.rb
|
|
25
28
|
- dockerfiles/windows.dockerfile
|
|
29
|
+
- examples/basic_example.rb
|
|
30
|
+
- examples/font_example.rb
|
|
31
|
+
- examples/media_example.rb
|
|
32
|
+
- examples/visitor_example.rb
|
|
26
33
|
- ext/.DS_Store
|
|
34
|
+
- ext/yass/src/.DS_Store
|
|
35
|
+
- ext/yass/src/declarations/.DS_Store
|
|
27
36
|
- lib/yass.rb
|
|
28
37
|
- lib/yass/3.2/yass.so
|
|
29
38
|
- lib/yass/3.3/yass.so
|
|
30
39
|
- lib/yass/3.4/yass.so
|
|
31
40
|
- lib/yass/4.0/yass.so
|
|
41
|
+
- lib/yass/declarations.rb
|
|
42
|
+
- lib/yass/general.rb
|
|
43
|
+
- lib/yass/node.rb
|
|
44
|
+
- lib/yass/rules.rb
|
|
45
|
+
- lib/yass/selectors.rb
|
|
46
|
+
- lib/yass/stylesheet.rb
|
|
32
47
|
- lib/yass/version.rb
|
|
33
|
-
-
|
|
48
|
+
- lib/yass/visitor.rb
|
|
49
|
+
- scripts/build_all.sh
|
|
50
|
+
- scripts/detect.rb
|
|
51
|
+
- scripts/wpt.rb
|
|
34
52
|
homepage: https://github.com/camertron/yass
|
|
35
53
|
licenses:
|
|
36
54
|
- MIT
|
data/sig/yass.rbs
DELETED