Module: Sevgi
- Extended by:
- Toplevel
- Defined in:
- lib/sevgi.rb,
lib/sevgi/svg.rb,
lib/sevgi/skill.rb,
lib/sevgi/version.rb,
lib/sevgi/executor.rb,
lib/sevgi/toplevel.rb,
lib/sevgi/binaries/igsev.rb,
lib/sevgi/binaries/sevgi.rb,
lib/sevgi/executor/error.rb,
lib/sevgi/executor/scope.rb,
lib/sevgi/executor/result.rb,
lib/sevgi/executor/source.rb,
lib/sevgi/toplevel/derender.rb,
lib/sevgi/toplevel/executor.rb,
lib/sevgi/toplevel/function.rb,
lib/sevgi/toplevel/geometry.rb,
lib/sevgi/toplevel/graphics.rb,
lib/sevgi/toplevel/sundries.rb
Overview
Full top-level API for Sevgi library and script consumers.
require "sevgi" installs the global document builder SVG(...) and the independent SVG facade. SVG-domain
operations use capitalized method names on that facade, such as SVG.Canvas, SVG.Paper, and SVG.Derender; types
and namespaces use Ruby's double-colon notation, such as SVG::Canvas. The same operations are available on Sevgi
for consumers that prefer the full toolkit namespace. Process-level operations such as Sevgi.execute remain on
Sevgi rather than the SVG facade.
Including this module in a class or module installs the DSL methods plus convenience constants F, Geometry,
Origin, and Export; script execution provides the same promoted scope. Extending a module does the same. Extending
an ordinary object installs methods only and does not write promoted constants to Object. Focused component requires
expose their namespaced component APIs instead of this full top-level surface.
Load is meaningful only during Sevgi.execute, Sevgi.execute_file, or command-line script execution. It resolves
nested .sevgi files through the active executor scope; it is not a general-purpose replacement for Ruby require.
Defined Under Namespace
Modules: SVG, Toplevel Classes: Executor
Constant Summary collapse
- VERSION =
Current version of the Sevgi top-level gem.
"0.98.2"
Class Method Summary collapse
-
.Canvas(...) ⇒ Sevgi::Graphics::Canvas
Builds a canvas from a paper profile or explicit dimensions.
-
.Decompile(...) ⇒ Sevgi::Derender::Node
Converts inline SVG/XML into an immutable Derender node.
-
.DecompileFile(...) ⇒ Sevgi::Derender::Node
Converts an SVG/XML file into an immutable Derender node.
-
.Derender(...) ⇒ String
Converts inline SVG/XML into formatted Sevgi DSL source.
-
.DerenderFile(...) ⇒ String
Converts an SVG/XML file into formatted Sevgi DSL source.
-
.Document(...) ⇒ Class
Defines, validates, or looks up a document profile.
-
.Document!(...) ⇒ Class
Defines or replaces a document profile.
-
.Evaluate(...) ⇒ Sevgi::Graphics::Element?
Includes an inline SVG/XML node under a graphics element.
-
.EvaluateChildren(...) ⇒ Array<Sevgi::Graphics::Element>
Includes only an inline SVG/XML node's children under a graphics element.
-
.EvaluateChildrenFile(...) ⇒ Array<Sevgi::Graphics::Element>
Includes only an SVG/XML file node's children under a graphics element.
-
.EvaluateFile(...) ⇒ Sevgi::Graphics::Element?
Includes an SVG/XML file node under a graphics element.
-
.execute(string, file: nil, line: nil, require: nil, main: false) ⇒ Sevgi::Executor::Result
Executes Sevgi script source with the full top-level DSL installed.
-
.execute_file(file, as: nil, require: nil, main: false) ⇒ Sevgi::Executor::Result
Executes a Sevgi script file with the full top-level DSL installed.
-
.Grid(...) ⇒ Sevgi::Sundries::Grid
Fits a drawable grid to a graphics canvas.
-
.Load(...) ⇒ Array<String>
Loads nested
.sevgifiles through the active executor scope. -
.Mixin(...) ⇒ Module?
Extends a document profile with a named or anonymous graphics mixture.
-
.Paper(...) ⇒ Symbol, String
Defines or validates a named paper profile.
-
.Paper!(...) ⇒ Symbol, String
Defines or overwrites a named paper profile.
-
.SVG(...) ⇒ Sevgi::Graphics::Document::Proto
Builds an SVG document through the explicit namespaced top-level API.
Methods included from Toplevel
Canvas, Decompile, DecompileFile, Derender, DerenderFile, Document, Document!, Evaluate, EvaluateChildren, EvaluateChildrenFile, EvaluateFile, Grid, Load, Mixin, Paper, Paper!, SVG
Class Method Details
.Canvas(...) ⇒ Sevgi::Graphics::Canvas
Builds a canvas from a paper profile or explicit dimensions.
|
|
# File 'lib/sevgi.rb', line 59
|
.Decompile(...) ⇒ Sevgi::Derender::Node
Converts inline SVG/XML into an immutable Derender node.
|
|
# File 'lib/sevgi.rb', line 59
|
.DecompileFile(...) ⇒ Sevgi::Derender::Node
Converts an SVG/XML file into an immutable Derender node.
|
|
# File 'lib/sevgi.rb', line 59
|
.Derender(...) ⇒ String
Converts inline SVG/XML into formatted Sevgi DSL source.
|
|
# File 'lib/sevgi.rb', line 59
|
.DerenderFile(...) ⇒ String
Converts an SVG/XML file into formatted Sevgi DSL source.
|
|
# File 'lib/sevgi.rb', line 59
|
.Document(...) ⇒ Class
Defines, validates, or looks up a document profile.
|
|
# File 'lib/sevgi.rb', line 59
|
.Document!(...) ⇒ Class
Defines or replaces a document profile.
|
|
# File 'lib/sevgi.rb', line 59
|
.Evaluate(...) ⇒ Sevgi::Graphics::Element?
Includes an inline SVG/XML node under a graphics element.
|
|
# File 'lib/sevgi.rb', line 59
|
.EvaluateChildren(...) ⇒ Array<Sevgi::Graphics::Element>
Includes only an inline SVG/XML node's children under a graphics element.
|
|
# File 'lib/sevgi.rb', line 59
|
.EvaluateChildrenFile(...) ⇒ Array<Sevgi::Graphics::Element>
Includes only an SVG/XML file node's children under a graphics element.
|
|
# File 'lib/sevgi.rb', line 59
|
.EvaluateFile(...) ⇒ Sevgi::Graphics::Element?
Includes an SVG/XML file node under a graphics element.
|
|
# File 'lib/sevgi.rb', line 59
|
.execute(string, file: nil, line: nil, require: nil, main: false) ⇒ Sevgi::Executor::Result
Script and required-library failures are captured in Sevgi::Executor::Result#error.
The default isolated mode does not modify Ruby's top-level main object. main: true preserves the command-line
default by installing Sevgi through main before evaluating source in the managed script scope.
Empty source without require: is a strict no-op; the DSL boot block is unused.
Reentrant and concurrent calls keep independent executor scope stacks per fiber.
Executes Sevgi script source with the full top-level DSL installed.
28 29 30 |
# File 'lib/sevgi/toplevel/executor.rb', line 28 def self.execute(string, file: nil, line: nil, require: nil, main: false) Executor.__send__(:execute, string, file:, line:, require:, receiver: execution_receiver(main), &BootBlock) end |
.execute_file(file, as: nil, require: nil, main: false) ⇒ Sevgi::Executor::Result
File-read, script, and required-library failures are captured in Sevgi::Executor::Result#error.
The default isolated mode does not modify Ruby's top-level main object. main: true preserves the command-line
default by installing Sevgi through main before evaluating source in the managed script scope.
An empty file without require: is a strict no-op; the DSL boot block is unused.
Reentrant and concurrent calls keep independent executor scope stacks per fiber.
Executes a Sevgi script file with the full top-level DSL installed.
46 47 48 49 |
# File 'lib/sevgi/toplevel/executor.rb', line 46 def self.execute_file(file, as: nil, require: nil, main: false) as = source_name(file, as) if as Executor.__send__(:execute_file, file, as:, require:, receiver: execution_receiver(main), &BootBlock) end |
.Grid(...) ⇒ Sevgi::Sundries::Grid
Fits a drawable grid to a graphics canvas.
|
|
# File 'lib/sevgi.rb', line 59
|
.Load(...) ⇒ Array<String>
Loads nested .sevgi files through the active executor scope.
|
|
# File 'lib/sevgi.rb', line 59
|
.Mixin(...) ⇒ Module?
Extends a document profile with a named or anonymous graphics mixture.
|
|
# File 'lib/sevgi.rb', line 59
|
.Paper(...) ⇒ Symbol, String
Defines or validates a named paper profile.
|
|
# File 'lib/sevgi.rb', line 59
|
.Paper!(...) ⇒ Symbol, String
Defines or overwrites a named paper profile.
|
|
# File 'lib/sevgi.rb', line 59
|
.SVG(...) ⇒ Sevgi::Graphics::Document::Proto
Builds an SVG document through the explicit namespaced top-level API.
|
|
# File 'lib/sevgi.rb', line 59
|