shojiku 0.1.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.
data/lib/shojiku.rb ADDED
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "json"
4
+
5
+ require_relative "shojiku/version"
6
+ require_relative "shojiku/errors"
7
+ require_relative "shojiku/env"
8
+ require_relative "shojiku/log"
9
+ require_relative "shojiku/library"
10
+ require_relative "shojiku/engine"
11
+ require_relative "shojiku/diagnostic"
12
+ require_relative "shojiku/failure"
13
+ require_relative "shojiku/result"
14
+ require_relative "shojiku/verification_report"
15
+ require_relative "shojiku/artifact"
16
+ require_relative "shojiku/local_pem"
17
+ require_relative "shojiku/lockdown"
18
+ require_relative "shojiku/sources"
19
+ require_relative "shojiku/template_root"
20
+ require_relative "shojiku/request"
21
+ require_relative "shojiku/outcome"
22
+ require_relative "shojiku/config"
23
+ require_relative "shojiku/settings"
24
+ require_relative "shojiku/client"
25
+
26
+ # Shojiku for Ruby — a template plus your data, deterministically, as a PDF.
27
+ #
28
+ # ```ruby
29
+ # client = Shojiku::Client.new(templates: "app/templates")
30
+ # result = client.generate("receipt_ja", customer: { name: "Yamada Shoji K.K." })
31
+ # result.artifact.write("receipt.pdf") if result.success?
32
+ # ```
33
+ #
34
+ # Three things about this gem are worth knowing before reading any of it.
35
+ #
36
+ # **Results, not exceptions.** No lifecycle operation raises in the normal
37
+ # flow. What raises is programmer misuse ({UsageError}) and an environment
38
+ # with no engine in it ({LibraryNotFound}).
39
+ #
40
+ # **Nothing here reimplements the engine.** Layout, formatting and PDF
41
+ # construction all happen in the shared C library this gem loads, so the same
42
+ # params produce the same bytes here, in the CLI, in the Designer and in the
43
+ # other six SDKs. A missing capability is missing in the engine and gets added
44
+ # there.
45
+ #
46
+ # **Nothing here downloads anything**, at install time or at run time. The
47
+ # platform gem carries the binary; otherwise you point `SHOJIKU_LIBRARY` at
48
+ # one you built. Sources an application fetched itself go to
49
+ # {Client#generate_source} — fetching is the application's act, and a
50
+ # deployment that wants to forbid even that declares `strict:` (see
51
+ # {Lockdown}).
52
+ module Shojiku
53
+ end
metadata ADDED
@@ -0,0 +1,90 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: shojiku
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - kengos
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2026-08-02 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: fiddle
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.1'
27
+ description: |
28
+ Ruby bindings for Shojiku, a document engine for invoices, receipts and
29
+ slips. A YAML template plus JSON or YAML params in, a deterministic PDF
30
+ out, with signing and verification over the result. The layout engine is a
31
+ shared C library loaded through fiddle, so the same params produce the same
32
+ bytes here as in the CLI and every other Shojiku SDK.
33
+ email:
34
+ - kengo@kengos.jp
35
+ executables: []
36
+ extensions: []
37
+ extra_rdoc_files: []
38
+ files:
39
+ - README.md
40
+ - lib/shojiku.rb
41
+ - lib/shojiku/artifact.rb
42
+ - lib/shojiku/client.rb
43
+ - lib/shojiku/config.rb
44
+ - lib/shojiku/diagnostic.rb
45
+ - lib/shojiku/engine.rb
46
+ - lib/shojiku/env.rb
47
+ - lib/shojiku/errors.rb
48
+ - lib/shojiku/failure.rb
49
+ - lib/shojiku/library.rb
50
+ - lib/shojiku/local_pem.rb
51
+ - lib/shojiku/lockdown.rb
52
+ - lib/shojiku/log.rb
53
+ - lib/shojiku/outcome.rb
54
+ - lib/shojiku/request.rb
55
+ - lib/shojiku/result.rb
56
+ - lib/shojiku/settings.rb
57
+ - lib/shojiku/sources.rb
58
+ - lib/shojiku/template_root.rb
59
+ - lib/shojiku/verification_report.rb
60
+ - lib/shojiku/version.rb
61
+ homepage: https://github.com/kengos/shojiku
62
+ licenses:
63
+ - MIT
64
+ - Apache-2.0
65
+ - BSD-3-Clause
66
+ metadata:
67
+ homepage_uri: https://github.com/kengos/shojiku
68
+ source_code_uri: https://github.com/kengos/shojiku/tree/main/sdk/ruby
69
+ documentation_uri: https://github.com/kengos/shojiku/blob/main/docs/engine/README.md
70
+ rubygems_mfa_required: 'true'
71
+ post_install_message:
72
+ rdoc_options: []
73
+ require_paths:
74
+ - lib
75
+ required_ruby_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: 3.3.0
80
+ required_rubygems_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ requirements: []
86
+ rubygems_version: 3.5.22
87
+ signing_key:
88
+ specification_version: 4
89
+ summary: Deterministic PDF documents from a YAML template plus your data
90
+ test_files: []