arboriculture 1.0.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: f17f70c6854d8ef195b15f58d564cbce590a5d4fd43d5270a0bce69c366e7895
4
+ data.tar.gz: b1014241915e3dc0229ba0ae8437c55b1cc7011ead7b7b2c8f481b238697a25c
5
+ SHA512:
6
+ metadata.gz: 85fa5ca6e7ba0a80997fa10818a4c8753fac6444cbeeb6a2fd4016ad56011d378a4db1cc9f735058b5deaa859c90bcc401bf02475d19e1b285c3b59ba8d8050d
7
+ data.tar.gz: 8cdfa0bc38760d9c0d9f3754a01d796f4204441a194b91e88ae1df6bd0ff4d3d1e0969031d7fa003c2e34ab4d038a8d0d22413781dfbdc241d3e323fccf2cdb7
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2025 Nick Vladimiroff
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1 @@
1
+ # Arboriculture
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "minitest/test_task"
3
+
4
+ Minitest::TestTask.create
5
+
6
+ task default: :test
@@ -0,0 +1,23 @@
1
+ class Arboriculture::Builder
2
+
3
+ def initialize
4
+ @added = []
5
+ end
6
+
7
+
8
+ def method_missing(name, *args, **opts, &block)
9
+ children = []
10
+ if block_given?
11
+ old_added = @added
12
+ @added = []
13
+ instance_eval(&block)
14
+ children = @added
15
+ @added = old_added
16
+ end
17
+
18
+ node = Arboriculture::Node.new(name, args, opts, children)
19
+ @added << node
20
+ node
21
+ end
22
+
23
+ end
@@ -0,0 +1,5 @@
1
+ module Arboriculture
2
+
3
+ VERSION = '1.0.0'
4
+
5
+ end
@@ -0,0 +1,26 @@
1
+ require 'zeitwerk'
2
+
3
+ loader = Zeitwerk::Loader.for_gem
4
+ loader.setup
5
+
6
+ module Arboriculture
7
+
8
+ class Error < StandardError; end
9
+
10
+ Node = Data.define(:name, :args, :opts, :children)
11
+
12
+
13
+ def self.build(code = nil, **vars, &block)
14
+ builder = Builder.new
15
+ vars.each do |k,v|
16
+ builder.instance_variable_set("@#{k}".to_sym,v)
17
+ end
18
+
19
+ if block_given?
20
+ builder.instance_eval(&block)
21
+ else
22
+ builder.instance_eval(code)
23
+ end
24
+ end
25
+
26
+ end
metadata ADDED
@@ -0,0 +1,56 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: arboriculture
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Nick Vladimiroff
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 2025-03-01 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: zeitwerk
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '0'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: '0'
26
+ executables: []
27
+ extensions: []
28
+ extra_rdoc_files: []
29
+ files:
30
+ - LICENSE.txt
31
+ - README.md
32
+ - Rakefile
33
+ - lib/arboriculture.rb
34
+ - lib/arboriculture/builder.rb
35
+ - lib/arboriculture/version.rb
36
+ licenses:
37
+ - MIT
38
+ metadata: {}
39
+ rdoc_options: []
40
+ require_paths:
41
+ - lib
42
+ required_ruby_version: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 3.1.0
47
+ required_rubygems_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ requirements: []
53
+ rubygems_version: 3.6.2
54
+ specification_version: 4
55
+ summary: Build trees.
56
+ test_files: []