xrb 0.6.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fd37ae9601f70b0cfcbabe16d8fcb75979e9f1f3c31b09c09dc09e0778ecee62
4
- data.tar.gz: 24fec49db14fee7d33279c8a1ebd886be3c260c094a40315525ca53c86e82421
3
+ metadata.gz: bd5f5866b9f16e578f765cb49940fa5f4b43f6421ce1efe187a2e6b56a150e58
4
+ data.tar.gz: 51345868ef2d3e106f47a2927fb4c908331bc5fd3317f0d83a4aa65d49e9b253
5
5
  SHA512:
6
- metadata.gz: 95f9e7530e0d5419c5a55a0a33d242f54fc15ac1f1e48d046c27b2b46d627e19b4fc7a90c111e428e502f58afe2a93818610758ecb757c31cc7990f2756f8220
7
- data.tar.gz: 0fc975c1d6b59077b326efd428bb2f0039ead7198145c4b66aaab098fe0c58caaf0018c2568ea8fc0cab81b0f5346bd35df102eaac0ebe02e28ee7713ca020bd
6
+ metadata.gz: efe42a5f52863f29a1383fdc2572b9aac8c870e4ce905a0d2b4426859bc9f4113697f0ea1450d2354accddc27c74e2df1944512400029f3c548743cde4da35ed
7
+ data.tar.gz: a689741788594d7c11700fe92f5ef0f71a9bef88b2b4b15dd7df3483d05e6630cd99f9863b41901c6f10bf6a0ed3327fb46acad581dfbebb26d83a45926c5e2f
checksums.yaml.gz.sig CHANGED
Binary file
data/bake/xrb/parsers.rb CHANGED
@@ -59,8 +59,3 @@ end
59
59
  def native_directory
60
60
  "ext/xrb"
61
61
  end
62
-
63
- def system(*arguments, **options)
64
- Console.info(self, arguments: arguments, options: options)
65
- super
66
- end
data/ext/Makefile CHANGED
@@ -13,12 +13,12 @@ NULLCMD = :
13
13
  #### Start of system configuration section. ####
14
14
 
15
15
  srcdir = .
16
- topdir = /Users/samuel/.rubies/ruby-3.3.0/include/ruby-3.3.0
16
+ topdir = /Users/samuel/.rubies/ruby-3.3.3/include/ruby-3.3.0
17
17
  hdrdir = $(topdir)
18
- arch_hdrdir = /Users/samuel/.rubies/ruby-3.3.0/include/ruby-3.3.0/arm64-darwin23
18
+ arch_hdrdir = /Users/samuel/.rubies/ruby-3.3.3/include/ruby-3.3.0/arm64-darwin23
19
19
  PATH_SEPARATOR = :
20
20
  VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby:$(srcdir)/xrb
21
- prefix = $(DESTDIR)/Users/samuel/.rubies/ruby-3.3.0
21
+ prefix = $(DESTDIR)/Users/samuel/.rubies/ruby-3.3.3
22
22
  rubysitearchprefix = $(rubylibprefix)/$(sitearch)
23
23
  rubyarchprefix = $(rubylibprefix)/$(arch)
24
24
  rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
@@ -96,7 +96,7 @@ ARCH_FLAG = -arch arm64
96
96
  DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
97
97
  LDSHARED = $(CC) -dynamic -bundle
98
98
  LDSHAREDXX = $(CXX) -dynamic -bundle
99
- AR = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar
99
+ AR = ar
100
100
  EXEEXT =
101
101
 
102
102
  RUBY_INSTALL_NAME = $(RUBY_BASE_NAME)
Binary file
data/ext/escape.o CHANGED
Binary file
data/ext/markup.o CHANGED
Binary file
data/ext/mkmf.log CHANGED
@@ -1,6 +1,6 @@
1
1
  have_func: checking for rb_sym2str()... -------------------- yes
2
2
 
3
- DYLD_LIBRARY_PATH=.:/Users/samuel/.rubies/ruby-3.3.0/lib "clang -o conftest -I/Users/samuel/.rubies/ruby-3.3.0/include/ruby-3.3.0/arm64-darwin23 -I/Users/samuel/.rubies/ruby-3.3.0/include/ruby-3.3.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.3.0/include/ruby-3.3.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fdeclspec -O3 -fno-fast-math -ggdb3 -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 -pipe -O3 -Wall -Wno-unknown-pragmas -std=c99 conftest.c -L. -L/Users/samuel/.rubies/ruby-3.3.0/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -arch arm64 -lruby.3.3-static -framework CoreFoundation -ldl -lobjc -lpthread -lpthread "
3
+ DYLD_LIBRARY_PATH=.:/Users/samuel/.rubies/ruby-3.3.3/lib "clang -o conftest -I/Users/samuel/.rubies/ruby-3.3.3/include/ruby-3.3.0/arm64-darwin23 -I/Users/samuel/.rubies/ruby-3.3.3/include/ruby-3.3.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.3.3/include/ruby-3.3.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fdeclspec -O3 -fno-fast-math -ggdb3 -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 -pipe -O3 -Wall -Wno-unknown-pragmas -std=c99 conftest.c -L. -L/Users/samuel/.rubies/ruby-3.3.3/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -arch arm64 -lruby.3.3-static -framework CoreFoundation -lgmp -ldl -lobjc -lpthread -lpthread "
4
4
  ld: warning: ignoring duplicate libraries: '-lpthread'
5
5
  checked program was:
6
6
  /* begin */
@@ -12,7 +12,7 @@ checked program was:
12
12
  6: }
13
13
  /* end */
14
14
 
15
- DYLD_LIBRARY_PATH=.:/Users/samuel/.rubies/ruby-3.3.0/lib "clang -o conftest -I/Users/samuel/.rubies/ruby-3.3.0/include/ruby-3.3.0/arm64-darwin23 -I/Users/samuel/.rubies/ruby-3.3.0/include/ruby-3.3.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.3.0/include/ruby-3.3.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fdeclspec -O3 -fno-fast-math -ggdb3 -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 -pipe -O3 -Wall -Wno-unknown-pragmas -std=c99 conftest.c -L. -L/Users/samuel/.rubies/ruby-3.3.0/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -arch arm64 -lruby.3.3-static -framework CoreFoundation -ldl -lobjc -lpthread -lpthread "
15
+ DYLD_LIBRARY_PATH=.:/Users/samuel/.rubies/ruby-3.3.3/lib "clang -o conftest -I/Users/samuel/.rubies/ruby-3.3.3/include/ruby-3.3.0/arm64-darwin23 -I/Users/samuel/.rubies/ruby-3.3.3/include/ruby-3.3.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.3.3/include/ruby-3.3.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fdeclspec -O3 -fno-fast-math -ggdb3 -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 -pipe -O3 -Wall -Wno-unknown-pragmas -std=c99 conftest.c -L. -L/Users/samuel/.rubies/ruby-3.3.3/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -arch arm64 -lruby.3.3-static -framework CoreFoundation -lgmp -ldl -lobjc -lpthread -lpthread "
16
16
  ld: warning: ignoring duplicate libraries: '-lpthread'
17
17
  checked program was:
18
18
  /* begin */
@@ -36,7 +36,7 @@ checked program was:
36
36
 
37
37
  have_func: checking for rb_str_cat_cstr()... -------------------- yes
38
38
 
39
- DYLD_LIBRARY_PATH=.:/Users/samuel/.rubies/ruby-3.3.0/lib "clang -o conftest -I/Users/samuel/.rubies/ruby-3.3.0/include/ruby-3.3.0/arm64-darwin23 -I/Users/samuel/.rubies/ruby-3.3.0/include/ruby-3.3.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.3.0/include/ruby-3.3.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fdeclspec -O3 -fno-fast-math -ggdb3 -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 -pipe -O3 -Wall -Wno-unknown-pragmas -std=c99 conftest.c -L. -L/Users/samuel/.rubies/ruby-3.3.0/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -arch arm64 -lruby.3.3-static -framework CoreFoundation -ldl -lobjc -lpthread -lpthread "
39
+ DYLD_LIBRARY_PATH=.:/Users/samuel/.rubies/ruby-3.3.3/lib "clang -o conftest -I/Users/samuel/.rubies/ruby-3.3.3/include/ruby-3.3.0/arm64-darwin23 -I/Users/samuel/.rubies/ruby-3.3.3/include/ruby-3.3.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.3.3/include/ruby-3.3.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fdeclspec -O3 -fno-fast-math -ggdb3 -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 -pipe -O3 -Wall -Wno-unknown-pragmas -std=c99 conftest.c -L. -L/Users/samuel/.rubies/ruby-3.3.3/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -arch arm64 -lruby.3.3-static -framework CoreFoundation -lgmp -ldl -lobjc -lpthread -lpthread "
40
40
  ld: warning: ignoring duplicate libraries: '-lpthread'
41
41
  checked program was:
42
42
  /* begin */
data/ext/query.o CHANGED
Binary file
data/ext/tag.o CHANGED
Binary file
data/ext/template.o CHANGED
Binary file
data/ext/xrb.o CHANGED
Binary file
@@ -1,3 +1,6 @@
1
+ # frozen_string_literal: true
2
+ # Released under the MIT License.
3
+ # Copyright, 2016-2024, by Samuel Williams.
1
4
 
2
5
  # line 1 "lib/xrb/fallback/markup.rl"
3
6
  # Released under the MIT License.
@@ -1,3 +1,6 @@
1
+ # frozen_string_literal: true
2
+ # Released under the MIT License.
3
+ # Copyright, 2020-2024, by Samuel Williams.
1
4
 
2
5
  # line 1 "lib/xrb/fallback/query.rl"
3
6
  # Released under the MIT License.
@@ -1,3 +1,6 @@
1
+ # frozen_string_literal: true
2
+ # Released under the MIT License.
3
+ # Copyright, 2016-2024, by Samuel Williams.
1
4
 
2
5
  # line 1 "lib/xrb/fallback/template.rl"
3
6
  # Released under the MIT License.
data/lib/xrb/template.rb CHANGED
@@ -11,6 +11,8 @@ require_relative 'builder'
11
11
  module XRB
12
12
  # The output variable that will be used in templates:
13
13
  OUT = :_out
14
+
15
+ # The default binding to use when compiling templates.
14
16
  BINDING = binding
15
17
 
16
18
  class Builder
@@ -19,7 +21,9 @@ module XRB
19
21
  end
20
22
  end
21
23
 
24
+ # An evaluatable text-format that can be used to generate output.
22
25
  class Template
26
+ # Capture the output of a block from within a template.
23
27
  # @returns [String] the output produced by calling the given block.
24
28
  def self.capture(*arguments, output: nil, &block)
25
29
  scope = block.binding
@@ -81,20 +85,30 @@ module XRB
81
85
  def initialize(buffer, binding: BINDING)
82
86
  @buffer = buffer
83
87
  @binding = binding
88
+
89
+ @compiled = nil
84
90
  end
85
91
 
86
92
  def freeze
87
93
  return self if frozen?
88
94
 
89
- to_proc
95
+ compiled
90
96
 
91
97
  super
92
98
  end
93
99
 
100
+ def code
101
+ @code ||= compile!
102
+ end
103
+
104
+ def compiled(scope = @binding.dup)
105
+ @compiled ||= eval("\# frozen_string_literal: true\nproc{|#{OUT}|;#{code}}", scope, @buffer.path, 0).freeze
106
+ end
107
+
94
108
  def to_string(scope = Object.new, output = nil)
95
109
  builder = Builder.new(output, encoding: code.encoding)
96
110
 
97
- scope.instance_exec(builder, &to_proc)
111
+ scope.instance_exec(builder, &compiled)
98
112
 
99
113
  return builder.output
100
114
  end
@@ -104,15 +118,13 @@ module XRB
104
118
  end
105
119
 
106
120
  def to_proc(scope = @binding.dup)
107
- @compiled_proc ||= eval("\# frozen_string_literal: true\nproc{|#{OUT}|;#{code}}", scope, @buffer.path, 0).freeze
121
+ proc do |output|
122
+ to_string(scope, output)
123
+ end
108
124
  end
109
125
 
110
126
  protected
111
127
 
112
- def code
113
- @code ||= compile!
114
- end
115
-
116
128
  def make_assembler
117
129
  Assembler.new
118
130
  end
data/lib/xrb/version.rb CHANGED
@@ -4,5 +4,5 @@
4
4
  # Copyright, 2012-2024, by Samuel Williams.
5
5
 
6
6
  module XRB
7
- VERSION = "0.6.1"
7
+ VERSION = "0.7.0"
8
8
  end
data/readme.md CHANGED
@@ -65,8 +65,8 @@ We welcome contributions to this project.
65
65
 
66
66
  ### Developer Certificate of Origin
67
67
 
68
- This project uses the [Developer Certificate of Origin](https://developercertificate.org/). All contributors to this project must agree to this document to have their contributions accepted.
68
+ In order to protect users of this project, we require all contributors to comply with the [Developer Certificate of Origin](https://developercertificate.org/). This ensures that all contributions are properly licensed and attributed.
69
69
 
70
- ### Contributor Covenant
70
+ ### Community Guidelines
71
71
 
72
- This project is governed by the [Contributor Covenant](https://www.contributor-covenant.org/). All contributors and participants agree to abide by its terms.
72
+ This project is best served by a collaborative and respectful environment. Treat each other professionally, respect differing viewpoints, and engage constructively. Harassment, discrimination, or harmful behavior is not tolerated. Communicate clearly, listen actively, and support one another. If any issues arise, please inform the project maintainers.
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.6.1
4
+ version: 0.7.0
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-05-06 00:00:00.000000000 Z
43
+ date: 2024-10-17 00:00:00.000000000 Z
44
44
  dependencies: []
45
45
  description:
46
46
  email:
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  requirements: []
126
- rubygems_version: 3.5.3
126
+ rubygems_version: 3.5.11
127
127
  signing_key:
128
128
  specification_version: 4
129
129
  summary: A fast native templating system that compiles directly to Ruby code.
metadata.gz.sig CHANGED
Binary file