sevgi 0.95.0 → 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.
@@ -8,22 +8,63 @@ module Sevgi
8
8
  private_constant :BootBlock
9
9
 
10
10
  # Executes Sevgi script source with the full top-level DSL installed.
11
- # @param args [Array] arguments forwarded to {Sevgi::Executor.execute}
12
- # @param kwargs [Hash] keyword arguments forwarded to {Sevgi::Executor.execute}
13
- # @return [Sevgi::Executor::Scope, nil] execution result, or nil for empty source
14
- # @note Required-library load failures are captured as {Sevgi::Executor::Error} on the returned scope.
15
- # @note Reentrant and concurrent calls keep independent executor scope stacks per fiber.
16
- # @see Sevgi::Executor.execute
17
- def self.execute(*args, **kwargs) = Executor.execute(*args, **kwargs, &BootBlock)
11
+ #
12
+ # @example Execute source in an isolated scope
13
+ # result = Sevgi.execute("F.pluralize('cat')")
14
+ # result.value # => "cats"
15
+ # @param string [String] source to evaluate
16
+ # @param file [String, nil] source file name used for errors and backtraces
17
+ # @param line [Integer, nil] starting source line used for errors and backtraces
18
+ # @param require [String, nil] optional Ruby library to require before execution
19
+ # @param main [Boolean] whether to install the DSL through Ruby's top-level main object
20
+ # @return [Sevgi::Executor::Result] immutable execution result
21
+ # @raise [Sevgi::ArgumentError] when source, file, line, required library, or main mode is invalid
22
+ # @note Script and required-library failures are captured in {Sevgi::Executor::Result#error}.
23
+ # @note The default isolated mode does not modify Ruby's top-level main object. `main: true` preserves the command-line
24
+ # default by installing Sevgi through main before evaluating source in the managed script scope.
25
+ # @note Empty source without `require:` is a strict no-op. The DSL boot block is unused.
26
+ # @note Reentrant and concurrent calls keep independent executor scope stacks per fiber. The host retains its signal
27
+ # handlers. An Interrupt is captured only if it reaches this execution, not redirected from the main thread.
28
+ # @see https://sevgi.roktas.dev/usage/#execute Execute source guide
29
+ def self.execute(string, file: nil, line: nil, require: nil, main: false)
30
+ Executor.__send__(:execute, string, file:, line:, require:, receiver: execution_receiver(main), &BootBlock)
31
+ end
18
32
 
19
33
  # Executes a Sevgi script file with the full top-level DSL installed.
20
- # @param args [Array] arguments forwarded to {Sevgi::Executor.execute_file}
21
- # @param kwargs [Hash] keyword arguments forwarded to {Sevgi::Executor.execute_file}
22
- # @return [Sevgi::Executor::Scope, nil] execution result, or nil for an empty file
23
- # @note File-read and required-library load failures are captured as {Sevgi::Executor::Error} on the returned scope.
24
- # @note Reentrant and concurrent calls keep independent executor scope stacks per fiber.
25
- # @see Sevgi::Executor.execute_file
26
- def self.execute_file(*args, **kwargs) = Executor.execute_file(*args, **kwargs, &BootBlock)
34
+ # @param file [String] source file to read and execute
35
+ # @param as [String, nil] source basename used for evaluation, diagnostics, and caller-derived output defaults.
36
+ # its extension is replaced with `.sevgi` and the input file's directory is retained
37
+ # @param require [String, nil] optional Ruby library to require before execution
38
+ # @param main [Boolean] whether to install the DSL through Ruby's top-level main object
39
+ # @return [Sevgi::Executor::Result] immutable execution result
40
+ # @raise [Sevgi::ArgumentError] when file, logical source name, required library, or main mode is invalid
41
+ # @note File-read, script, and required-library failures are captured in {Sevgi::Executor::Result#error}.
42
+ # @note The default isolated mode does not modify Ruby's top-level main object. `main: true` preserves the command-line
43
+ # default by installing Sevgi through main before evaluating source in the managed script scope.
44
+ # @note An empty file without `require:` is a strict no-op. The DSL boot block is unused.
45
+ # @note Reentrant and concurrent calls keep independent executor scope stacks per fiber. The host retains its signal
46
+ # handlers. An Interrupt is captured only if it reaches this execution, not redirected from the main thread.
47
+ # @see https://sevgi.roktas.dev/usage/#execute Execute source guide
48
+ def self.execute_file(file, as: nil, require: nil, main: false)
49
+ as = source_name(file, as) if as
50
+ Executor.__send__(:execute_file, file, as:, require:, receiver: execution_receiver(main), &BootBlock)
51
+ end
52
+
53
+ def self.execution_receiver(main)
54
+ ArgumentError.("Sevgi main mode must be true or false") unless [true, false].include?(main)
55
+
56
+ TOPLEVEL_BINDING.receiver if main
57
+ end
58
+
59
+ def self.source_name(file, name)
60
+ ArgumentError.("Sevgi file must be a String") unless file.is_a?(::String)
61
+ ArgumentError.("Sevgi file name must be a non-empty String") unless name.is_a?(::String) && !name.empty?
62
+ ArgumentError.("Sevgi file name must not include a directory") unless ::File.basename(name) == name
63
+
64
+ ::File.join(::File.dirname(file), F.subext(".sevgi", name))
65
+ end
66
+
67
+ private_class_method :execution_receiver, :source_name
27
68
 
28
69
  module Toplevel
29
70
  # Loads one or more Sevgi files relative to the caller's source file.
@@ -32,13 +73,16 @@ module Sevgi
32
73
  # @raise [Sevgi::PanicError] when called without an active executor scope
33
74
  # @raise [Sevgi::Error] when a file cannot be located
34
75
  # @note `Load` resolves against the active executor scope in the current fiber.
76
+ # @note Ordinary library code uses Ruby `require`. `Load` is available only during Sevgi script execution.
77
+ # @see Sevgi.Load
78
+ # @see Sevgi.execute_file
35
79
  def Load(*files)
36
80
  start = ::File.dirname(caller_locations(1..1).first.path)
37
81
 
38
82
  files.each do |file|
39
83
  location = F.locate(file, start)
40
84
 
41
- ::Sevgi::Executor.load(location.file)
85
+ ::Sevgi::Executor.__send__(:load, location.file)
42
86
  end
43
87
  end
44
88
  end
@@ -4,14 +4,98 @@ require "sevgi/graphics"
4
4
 
5
5
  module Sevgi
6
6
  module Toplevel
7
+ # @overload Canvas(paper, **overrides)
8
+ # Builds a canvas from a paper profile with optional field overrides.
9
+ # @param paper [Sevgi::Graphics::Paper, Symbol, String] paper object or registered profile
10
+ # @param overrides [Hash] canvas field overrides
11
+ # @return [Sevgi::Graphics::Canvas]
12
+ # @raise [Sevgi::ArgumentError] when the paper or an override is invalid
13
+ # @overload Canvas(width:, height:, unit: "mm", name: :custom, margins: [])
14
+ # Builds a canvas from an explicit size.
15
+ # @param width [Numeric] canvas width
16
+ # @param height [Numeric] canvas height
17
+ # @param unit [Symbol, String] SVG unit
18
+ # @param name [Symbol, String] paper name
19
+ # @param margins [Array<Numeric>] margin shorthand values
20
+ # @return [Sevgi::Graphics::Canvas]
21
+ # @raise [Sevgi::ArgumentError] when a required field is omitted or a value is invalid
22
+ # @example Build a paper-backed canvas
23
+ # canvas = Sevgi.Canvas :a4, margins: [12, 10]
24
+ # @see Sevgi.Canvas
25
+ # @see Sevgi::Graphics.canvas
26
+ def Canvas(...) = Graphics.canvas(...)
27
+
28
+ # @overload Document(name)
29
+ # Looks up an existing document profile by name.
30
+ # @param name [Symbol, String] profile name
31
+ # @return [Class] document class
32
+ # @raise [Sevgi::ArgumentError] when the profile is unknown
33
+ # @overload Document(name, preambles: Undefined, attributes: Undefined)
34
+ # Defines or validates a named document profile.
35
+ # @param name [Symbol, String] profile name
36
+ # @param preambles [Array<String>, nil, Sevgi::Undefined] document preamble lines
37
+ # @param attributes [Hash, nil, Sevgi::Undefined] default root attributes
38
+ # @return [Class] document class
39
+ # @raise [Sevgi::ArgumentError] when a profile conflicts or metadata is invalid
40
+ # @overload Document(preambles: Undefined, attributes: Undefined)
41
+ # Defines an anonymous document profile without registering it globally.
42
+ # @param preambles [Array<String>, nil, Sevgi::Undefined] document preamble lines
43
+ # @param attributes [Hash, nil, Sevgi::Undefined] default root attributes
44
+ # @return [Class] anonymous document class
45
+ # @raise [Sevgi::ArgumentError] when metadata is invalid
46
+ # @return [Class] document class
47
+ # @example Define and use a document profile
48
+ # Sevgi.Document :icon, attributes: {viewBox: "0 0 24 24"}
49
+ # drawing = Sevgi.SVG(:icon) { circle cx: 12, cy: 12, r: 10 }
50
+ # @see Sevgi.Document
51
+ # @see Sevgi::Graphics.document
52
+ def Document(...) = Graphics.document(...)
53
+
54
+ # Defines or replaces a document profile.
55
+ # @param name [Symbol, String] profile name
56
+ # @param preambles [Array<String>, nil] document preamble lines
57
+ # @param attributes [Hash, nil] default root attributes
58
+ # @return [Class] document class
59
+ # @raise [Sevgi::ArgumentError] when the name or metadata is invalid
60
+ # @see Sevgi.Document!
61
+ # @see Sevgi::Graphics.document!
62
+ def Document!(name, preambles: [], attributes: {})
63
+ Graphics.document!(name, preambles:, attributes:)
64
+ end
65
+
66
+ # Builds an SVG document through the full Sevgi top-level DSL.
67
+ # @param document [Symbol, String, Class, Sevgi::Graphics::Canvas, Sevgi::Graphics::Paper] document profile,
68
+ # document class, or canvas input that uses the default profile
69
+ # @param canvas [Sevgi::Graphics::Canvas, Sevgi::Graphics::Paper, Symbol, String, Sevgi::Undefined, nil] optional
70
+ # canvas or paper profile
71
+ # @param attributes [Hash] root SVG attributes
72
+ # @yield the document block evaluated in the SVG document context
73
+ # @yieldreturn [void]
74
+ # @return [Sevgi::Graphics::Document::Proto] SVG document object
75
+ # @raise [Sevgi::ArgumentError] when the document, paper, or canvas arguments are invalid
76
+ # @see Sevgi.SVG
77
+ # @see Sevgi::Graphics.SVG
78
+ def SVG(document = :default, canvas = Undefined, **attributes, &block)
79
+ Graphics.SVG(document, canvas, **attributes, &block)
80
+ end
81
+
82
+ # @overload Mixin(mod, document = Sevgi::Graphics::Document::Base)
83
+ # Adds a named graphics mixture to a document class.
84
+ # @param mod [Symbol, String] named mixture to mix into the document
85
+ # @param document [Class] document class receiving the mixture
86
+ # @return [nil]
87
+ # @raise [NameError] when a named mixture cannot be resolved
88
+ # @see Sevgi.Mixin
89
+ # @see Sevgi::Graphics::Mixtures.mixin
7
90
  # @overload Mixin(mod, document = Sevgi::Graphics::Document::Base, &block)
8
- # Adds graphics mixture methods to a document class.
91
+ # Adds a named graphics mixture and an anonymous extension to a document class.
9
92
  # @param mod [Symbol, String] named mixture to mix into the document
10
93
  # @param document [Class] document class receiving the mixture
11
94
  # @yield optional anonymous mixture module body
12
95
  # @yieldreturn [void]
13
- # @return [void]
96
+ # @return [Module] anonymous mixture
14
97
  # @raise [NameError] when a named mixture cannot be resolved
98
+ # @see Sevgi.Mixin
15
99
  # @see Sevgi::Graphics::Mixtures.mixin
16
100
  # @overload Mixin(document = Sevgi::Graphics::Document::Base, &block)
17
101
  # Adds an anonymous graphics mixture to a document class.
@@ -20,6 +104,7 @@ module Sevgi
20
104
  # @yieldreturn [void]
21
105
  # @return [Module] anonymous mixture
22
106
  # @raise [Sevgi::ArgumentError] when no named mixture or block is given
107
+ # @see Sevgi.Mixin
23
108
  # @see Sevgi::Graphics::Mixtures.mixin
24
109
  def Mixin(...) = Graphics::Mixtures.mixin(...)
25
110
 
@@ -27,10 +112,11 @@ module Sevgi
27
112
  # Defines or validates a named paper profile for DSL use.
28
113
  # @param width [Numeric] paper width
29
114
  # @param height [Numeric] paper height
30
- # @param name [Symbol] paper profile name
115
+ # @param name [Symbol, String] paper profile name
31
116
  # @param unit [String, Symbol] size unit
32
- # @return [Symbol] the paper profile name
117
+ # @return [Symbol, String] the original paper profile name
33
118
  # @raise [Sevgi::ArgumentError] when the profile is invalid or an existing profile differs
119
+ # @see Sevgi.Paper
34
120
  # @see Sevgi::Graphics#paper
35
121
  def Paper(...) = Graphics.paper(...)
36
122
 
@@ -38,10 +124,11 @@ module Sevgi
38
124
  # Defines or overwrites a named paper profile for DSL use.
39
125
  # @param width [Numeric] paper width
40
126
  # @param height [Numeric] paper height
41
- # @param name [Symbol] paper profile name
127
+ # @param name [Symbol, String] paper profile name
42
128
  # @param unit [String, Symbol] size unit
43
- # @return [Symbol] the paper profile name
129
+ # @return [Symbol, String] the original paper profile name
44
130
  # @raise [Sevgi::ArgumentError] when the profile is invalid or the paper name is reserved
131
+ # @see Sevgi.Paper!
45
132
  # @see Sevgi::Graphics#paper!
46
133
  def Paper!(...) = Graphics.paper!(...)
47
134
  end
@@ -4,7 +4,23 @@ require "sevgi/sundries"
4
4
 
5
5
  module Sevgi
6
6
  module Toplevel
7
- # Builds a drawable grid from a graphics canvas.
7
+ # Fits major and minor intervals into a span without drawing SVG elements.
8
+ # @overload Ruler(brut:, unit:, multiple:, margins: [0.0])
9
+ # @param brut [Numeric] full available span
10
+ # @param unit [Numeric] minor interval length
11
+ # @param multiple [Integer] minor intervals per major interval
12
+ # @param margins [Array<Numeric>] one symmetric or two start/end minimum margins
13
+ # @return [Sevgi::Sundries::Ruler] fitted ruler
14
+ # @raise [Sevgi::ArgumentError] when the span, intervals, or margins are invalid
15
+ # @see Sevgi::Sundries::Ruler#initialize
16
+ def Ruler(...) = Sundries::Ruler.new(...)
17
+
18
+ # Builds a drawable grid fitted inside a graphics canvas.
19
+ #
20
+ # The canvas margins are minimum clearances. Any span left after fitting
21
+ # whole major intervals is shared equally between the opposite margins, so
22
+ # their requested difference is preserved. The returned grid starts at
23
+ # `(0, 0)`. {Sevgi::Sundries::Grid#canvas} exposes the fitted page margins.
8
24
  # @param canvas [Sevgi::Graphics::Canvas] canvas defining page size and margins
9
25
  # @param unit [Numeric] minor grid unit
10
26
  # @param multiple [Integer] number of minor units in each major interval
@@ -13,13 +29,16 @@ module Sevgi
13
29
  # @raise [Sevgi::ArgumentError] when unit is not a finite positive number
14
30
  # @raise [Sevgi::ArgumentError] when multiple is not a positive integer
15
31
  # @raise [Sevgi::ArgumentError] when canvas dimensions, margins, and grid intervals cannot fit
32
+ # @see Sevgi.Grid
33
+ # @see Sevgi::Sundries::Grid
16
34
  def Grid(canvas, unit:, multiple:)
17
35
  ArgumentError.("Must be a Canvas: #{canvas}") unless canvas.is_a?(Graphics::Canvas)
18
36
 
19
- Sundries::Grid[
20
- Sundries::Ruler.new(brut: canvas.width, unit:, multiple:, margin: canvas.left),
21
- Sundries::Ruler.new(brut: canvas.height, unit:, multiple:, margin: canvas.top)
22
- ]
37
+ Sundries::Grid.new(
38
+ x: Sundries::Ruler.new(brut: canvas.width, unit:, multiple:, margins: [canvas.left, canvas.right]),
39
+ y: Sundries::Ruler.new(brut: canvas.height, unit:, multiple:, margins: [canvas.top, canvas.bottom]),
40
+ canvas:
41
+ )
23
42
  end
24
43
 
25
44
  promote Sundries::Export
@@ -3,25 +3,22 @@
3
3
  module Sevgi
4
4
  # Shared implementation for the full Sevgi top-level DSL.
5
5
  #
6
- # This module is installed by `include Sevgi` or `extend Sevgi`; it should not
6
+ # This module is installed by `include Sevgi` or `extend Sevgi`. Consumers do not
7
7
  # normally be included directly.
8
8
  #
9
9
  # @see Sevgi
10
+ # @see https://sevgi.roktas.dev/usage/ Usage guide
10
11
  module Toplevel
11
- @constants = {}
12
+ @promotions = {}
12
13
 
13
14
  class << self
14
- # Returns an immutable snapshot of promoted constants.
15
- # @return [Hash<Symbol, Object>]
16
- def constants = @constants.dup.freeze
17
-
18
15
  private
19
16
 
20
17
  def inject(base)
21
18
  return if base.instance_variable_defined?("@_toplevel_injected_")
22
19
 
23
20
  if base.is_a?(::Module)
24
- @constants.each do |name, constant|
21
+ @promotions.each do |name, constant|
25
22
  base.const_set(name, constant) unless base.const_defined?(name, false)
26
23
  end
27
24
  end
@@ -30,7 +27,7 @@ module Sevgi
30
27
  end
31
28
 
32
29
  def promote(constant, symbol = Undefined)
33
- @constants[Undefined.default(symbol, constant.to_s.split("::").last.to_sym)] = constant
30
+ @promotions[Undefined.default(symbol, constant.to_s.split("::").last.to_sym)] = constant
34
31
  end
35
32
  end
36
33
 
@@ -53,6 +50,8 @@ module Sevgi
53
50
  super
54
51
  inject(base)
55
52
  end
53
+
54
+ private_class_method :extended, :included
56
55
  end
57
56
 
58
57
  extend Toplevel
data/lib/sevgi/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Sevgi
4
4
  # Current version of the Sevgi top-level gem.
5
- VERSION = "0.95.0"
5
+ VERSION = "1.0.0"
6
6
  end
data/lib/sevgi.rb CHANGED
@@ -9,36 +9,125 @@ require "sevgi/sundries"
9
9
 
10
10
  require "sevgi/version"
11
11
 
12
- # Minimal top-level SVG interface installed by `require "sevgi"`.
13
- # @return [Module] the graphics module used as the SVG DSL namespace
14
- SVG = Sevgi::Graphics
12
+ require_relative "sevgi/toplevel"
13
+ require_relative "sevgi/svg"
14
+
15
+ # SVG-domain facade installed by `require "sevgi"`.
16
+ # @return [Module] the public SVG operations and types
17
+ SVG = Sevgi::SVG
15
18
 
16
19
  # @overload SVG(document = :default, canvas = Undefined, **attributes, &block)
17
20
  # Builds an SVG document through the default top-level DSL entrypoint.
18
- # @param document [Symbol, Class] document profile name or document class
19
- # @param canvas [Object] optional canvas or paper profile argument
21
+ # @param document [Symbol, String, Class, Sevgi::Graphics::Canvas, Sevgi::Graphics::Paper] document profile,
22
+ # document class, or canvas input that uses the default profile
23
+ # @param canvas [Sevgi::Graphics::Canvas, Sevgi::Graphics::Paper, Symbol, String, Sevgi::Undefined, nil] optional
24
+ # canvas or paper profile
20
25
  # @param attributes [Hash] root SVG attributes
21
26
  # @yield the document block evaluated in the SVG document context
22
27
  # @yieldreturn [void]
23
- # @return [Sevgi::Graphics::Document::Proto] a rendered SVG document object
28
+ # @return [Sevgi::Graphics::Document::Proto] an SVG document object, ready for separate rendering
24
29
  # @raise [Sevgi::ArgumentError] when the document, paper, or canvas arguments are invalid
25
- def SVG(...) = Sevgi::Graphics.SVG(...)
30
+ # @example Build through the global library entrypoint
31
+ # SVG(:minimal) { circle r: 4 }.Render
32
+ # @see Sevgi.SVG
33
+ # @see Sevgi::Toplevel#SVG
34
+ def SVG(...) = Sevgi.SVG(...)
26
35
 
27
36
  # Full top-level API for Sevgi library and script consumers.
28
37
  #
29
- # Including this module in a class or module installs DSL methods such as
30
- # `Paper`, `Load`, and `Grid`, plus convenience constants such as `F`,
31
- # `Geometry`, `Origin`, and `Export`. Extending a module does the same.
32
- # Extending an ordinary object installs the methods only and does not write
33
- # promoted constants to `Object`.
38
+ # `require "sevgi"` installs the global document builder `SVG(...)` and the independent {Sevgi::SVG} facade. SVG-domain
39
+ # operations use capitalized method names on that facade, such as `SVG.Canvas`, `SVG.Paper`, and `SVG.Derender`. Types
40
+ # and namespaces use Ruby's double-colon notation, such as `SVG::Canvas`. Promoted toolkit operations are also
41
+ # available on `Sevgi` for consumers that prefer the full namespace. {SVG.Module} is a facade-only convenience
42
+ # constructor. Process-level operations such as {Sevgi.execute} remain on `Sevgi`, not the SVG facade.
43
+ #
44
+ # Including this module in a class or module installs the DSL methods plus convenience constants `F`, `Geometry`,
45
+ # `Origin`, and `Export`. Script execution provides the same promoted scope. Extending a module does the same. Extending
46
+ # an ordinary object installs methods only and does not write promoted constants to `Object`. Focused component requires
47
+ # expose their namespaced component APIs instead of this full top-level surface.
48
+ #
49
+ # `Load` is meaningful only during {Sevgi.execute}, {Sevgi.execute_file}, or command-line script execution. It resolves
50
+ # nested `.sevgi` files through the active executor scope. It is not a general-purpose replacement for Ruby `require`.
34
51
  #
35
52
  # @example Include the DSL in an object
36
53
  # class Drawing
37
54
  # include Sevgi
38
55
  # end
56
+ # @see https://sevgi.roktas.dev/usage/ Usage guide
57
+ # @see https://sevgi.roktas.dev/compose/ Composition guide
39
58
  module Sevgi
40
- # See sevgi/toplevel/*.rb files for details
41
- require_relative "sevgi/toplevel"
59
+ # @!method self.Canvas(...)
60
+ # Builds a canvas from a paper profile or explicit dimensions.
61
+ # @return [Sevgi::Graphics::Canvas] canvas value
62
+ # @see Sevgi::Toplevel#Canvas
63
+ # @!method self.Document(...)
64
+ # Defines, validates, or looks up a document profile.
65
+ # @return [Class] document class
66
+ # @see Sevgi::Toplevel#Document
67
+ # @!method self.Document!(...)
68
+ # Defines or replaces a document profile.
69
+ # @return [Class] document class
70
+ # @see Sevgi::Toplevel#Document!
71
+ # @!method self.SVG(...)
72
+ # Builds an SVG document through the explicit namespaced top-level API.
73
+ # @return [Sevgi::Graphics::Document::Proto] SVG document object
74
+ # @see Sevgi::Toplevel#SVG
75
+ # @!method self.Mixin(...)
76
+ # Extends a document profile with a named or anonymous graphics mixture.
77
+ # @return [Module, nil] anonymous mixture when supplied, otherwise nil
78
+ # @see Sevgi::Toplevel#Mixin
79
+ # @!method self.Paper(...)
80
+ # Defines or validates a named paper profile.
81
+ # @return [Symbol, String] original paper profile name
82
+ # @see Sevgi::Toplevel#Paper
83
+ # @!method self.Paper!(...)
84
+ # Defines or overwrites a named paper profile.
85
+ # @return [Symbol, String] original paper profile name
86
+ # @see Sevgi::Toplevel#Paper!
87
+ # @!method self.Grid(...)
88
+ # Fits a drawable grid to a graphics canvas.
89
+ # @return [Sevgi::Sundries::Grid] fitted grid
90
+ # @see Sevgi::Toplevel#Grid
91
+ # @!method self.Ruler(...)
92
+ # Fits major and minor intervals into a span.
93
+ # @return [Sevgi::Sundries::Ruler] fitted ruler
94
+ # @see Sevgi::Toplevel#Ruler
95
+ # @!method self.Decompile(...)
96
+ # Converts inline SVG/XML into an immutable Derender node.
97
+ # @return [Sevgi::Derender::Node] selected node
98
+ # @see Sevgi::Toplevel#Decompile
99
+ # @!method self.DecompileFile(...)
100
+ # Converts an SVG/XML file into an immutable Derender node.
101
+ # @return [Sevgi::Derender::Node] selected node
102
+ # @see Sevgi::Toplevel#DecompileFile
103
+ # @!method self.Derender(...)
104
+ # Converts inline SVG/XML into formatted Sevgi DSL source.
105
+ # @return [String] formatted Sevgi DSL source
106
+ # @see Sevgi::Toplevel#Derender
107
+ # @!method self.DerenderFile(...)
108
+ # Converts an SVG/XML file into formatted Sevgi DSL source.
109
+ # @return [String] formatted Sevgi DSL source
110
+ # @see Sevgi::Toplevel#DerenderFile
111
+ # @!method self.Evaluate(...)
112
+ # Includes an inline SVG/XML node under a graphics element.
113
+ # @return [Sevgi::Graphics::Element, nil] included element, or nil when no output is produced
114
+ # @see Sevgi::Toplevel#Evaluate
115
+ # @!method self.EvaluateFile(...)
116
+ # Includes an SVG/XML file node under a graphics element.
117
+ # @return [Sevgi::Graphics::Element, nil] included element, or nil when no output is produced
118
+ # @see Sevgi::Toplevel#EvaluateFile
119
+ # @!method self.EvaluateChildren(...)
120
+ # Includes only an inline SVG/XML node's children under a graphics element.
121
+ # @return [Array<Sevgi::Graphics::Element>] immutable included-child snapshot
122
+ # @see Sevgi::Toplevel#EvaluateChildren
123
+ # @!method self.EvaluateChildrenFile(...)
124
+ # Includes only an SVG/XML file node's children under a graphics element.
125
+ # @return [Array<Sevgi::Graphics::Element>] immutable included-child snapshot
126
+ # @see Sevgi::Toplevel#EvaluateChildrenFile
127
+ # @!method self.Load(...)
128
+ # Loads nested `.sevgi` files through the active executor scope.
129
+ # @return [Array<String>] requested file names
130
+ # @see Sevgi::Toplevel#Load
42
131
 
43
132
  # Installs the full toplevel DSL into an including class or module.
44
133
  # @param base [Module] the class or module receiving the DSL methods
@@ -58,4 +147,6 @@ module Sevgi
58
147
  super
59
148
  base.extend(Toplevel)
60
149
  end
150
+
151
+ private_class_method :extended, :included
61
152
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sevgi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.95.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Recai Oktaş
@@ -9,94 +9,108 @@ bindir: bin
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: sevgi-appendix
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - '='
17
+ - !ruby/object:Gem::Version
18
+ version: 1.0.0
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - '='
24
+ - !ruby/object:Gem::Version
25
+ version: 1.0.0
12
26
  - !ruby/object:Gem::Dependency
13
27
  name: sevgi-derender
14
28
  requirement: !ruby/object:Gem::Requirement
15
29
  requirements:
16
30
  - - '='
17
31
  - !ruby/object:Gem::Version
18
- version: 0.95.0
32
+ version: 1.0.0
19
33
  type: :runtime
20
34
  prerelease: false
21
35
  version_requirements: !ruby/object:Gem::Requirement
22
36
  requirements:
23
37
  - - '='
24
38
  - !ruby/object:Gem::Version
25
- version: 0.95.0
39
+ version: 1.0.0
26
40
  - !ruby/object:Gem::Dependency
27
41
  name: sevgi-function
28
42
  requirement: !ruby/object:Gem::Requirement
29
43
  requirements:
30
44
  - - '='
31
45
  - !ruby/object:Gem::Version
32
- version: 0.95.0
46
+ version: 1.0.0
33
47
  type: :runtime
34
48
  prerelease: false
35
49
  version_requirements: !ruby/object:Gem::Requirement
36
50
  requirements:
37
51
  - - '='
38
52
  - !ruby/object:Gem::Version
39
- version: 0.95.0
53
+ version: 1.0.0
40
54
  - !ruby/object:Gem::Dependency
41
55
  name: sevgi-geometry
42
56
  requirement: !ruby/object:Gem::Requirement
43
57
  requirements:
44
58
  - - '='
45
59
  - !ruby/object:Gem::Version
46
- version: 0.95.0
60
+ version: 1.0.0
47
61
  type: :runtime
48
62
  prerelease: false
49
63
  version_requirements: !ruby/object:Gem::Requirement
50
64
  requirements:
51
65
  - - '='
52
66
  - !ruby/object:Gem::Version
53
- version: 0.95.0
67
+ version: 1.0.0
54
68
  - !ruby/object:Gem::Dependency
55
69
  name: sevgi-graphics
56
70
  requirement: !ruby/object:Gem::Requirement
57
71
  requirements:
58
72
  - - '='
59
73
  - !ruby/object:Gem::Version
60
- version: 0.95.0
74
+ version: 1.0.0
61
75
  type: :runtime
62
76
  prerelease: false
63
77
  version_requirements: !ruby/object:Gem::Requirement
64
78
  requirements:
65
79
  - - '='
66
80
  - !ruby/object:Gem::Version
67
- version: 0.95.0
81
+ version: 1.0.0
68
82
  - !ruby/object:Gem::Dependency
69
83
  name: sevgi-standard
70
84
  requirement: !ruby/object:Gem::Requirement
71
85
  requirements:
72
86
  - - '='
73
87
  - !ruby/object:Gem::Version
74
- version: 0.95.0
88
+ version: 1.0.0
75
89
  type: :runtime
76
90
  prerelease: false
77
91
  version_requirements: !ruby/object:Gem::Requirement
78
92
  requirements:
79
93
  - - '='
80
94
  - !ruby/object:Gem::Version
81
- version: 0.95.0
95
+ version: 1.0.0
82
96
  - !ruby/object:Gem::Dependency
83
97
  name: sevgi-sundries
84
98
  requirement: !ruby/object:Gem::Requirement
85
99
  requirements:
86
100
  - - '='
87
101
  - !ruby/object:Gem::Version
88
- version: 0.95.0
102
+ version: 1.0.0
89
103
  type: :runtime
90
104
  prerelease: false
91
105
  version_requirements: !ruby/object:Gem::Requirement
92
106
  requirements:
93
107
  - - '='
94
108
  - !ruby/object:Gem::Version
95
- version: 0.95.0
96
- description: Provides a scriptable DSL with utilities for creating SVG content with
97
- Ruby.
109
+ version: 1.0.0
110
+ description: Loads the complete Sevgi API and runs .sevgi scripts.
98
111
  email: roktas@gmail.com
99
112
  executables:
113
+ - igsev
100
114
  - sevgi
101
115
  extensions: []
102
116
  extra_rdoc_files: []
@@ -104,14 +118,19 @@ files:
104
118
  - CHANGELOG.md
105
119
  - LICENSE
106
120
  - README.md
121
+ - bin/igsev
107
122
  - bin/sevgi
108
123
  - lib/sevgi.rb
124
+ - lib/sevgi/binaries/igsev.rb
109
125
  - lib/sevgi/binaries/rake.rb
110
126
  - lib/sevgi/binaries/sevgi.rb
111
127
  - lib/sevgi/executor.rb
112
128
  - lib/sevgi/executor/error.rb
129
+ - lib/sevgi/executor/result.rb
113
130
  - lib/sevgi/executor/scope.rb
114
131
  - lib/sevgi/executor/source.rb
132
+ - lib/sevgi/skill.rb
133
+ - lib/sevgi/svg.rb
115
134
  - lib/sevgi/toplevel.rb
116
135
  - lib/sevgi/toplevel/derender.rb
117
136
  - lib/sevgi/toplevel/executor.rb
@@ -142,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
161
  - !ruby/object:Gem::Version
143
162
  version: '0'
144
163
  requirements: []
145
- rubygems_version: 4.0.11
164
+ rubygems_version: 4.0.20
146
165
  specification_version: 4
147
- summary: Toolkit for creating SVG content programmatically with Ruby.
166
+ summary: Ruby toolkit for creating SVG.
148
167
  test_files: []