xrb 0.10.0 → 0.10.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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/bake/xrb/entities.rb +6 -6
- data/ext/extconf.rb +2 -2
- data/lib/xrb/buffer.rb +1 -1
- data/lib/xrb/builder.rb +4 -4
- data/lib/xrb/error.rb +1 -1
- data/lib/xrb/fallback/markup.rb +1 -3
- data/lib/xrb/fallback/query.rb +2 -4
- data/lib/xrb/fallback/template.rb +1 -3
- data/lib/xrb/markup.rb +1 -1
- data/lib/xrb/native.rb +4 -4
- data/lib/xrb/parsers.rb +4 -4
- data/lib/xrb/query.rb +3 -3
- data/lib/xrb/reference.rb +9 -9
- data/lib/xrb/tag.rb +20 -12
- data/lib/xrb/template.rb +6 -5
- data/lib/xrb/uri.rb +10 -10
- data/lib/xrb/version.rb +1 -1
- data/lib/xrb.rb +5 -5
- data.tar.gz.sig +0 -0
- metadata +2 -11
- metadata.gz.sig +0 -0
- data/ext/Makefile +0 -270
- data/ext/XRB_Extension.bundle +0 -0
- data/ext/escape.o +0 -0
- data/ext/extconf.h +0 -5
- data/ext/markup.o +0 -0
- data/ext/query.o +0 -0
- data/ext/tag.o +0 -0
- data/ext/template.o +0 -0
- data/ext/xrb.o +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0bf51a6404c03e4c10d3a2ada0c804fdcc5df0daa1574d050811f617afcedbc
|
4
|
+
data.tar.gz: 59f805082ef9ce5c561d774a3ee7692adbfa05555fd7780422a76e411b9bfbd4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d40c30425864483f9c5c51427cf658a6d155037c2af514891ebf4a10e419344bcb844c4ee5341c6593392a42da9b3550a33c29ba36d3c3ba0301b2d17a66c3b
|
7
|
+
data.tar.gz: 2db7b9b57170efaafc057a1ab298a8a320954ef492c1181da26866087731ce34daf3c989e8dd5d4616deb808766fede23785ba699247270506bf6d08fe511137
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/bake/xrb/entities.rb
CHANGED
@@ -6,9 +6,9 @@
|
|
6
6
|
# Fetch the HTML5 entities from w3.org and update the local cache.
|
7
7
|
# @parameter force [Boolean] Whether to force regenerate the local cache.
|
8
8
|
def fetch_entities(force: false)
|
9
|
-
require
|
10
|
-
require
|
11
|
-
require
|
9
|
+
require "json"
|
10
|
+
require "async"
|
11
|
+
require "async/http/internet"
|
12
12
|
|
13
13
|
internet = Async::HTTP::Internet.new
|
14
14
|
entites_json_path = self.entites_json_path
|
@@ -21,17 +21,17 @@ def fetch_entities(force: false)
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
return JSON.parse(File.read(entites_json_path)).delete_if{|string, _| !string.end_with?
|
24
|
+
return JSON.parse(File.read(entites_json_path)).delete_if{|string, _| !string.end_with? ";"}
|
25
25
|
end
|
26
26
|
|
27
27
|
# Consume the HTML5 entites and generate parsers to escape them.
|
28
28
|
# @parameter wet [Boolean] Whether to write updated files.
|
29
29
|
def update_entities(wet: false)
|
30
|
-
require
|
30
|
+
require "xrb/template"
|
31
31
|
|
32
32
|
paths = {
|
33
33
|
# 'ext/xrb/entities.rl' => 'ext/xrb/entities.xrb',
|
34
|
-
|
34
|
+
"lib/xrb/entities.rb" => "lib/xrb/entities.xrb",
|
35
35
|
}
|
36
36
|
|
37
37
|
entities = self.fetch_entities
|
data/ext/extconf.rb
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
return if RUBY_DESCRIPTION =~ /jruby/
|
7
7
|
|
8
|
-
require
|
8
|
+
require "mkmf"
|
9
9
|
|
10
10
|
$CFLAGS << " -O3 -Wall -Wno-unknown-pragmas -std=c99"
|
11
11
|
|
@@ -17,4 +17,4 @@ $VPATH << "$(srcdir)/xrb"
|
|
17
17
|
|
18
18
|
create_header
|
19
19
|
|
20
|
-
create_makefile(
|
20
|
+
create_makefile("XRB_Extension")
|
data/lib/xrb/buffer.rb
CHANGED
data/lib/xrb/builder.rb
CHANGED
@@ -3,8 +3,8 @@
|
|
3
3
|
# Released under the MIT License.
|
4
4
|
# Copyright, 2012-2024, by Samuel Williams.
|
5
5
|
|
6
|
-
require_relative
|
7
|
-
require_relative
|
6
|
+
require_relative "markup"
|
7
|
+
require_relative "tag"
|
8
8
|
|
9
9
|
module XRB
|
10
10
|
# Build markup quickly and efficiently.
|
@@ -109,11 +109,11 @@ module XRB
|
|
109
109
|
if @indent
|
110
110
|
INDENT * (@level.size - 1)
|
111
111
|
else
|
112
|
-
|
112
|
+
""
|
113
113
|
end
|
114
114
|
end
|
115
115
|
|
116
|
-
def doctype(attributes =
|
116
|
+
def doctype(attributes = "html")
|
117
117
|
@output << "<!doctype #{attributes}>\n"
|
118
118
|
end
|
119
119
|
|
data/lib/xrb/error.rb
CHANGED
data/lib/xrb/fallback/markup.rb
CHANGED
@@ -1,14 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# line 1 "lib/xrb/fallback/markup.rl"
|
4
3
|
# Released under the MIT License.
|
5
4
|
# Copyright, 2016-2024, by Samuel Williams.
|
6
5
|
|
7
|
-
|
8
6
|
# line 190 "lib/xrb/fallback/markup.rl"
|
9
7
|
|
10
8
|
|
11
|
-
require_relative
|
9
|
+
require_relative "../error"
|
12
10
|
|
13
11
|
module XRB
|
14
12
|
module Fallback
|
data/lib/xrb/fallback/query.rb
CHANGED
@@ -1,14 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# line 1 "lib/xrb/fallback/query.rl"
|
4
3
|
# Released under the MIT License.
|
5
|
-
# Copyright,
|
6
|
-
|
4
|
+
# Copyright, 2020-2024, by Samuel Williams.
|
7
5
|
|
8
6
|
# line 57 "lib/xrb/fallback/query.rl"
|
9
7
|
|
10
8
|
|
11
|
-
require_relative
|
9
|
+
require_relative "../error"
|
12
10
|
|
13
11
|
module XRB
|
14
12
|
module Fallback
|
@@ -1,14 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# line 1 "lib/xrb/fallback/template.rl"
|
4
3
|
# Released under the MIT License.
|
5
4
|
# Copyright, 2016-2024, by Samuel Williams.
|
6
5
|
|
7
|
-
|
8
6
|
# line 80 "lib/xrb/fallback/template.rl"
|
9
7
|
|
10
8
|
|
11
|
-
require_relative
|
9
|
+
require_relative "../error"
|
12
10
|
|
13
11
|
module XRB
|
14
12
|
module Fallback
|
data/lib/xrb/markup.rb
CHANGED
data/lib/xrb/native.rb
CHANGED
@@ -3,13 +3,13 @@
|
|
3
3
|
# Released under the MIT License.
|
4
4
|
# Copyright, 2016-2024, by Samuel Williams.
|
5
5
|
|
6
|
-
require_relative
|
6
|
+
require_relative "error"
|
7
7
|
|
8
8
|
# Methods on the following classes may be replaced by native implementations:
|
9
|
-
require_relative
|
9
|
+
require_relative "tag"
|
10
10
|
|
11
11
|
begin
|
12
|
-
require
|
12
|
+
require "XRB_Extension"
|
13
13
|
rescue LoadError => error
|
14
14
|
warn "Could not load native parsers: #{error}"
|
15
|
-
end unless ENV[
|
15
|
+
end unless ENV["XRB_PREFER_FALLBACK"]
|
data/lib/xrb/parsers.rb
CHANGED
@@ -3,14 +3,14 @@
|
|
3
3
|
# Released under the MIT License.
|
4
4
|
# Copyright, 2012-2024, by Samuel Williams.
|
5
5
|
|
6
|
-
require_relative
|
6
|
+
require_relative "native"
|
7
7
|
|
8
8
|
if defined? XRB::Native
|
9
9
|
XRB::Parsers = XRB::Native
|
10
10
|
else
|
11
|
-
require_relative
|
12
|
-
require_relative
|
13
|
-
require_relative
|
11
|
+
require_relative "fallback/markup"
|
12
|
+
require_relative "fallback/template"
|
13
|
+
require_relative "fallback/query"
|
14
14
|
|
15
15
|
XRB::Parsers = XRB::Fallback
|
16
16
|
end
|
data/lib/xrb/query.rb
CHANGED
@@ -3,10 +3,10 @@
|
|
3
3
|
# Released under the MIT License.
|
4
4
|
# Copyright, 2020-2024, by Samuel Williams.
|
5
5
|
|
6
|
-
require_relative
|
7
|
-
require_relative
|
6
|
+
require_relative "buffer"
|
7
|
+
require_relative "parsers"
|
8
8
|
|
9
|
-
require
|
9
|
+
require "uri"
|
10
10
|
|
11
11
|
module XRB
|
12
12
|
module Query
|
data/lib/xrb/reference.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
# Released under the MIT License.
|
4
4
|
# Copyright, 2020-2024, by Samuel Williams.
|
5
5
|
|
6
|
-
require_relative
|
6
|
+
require_relative "query"
|
7
7
|
|
8
8
|
module XRB
|
9
9
|
class Reference
|
@@ -26,11 +26,11 @@ module XRB
|
|
26
26
|
buffer << escape_path(@path)
|
27
27
|
|
28
28
|
unless @query.empty?
|
29
|
-
buffer <<
|
29
|
+
buffer << "?" << query_string
|
30
30
|
end
|
31
31
|
|
32
32
|
if @fragment
|
33
|
-
buffer <<
|
33
|
+
buffer << "#" << escape(@fragment)
|
34
34
|
end
|
35
35
|
|
36
36
|
return buffer
|
@@ -55,7 +55,7 @@ module XRB
|
|
55
55
|
def escape_path(path)
|
56
56
|
encoding = path.encoding
|
57
57
|
path.b.gsub(NON_PCHAR) do |m|
|
58
|
-
|
58
|
+
"%" + m.unpack("H2" * m.bytesize).join("%").upcase
|
59
59
|
end.force_encoding(encoding)
|
60
60
|
end
|
61
61
|
|
@@ -63,7 +63,7 @@ module XRB
|
|
63
63
|
def escape(string)
|
64
64
|
encoding = string.encoding
|
65
65
|
string.b.gsub(/([^a-zA-Z0-9_.\-]+)/) do |m|
|
66
|
-
|
66
|
+
"%" + m.unpack("H2" * m.bytesize).join("%").upcase
|
67
67
|
end.force_encoding(encoding)
|
68
68
|
end
|
69
69
|
|
@@ -80,7 +80,7 @@ module XRB
|
|
80
80
|
when Hash
|
81
81
|
value.map { |k, v|
|
82
82
|
build_nested_query(v, prefix ? "#{prefix}[#{escape(k.to_s)}]" : escape(k.to_s))
|
83
|
-
}.reject(&:empty?).join(
|
83
|
+
}.reject(&:empty?).join("&")
|
84
84
|
when nil
|
85
85
|
prefix
|
86
86
|
else
|
@@ -91,9 +91,9 @@ module XRB
|
|
91
91
|
end
|
92
92
|
|
93
93
|
# Generate a URI from a path and user parameters. The path may contain a `#fragment` or `?query=parameters`.
|
94
|
-
def self.Reference(path =
|
95
|
-
base, fragment = path.split(
|
96
|
-
path, query_string = base.split(
|
94
|
+
def self.Reference(path = "", **parameters)
|
95
|
+
base, fragment = path.split("#", 2)
|
96
|
+
path, query_string = base.split("?", 2)
|
97
97
|
|
98
98
|
if query_string
|
99
99
|
query = Query.parse(Buffer.new(query_string))
|
data/lib/xrb/tag.rb
CHANGED
@@ -3,13 +3,13 @@
|
|
3
3
|
# Released under the MIT License.
|
4
4
|
# Copyright, 2017-2024, by Samuel Williams.
|
5
5
|
|
6
|
-
require_relative
|
6
|
+
require_relative "markup"
|
7
7
|
|
8
8
|
module XRB
|
9
9
|
# This represents an individual SGML tag, e.g. <a>, </a> or <a />, with attributes. Attribute values must be escaped.
|
10
10
|
Tag = Struct.new(:name, :closed, :attributes) do
|
11
11
|
def self.split(qualified_name)
|
12
|
-
if i = qualified_name.index(
|
12
|
+
if i = qualified_name.index(":")
|
13
13
|
return qualified_name.slice(0...i), qualified_name.slice(i+1..-1)
|
14
14
|
else
|
15
15
|
return nil, qualified_name
|
@@ -24,6 +24,14 @@ module XRB
|
|
24
24
|
self.new(name, false, attributes)
|
25
25
|
end
|
26
26
|
|
27
|
+
def append_markup(output)
|
28
|
+
self.write(output)
|
29
|
+
end
|
30
|
+
|
31
|
+
def build_markup(builder)
|
32
|
+
self.append_markup(builder.output)
|
33
|
+
end
|
34
|
+
|
27
35
|
def [] key
|
28
36
|
attributes[key]
|
29
37
|
end
|
@@ -41,19 +49,19 @@ module XRB
|
|
41
49
|
end
|
42
50
|
|
43
51
|
def write_opening_tag(buffer)
|
44
|
-
buffer <<
|
52
|
+
buffer << "<" << name
|
45
53
|
|
46
54
|
self.class.append_attributes(buffer, attributes, nil)
|
47
55
|
|
48
56
|
if self_closed?
|
49
|
-
buffer <<
|
57
|
+
buffer << "/>"
|
50
58
|
else
|
51
|
-
buffer <<
|
59
|
+
buffer << ">"
|
52
60
|
end
|
53
61
|
end
|
54
62
|
|
55
63
|
def write_closing_tag(buffer)
|
56
|
-
buffer <<
|
64
|
+
buffer << "</" << name << ">"
|
57
65
|
end
|
58
66
|
|
59
67
|
def write(buffer, content = nil)
|
@@ -69,18 +77,18 @@ module XRB
|
|
69
77
|
end
|
70
78
|
|
71
79
|
def self.append_tag(buffer, name, attributes, content)
|
72
|
-
buffer <<
|
80
|
+
buffer << "<" << name.to_s
|
73
81
|
|
74
82
|
self.append_attributes(buffer, attributes, nil)
|
75
83
|
|
76
84
|
if !content
|
77
|
-
buffer <<
|
85
|
+
buffer << "/>"
|
78
86
|
else
|
79
|
-
buffer <<
|
87
|
+
buffer << ">"
|
80
88
|
unless content == true
|
81
89
|
content.append_markup(buffer)
|
82
90
|
end
|
83
|
-
buffer <<
|
91
|
+
buffer << "</" << name.to_s << ">"
|
84
92
|
end
|
85
93
|
|
86
94
|
return nil
|
@@ -103,9 +111,9 @@ module XRB
|
|
103
111
|
self.append_attributes(buffer, [attribute], attribute_key)
|
104
112
|
end
|
105
113
|
when TrueClass
|
106
|
-
buffer <<
|
114
|
+
buffer << " " << attribute_key.to_s
|
107
115
|
else
|
108
|
-
buffer <<
|
116
|
+
buffer << " " << attribute_key.to_s << '="'
|
109
117
|
value.append_markup(buffer)
|
110
118
|
buffer << '"'
|
111
119
|
end
|
data/lib/xrb/template.rb
CHANGED
@@ -3,10 +3,10 @@
|
|
3
3
|
# Released under the MIT License.
|
4
4
|
# Copyright, 2012-2024, by Samuel Williams.
|
5
5
|
|
6
|
-
require_relative
|
7
|
-
require_relative
|
8
|
-
require_relative
|
9
|
-
require_relative
|
6
|
+
require_relative "parsers"
|
7
|
+
require_relative "markup"
|
8
|
+
require_relative "buffer"
|
9
|
+
require_relative "builder"
|
10
10
|
|
11
11
|
module XRB
|
12
12
|
# The output variable that will be used in templates:
|
@@ -54,6 +54,7 @@ module XRB
|
|
54
54
|
attr :code
|
55
55
|
|
56
56
|
# Output raw text to the template.
|
57
|
+
# Raw text should be escaped, e.g. it can't contain tags or other special characters.
|
57
58
|
def text(text)
|
58
59
|
# We have to use an approach which preserves newlines and tabs as raw characters.
|
59
60
|
text = text.gsub("'", "\\\\'")
|
@@ -62,7 +63,7 @@ module XRB
|
|
62
63
|
|
63
64
|
# Output a ruby expression (or part of).
|
64
65
|
def instruction(text, postfix = nil)
|
65
|
-
@code << text << (postfix ||
|
66
|
+
@code << text << (postfix || ";")
|
66
67
|
end
|
67
68
|
|
68
69
|
# Output a string interpolation.
|
data/lib/xrb/uri.rb
CHANGED
@@ -27,15 +27,15 @@ module XRB
|
|
27
27
|
|
28
28
|
def append(buffer)
|
29
29
|
if @query_string
|
30
|
-
buffer << escape_path(@path) <<
|
31
|
-
buffer <<
|
30
|
+
buffer << escape_path(@path) << "?" << query_string
|
31
|
+
buffer << "&" << query_parameters if @parameters
|
32
32
|
else
|
33
33
|
buffer << escape_path(@path)
|
34
|
-
buffer <<
|
34
|
+
buffer << "?" << query_parameters if @parameters
|
35
35
|
end
|
36
36
|
|
37
37
|
if @fragment
|
38
|
-
buffer <<
|
38
|
+
buffer << "#" << escape(@fragment)
|
39
39
|
end
|
40
40
|
|
41
41
|
return buffer
|
@@ -55,7 +55,7 @@ module XRB
|
|
55
55
|
def escape_path(path)
|
56
56
|
encoding = path.encoding
|
57
57
|
path.b.gsub(NON_PCHAR) do |m|
|
58
|
-
|
58
|
+
"%" + m.unpack("H2" * m.bytesize).join("%").upcase
|
59
59
|
end.force_encoding(encoding)
|
60
60
|
end
|
61
61
|
|
@@ -63,7 +63,7 @@ module XRB
|
|
63
63
|
def escape(string)
|
64
64
|
encoding = string.encoding
|
65
65
|
string.b.gsub(/([^a-zA-Z0-9_.\-]+)/) do |m|
|
66
|
-
|
66
|
+
"%" + m.unpack("H2" * m.bytesize).join("%").upcase
|
67
67
|
end.force_encoding(encoding)
|
68
68
|
end
|
69
69
|
|
@@ -80,7 +80,7 @@ module XRB
|
|
80
80
|
when Hash
|
81
81
|
value.map { |k, v|
|
82
82
|
build_nested_query(v, prefix ? "#{prefix}[#{escape(k.to_s)}]" : escape(k.to_s))
|
83
|
-
}.reject(&:empty?).join(
|
83
|
+
}.reject(&:empty?).join("&")
|
84
84
|
when nil
|
85
85
|
prefix
|
86
86
|
else
|
@@ -91,9 +91,9 @@ module XRB
|
|
91
91
|
end
|
92
92
|
|
93
93
|
# Generate a URI from a path and user parameters. The path may contain a `#fragment` or `?query=parameters`.
|
94
|
-
def self.URI(path =
|
95
|
-
base, fragment = path.split(
|
96
|
-
path, query_string = base.split(
|
94
|
+
def self.URI(path = "", parameters = nil)
|
95
|
+
base, fragment = path.split("#", 2)
|
96
|
+
path, query_string = base.split("?", 2)
|
97
97
|
|
98
98
|
URI.new(path, query_string, fragment, parameters)
|
99
99
|
end
|
data/lib/xrb/version.rb
CHANGED
data/lib/xrb.rb
CHANGED
@@ -3,9 +3,9 @@
|
|
3
3
|
# Released under the MIT License.
|
4
4
|
# Copyright, 2012-2024, by Samuel Williams.
|
5
5
|
|
6
|
-
require_relative
|
7
|
-
require_relative
|
8
|
-
require_relative
|
9
|
-
require_relative
|
6
|
+
require_relative "xrb/version"
|
7
|
+
require_relative "xrb/native"
|
8
|
+
require_relative "xrb/builder"
|
9
|
+
require_relative "xrb/template"
|
10
10
|
|
11
|
-
require_relative
|
11
|
+
require_relative "xrb/reference"
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xrb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -40,7 +40,7 @@ cert_chain:
|
|
40
40
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
41
41
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
42
42
|
-----END CERTIFICATE-----
|
43
|
-
date: 2024-10-
|
43
|
+
date: 2024-10-28 00:00:00.000000000 Z
|
44
44
|
dependencies: []
|
45
45
|
description:
|
46
46
|
email:
|
@@ -51,16 +51,7 @@ extra_rdoc_files: []
|
|
51
51
|
files:
|
52
52
|
- bake/xrb/entities.rb
|
53
53
|
- bake/xrb/parsers.rb
|
54
|
-
- ext/Makefile
|
55
|
-
- ext/XRB_Extension.bundle
|
56
|
-
- ext/escape.o
|
57
|
-
- ext/extconf.h
|
58
54
|
- ext/extconf.rb
|
59
|
-
- ext/markup.o
|
60
|
-
- ext/query.o
|
61
|
-
- ext/tag.o
|
62
|
-
- ext/template.o
|
63
|
-
- ext/xrb.o
|
64
55
|
- ext/xrb/escape.c
|
65
56
|
- ext/xrb/escape.h
|
66
57
|
- ext/xrb/markup.c
|
metadata.gz.sig
CHANGED
Binary file
|
data/ext/Makefile
DELETED
@@ -1,270 +0,0 @@
|
|
1
|
-
|
2
|
-
SHELL = /bin/sh
|
3
|
-
|
4
|
-
# V=0 quiet, V=1 verbose. other values don't work.
|
5
|
-
V = 0
|
6
|
-
V0 = $(V:0=)
|
7
|
-
Q1 = $(V:1=)
|
8
|
-
Q = $(Q1:0=@)
|
9
|
-
ECHO1 = $(V:1=@ :)
|
10
|
-
ECHO = $(ECHO1:0=@ echo)
|
11
|
-
NULLCMD = :
|
12
|
-
|
13
|
-
#### Start of system configuration section. ####
|
14
|
-
|
15
|
-
srcdir = .
|
16
|
-
topdir = /Users/samuel/.rubies/ruby-3.3.4/include/ruby-3.3.0
|
17
|
-
hdrdir = $(topdir)
|
18
|
-
arch_hdrdir = /Users/samuel/.rubies/ruby-3.3.4/include/ruby-3.3.0/arm64-darwin24
|
19
|
-
PATH_SEPARATOR = :
|
20
|
-
VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby:$(srcdir)/xrb
|
21
|
-
prefix = $(DESTDIR)/Users/samuel/.rubies/ruby-3.3.4
|
22
|
-
rubysitearchprefix = $(rubylibprefix)/$(sitearch)
|
23
|
-
rubyarchprefix = $(rubylibprefix)/$(arch)
|
24
|
-
rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
|
25
|
-
exec_prefix = $(prefix)
|
26
|
-
vendorarchhdrdir = $(vendorhdrdir)/$(sitearch)
|
27
|
-
sitearchhdrdir = $(sitehdrdir)/$(sitearch)
|
28
|
-
rubyarchhdrdir = $(rubyhdrdir)/$(arch)
|
29
|
-
vendorhdrdir = $(rubyhdrdir)/vendor_ruby
|
30
|
-
sitehdrdir = $(rubyhdrdir)/site_ruby
|
31
|
-
rubyhdrdir = $(includedir)/$(RUBY_VERSION_NAME)
|
32
|
-
vendorarchdir = $(vendorlibdir)/$(sitearch)
|
33
|
-
vendorlibdir = $(vendordir)/$(ruby_version)
|
34
|
-
vendordir = $(rubylibprefix)/vendor_ruby
|
35
|
-
sitearchdir = $(sitelibdir)/$(sitearch)
|
36
|
-
sitelibdir = $(sitedir)/$(ruby_version)
|
37
|
-
sitedir = $(rubylibprefix)/site_ruby
|
38
|
-
rubyarchdir = $(rubylibdir)/$(arch)
|
39
|
-
rubylibdir = $(rubylibprefix)/$(ruby_version)
|
40
|
-
sitearchincludedir = $(includedir)/$(sitearch)
|
41
|
-
archincludedir = $(includedir)/$(arch)
|
42
|
-
sitearchlibdir = $(libdir)/$(sitearch)
|
43
|
-
archlibdir = $(libdir)/$(arch)
|
44
|
-
ridir = $(datarootdir)/$(RI_BASE_NAME)
|
45
|
-
mandir = $(datarootdir)/man
|
46
|
-
localedir = $(datarootdir)/locale
|
47
|
-
libdir = $(exec_prefix)/lib
|
48
|
-
psdir = $(docdir)
|
49
|
-
pdfdir = $(docdir)
|
50
|
-
dvidir = $(docdir)
|
51
|
-
htmldir = $(docdir)
|
52
|
-
infodir = $(datarootdir)/info
|
53
|
-
docdir = $(datarootdir)/doc/$(PACKAGE)
|
54
|
-
oldincludedir = $(DESTDIR)/usr/include
|
55
|
-
includedir = $(SDKROOT)$(prefix)/include
|
56
|
-
runstatedir = $(localstatedir)/run
|
57
|
-
localstatedir = $(prefix)/var
|
58
|
-
sharedstatedir = $(prefix)/com
|
59
|
-
sysconfdir = $(prefix)/etc
|
60
|
-
datadir = $(datarootdir)
|
61
|
-
datarootdir = $(prefix)/share
|
62
|
-
libexecdir = $(exec_prefix)/libexec
|
63
|
-
sbindir = $(exec_prefix)/sbin
|
64
|
-
bindir = $(exec_prefix)/bin
|
65
|
-
archdir = $(rubyarchdir)
|
66
|
-
|
67
|
-
|
68
|
-
CC_WRAPPER =
|
69
|
-
CC = clang
|
70
|
-
CXX = clang++
|
71
|
-
LIBRUBY = $(LIBRUBY_A)
|
72
|
-
LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
|
73
|
-
LIBRUBYARG_SHARED =
|
74
|
-
LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static -framework CoreFoundation $(MAINLIBS)
|
75
|
-
empty =
|
76
|
-
OUTFLAG = -o $(empty)
|
77
|
-
COUTFLAG = -o $(empty)
|
78
|
-
CSRCFLAG = $(empty)
|
79
|
-
|
80
|
-
RUBY_EXTCONF_H = extconf.h
|
81
|
-
cflags = -fdeclspec $(optflags) $(debugflags) $(warnflags)
|
82
|
-
cxxflags =
|
83
|
-
optflags = -O3 -fno-fast-math
|
84
|
-
debugflags = -ggdb3
|
85
|
-
warnflags = -Wall -Wextra -Wextra-tokens -Wdeprecated-declarations -Wdivision-by-zero -Wdiv-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wmisleading-indentation -Wundef
|
86
|
-
cppflags =
|
87
|
-
CCDLFLAGS = -fno-common
|
88
|
-
CFLAGS = $(CCDLFLAGS) $(cflags) -pipe -O3 -Wall -Wno-unknown-pragmas -std=c99 $(ARCH_FLAG)
|
89
|
-
INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir)
|
90
|
-
DEFS =
|
91
|
-
CPPFLAGS = -DRUBY_EXTCONF_H=\"$(RUBY_EXTCONF_H)\" -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT $(DEFS) $(cppflags)
|
92
|
-
CXXFLAGS = $(CCDLFLAGS) -fdeclspec $(ARCH_FLAG)
|
93
|
-
ldflags = -L. -fstack-protector-strong -L/opt/local/lib
|
94
|
-
dldflags = -L/opt/local/lib -Wl,-undefined,dynamic_lookup -bundle_loader '$(BUILTRUBY)'
|
95
|
-
ARCH_FLAG = -arch arm64
|
96
|
-
DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
|
97
|
-
LDSHARED = $(CC) -dynamic -bundle
|
98
|
-
LDSHAREDXX = $(CXX) -dynamic -bundle
|
99
|
-
AR = ar
|
100
|
-
EXEEXT =
|
101
|
-
|
102
|
-
RUBY_INSTALL_NAME = $(RUBY_BASE_NAME)
|
103
|
-
RUBY_SO_NAME = ruby.3.3
|
104
|
-
RUBYW_INSTALL_NAME =
|
105
|
-
RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version)
|
106
|
-
RUBYW_BASE_NAME = rubyw
|
107
|
-
RUBY_BASE_NAME = ruby
|
108
|
-
|
109
|
-
arch = arm64-darwin24
|
110
|
-
sitearch = $(arch)
|
111
|
-
ruby_version = 3.3.0
|
112
|
-
ruby = $(bindir)/$(RUBY_BASE_NAME)
|
113
|
-
RUBY = $(ruby)
|
114
|
-
BUILTRUBY = $(bindir)/$(RUBY_BASE_NAME)
|
115
|
-
ruby_headers = $(hdrdir)/ruby.h $(hdrdir)/ruby/backward.h $(hdrdir)/ruby/ruby.h $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/missing.h $(hdrdir)/ruby/intern.h $(hdrdir)/ruby/st.h $(hdrdir)/ruby/subst.h $(arch_hdrdir)/ruby/config.h $(RUBY_EXTCONF_H)
|
116
|
-
|
117
|
-
RM = rm -f
|
118
|
-
RM_RF = rm -fr
|
119
|
-
RMDIRS = rmdir -p
|
120
|
-
MAKEDIRS = mkdir -p
|
121
|
-
INSTALL = /usr/bin/install -c
|
122
|
-
INSTALL_PROG = $(INSTALL) -m 0755
|
123
|
-
INSTALL_DATA = $(INSTALL) -m 644
|
124
|
-
COPY = cp
|
125
|
-
TOUCH = exit >
|
126
|
-
|
127
|
-
#### End of system configuration section. ####
|
128
|
-
|
129
|
-
preload =
|
130
|
-
libpath = . $(libdir) /opt/local/lib
|
131
|
-
LIBPATH = -L. -L$(libdir) -L/opt/local/lib
|
132
|
-
DEFFILE =
|
133
|
-
|
134
|
-
CLEANFILES = mkmf.log
|
135
|
-
DISTCLEANFILES =
|
136
|
-
DISTCLEANDIRS =
|
137
|
-
|
138
|
-
extout =
|
139
|
-
extout_prefix =
|
140
|
-
target_prefix =
|
141
|
-
LOCAL_LIBS =
|
142
|
-
LIBS = -lpthread
|
143
|
-
ORIG_SRCS =
|
144
|
-
SRCS = $(ORIG_SRCS) escape.c markup.c query.c tag.c template.c xrb.c
|
145
|
-
OBJS = escape.o markup.o query.o tag.o template.o xrb.o
|
146
|
-
HDRS = $(srcdir)/extconf.h
|
147
|
-
LOCAL_HDRS =
|
148
|
-
TARGET = XRB_Extension
|
149
|
-
TARGET_NAME = XRB_Extension
|
150
|
-
TARGET_ENTRY = Init_$(TARGET_NAME)
|
151
|
-
DLLIB = $(TARGET).bundle
|
152
|
-
EXTSTATIC =
|
153
|
-
STATIC_LIB =
|
154
|
-
|
155
|
-
TIMESTAMP_DIR = .
|
156
|
-
BINDIR = $(bindir)
|
157
|
-
RUBYCOMMONDIR = $(sitedir)$(target_prefix)
|
158
|
-
RUBYLIBDIR = $(sitelibdir)$(target_prefix)
|
159
|
-
RUBYARCHDIR = $(sitearchdir)$(target_prefix)
|
160
|
-
HDRDIR = $(sitehdrdir)$(target_prefix)
|
161
|
-
ARCHHDRDIR = $(sitearchhdrdir)$(target_prefix)
|
162
|
-
TARGET_SO_DIR =
|
163
|
-
TARGET_SO = $(TARGET_SO_DIR)$(DLLIB)
|
164
|
-
CLEANLIBS = $(TARGET_SO) $(TARGET_SO).dSYM
|
165
|
-
CLEANOBJS = $(OBJS) *.bak
|
166
|
-
TARGET_SO_DIR_TIMESTAMP = $(TIMESTAMP_DIR)/.sitearchdir.time
|
167
|
-
|
168
|
-
all: $(DLLIB)
|
169
|
-
static: $(STATIC_LIB)
|
170
|
-
.PHONY: all install static install-so install-rb
|
171
|
-
.PHONY: clean clean-so clean-static clean-rb
|
172
|
-
|
173
|
-
clean-static::
|
174
|
-
clean-rb-default::
|
175
|
-
clean-rb::
|
176
|
-
clean-so::
|
177
|
-
clean: clean-so clean-static clean-rb-default clean-rb
|
178
|
-
-$(Q)$(RM_RF) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES) .*.time
|
179
|
-
|
180
|
-
distclean-rb-default::
|
181
|
-
distclean-rb::
|
182
|
-
distclean-so::
|
183
|
-
distclean-static::
|
184
|
-
distclean: clean distclean-so distclean-static distclean-rb-default distclean-rb
|
185
|
-
-$(Q)$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
|
186
|
-
-$(Q)$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
|
187
|
-
-$(Q)$(RMDIRS) $(DISTCLEANDIRS) 2> /dev/null || true
|
188
|
-
|
189
|
-
realclean: distclean
|
190
|
-
install: install-so install-rb
|
191
|
-
|
192
|
-
install-so: $(DLLIB) $(TARGET_SO_DIR_TIMESTAMP)
|
193
|
-
$(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
|
194
|
-
clean-static::
|
195
|
-
-$(Q)$(RM) $(STATIC_LIB)
|
196
|
-
install-rb: pre-install-rb do-install-rb install-rb-default
|
197
|
-
install-rb-default: pre-install-rb-default do-install-rb-default
|
198
|
-
pre-install-rb: Makefile
|
199
|
-
pre-install-rb-default: Makefile
|
200
|
-
do-install-rb:
|
201
|
-
do-install-rb-default:
|
202
|
-
pre-install-rb-default:
|
203
|
-
@$(NULLCMD)
|
204
|
-
$(TARGET_SO_DIR_TIMESTAMP):
|
205
|
-
$(Q) $(MAKEDIRS) $(@D) $(RUBYARCHDIR)
|
206
|
-
$(Q) $(TOUCH) $@
|
207
|
-
|
208
|
-
site-install: site-install-so site-install-rb
|
209
|
-
site-install-so: install-so
|
210
|
-
site-install-rb: install-rb
|
211
|
-
|
212
|
-
.SUFFIXES: .c .m .cc .mm .cxx .cpp .o .S
|
213
|
-
|
214
|
-
.cc.o:
|
215
|
-
$(ECHO) compiling $(<)
|
216
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
217
|
-
|
218
|
-
.cc.S:
|
219
|
-
$(ECHO) translating $(<)
|
220
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
221
|
-
|
222
|
-
.mm.o:
|
223
|
-
$(ECHO) compiling $(<)
|
224
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
225
|
-
|
226
|
-
.mm.S:
|
227
|
-
$(ECHO) translating $(<)
|
228
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
229
|
-
|
230
|
-
.cxx.o:
|
231
|
-
$(ECHO) compiling $(<)
|
232
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
233
|
-
|
234
|
-
.cxx.S:
|
235
|
-
$(ECHO) translating $(<)
|
236
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
237
|
-
|
238
|
-
.cpp.o:
|
239
|
-
$(ECHO) compiling $(<)
|
240
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
241
|
-
|
242
|
-
.cpp.S:
|
243
|
-
$(ECHO) translating $(<)
|
244
|
-
$(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
245
|
-
|
246
|
-
.c.o:
|
247
|
-
$(ECHO) compiling $(<)
|
248
|
-
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
249
|
-
|
250
|
-
.c.S:
|
251
|
-
$(ECHO) translating $(<)
|
252
|
-
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
253
|
-
|
254
|
-
.m.o:
|
255
|
-
$(ECHO) compiling $(<)
|
256
|
-
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
|
257
|
-
|
258
|
-
.m.S:
|
259
|
-
$(ECHO) translating $(<)
|
260
|
-
$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
|
261
|
-
|
262
|
-
$(TARGET_SO): $(OBJS) Makefile
|
263
|
-
$(ECHO) linking shared-object $(DLLIB)
|
264
|
-
-$(Q)$(RM) $(@)
|
265
|
-
$(Q) $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
|
266
|
-
$(Q) $(POSTLINK)
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
$(OBJS): $(HDRS) $(ruby_headers)
|
data/ext/XRB_Extension.bundle
DELETED
Binary file
|
data/ext/escape.o
DELETED
Binary file
|
data/ext/extconf.h
DELETED
data/ext/markup.o
DELETED
Binary file
|
data/ext/query.o
DELETED
Binary file
|
data/ext/tag.o
DELETED
Binary file
|
data/ext/template.o
DELETED
Binary file
|
data/ext/xrb.o
DELETED
Binary file
|