citrus-toml-merge 7.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: 7d21570bb6bdd5d9386b03424c3c979cd8b634ce631aeb430ec1de7fd6126343
4
+ data.tar.gz: cc6ec3e8e287c187a957f3fa8b678ae86d0bcdbcb954df62664cf2905e127ebb
5
+ SHA512:
6
+ metadata.gz: 79c3cd253fcc0fb1b145d7f03493c5b7d266a5d80784e2d7da1ae7888fb9ef34601d8a1c010cb580d4b4d1dc9188f47dc8d13915d2a5a044a02484cbad4deb7b
7
+ data.tar.gz: f600ff42d22281a9382c85050745e4e193d6caeb5ead6b6472ae18e919bf483997954cea9622df242dbe3cbb9bde22062baf40062e133f13ceda62dc6ce87e36
checksums.yaml.gz.sig ADDED
Binary file
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Citrus
4
+ module Toml
5
+ module Merge
6
+ module Version
7
+ VERSION = "7.0.0"
8
+ end
9
+
10
+ VERSION = Version::VERSION
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,90 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "toml-merge"
4
+ require "toml-rb"
5
+
6
+ module Citrus
7
+ module Toml
8
+ module Merge
9
+ extend self
10
+
11
+ PACKAGE_NAME = "citrus-toml-merge"
12
+ BACKEND = TreeHaver::CITRUS_BACKEND
13
+
14
+ def toml_feature_profile
15
+ ::Toml::Merge.toml_feature_profile
16
+ end
17
+
18
+ def available_toml_backends
19
+ [BACKEND]
20
+ end
21
+
22
+ def toml_backend_feature_profile(backend: nil)
23
+ requested = backend.to_s.empty? ? BACKEND.id : backend.to_s
24
+ return unsupported_feature_result("Unsupported TOML backend #{requested}.") unless requested == BACKEND.id
25
+
26
+ toml_feature_profile.merge(
27
+ backend: BACKEND.id,
28
+ backend_ref: BACKEND.to_h
29
+ )
30
+ end
31
+
32
+ def toml_plan_context(backend: nil)
33
+ profile = toml_backend_feature_profile(backend: backend)
34
+ return profile if profile[:ok] == false
35
+
36
+ {
37
+ family_profile: toml_feature_profile,
38
+ feature_profile: {
39
+ backend: profile[:backend],
40
+ supports_dialects: false,
41
+ supported_policies: profile[:supported_policies]
42
+ }
43
+ }
44
+ end
45
+
46
+ def parse_toml(source, dialect, backend: nil)
47
+ requested = backend.to_s.empty? ? BACKEND.id : backend.to_s
48
+ return unsupported_feature_result("Unsupported TOML backend #{requested}.") unless requested == BACKEND.id
49
+ return unsupported_feature_result("Unsupported TOML dialect #{dialect}.") unless dialect == "toml"
50
+
51
+ syntax_result = TreeHaver.parse_with_citrus(source, grammar_module: TomlRB::Document)
52
+ return { ok: false, diagnostics: syntax_result[:diagnostics], policies: [] } unless syntax_result[:ok]
53
+
54
+ ::Toml::Merge.analyze_toml_source(source, dialect)
55
+ end
56
+
57
+ def match_toml_owners(template, destination)
58
+ ::Toml::Merge.match_toml_owners(template, destination)
59
+ end
60
+
61
+ def merge_toml(template_source, destination_source, dialect, backend: nil)
62
+ requested = backend.to_s.empty? ? BACKEND.id : backend.to_s
63
+ return unsupported_feature_result("Unsupported TOML backend #{requested}.") unless requested == BACKEND.id
64
+
65
+ ::Toml::Merge.merge_toml_with_parser(template_source, destination_source, dialect) do |source, parse_dialect|
66
+ parse_toml(source, parse_dialect, backend: BACKEND.id)
67
+ end
68
+ end
69
+
70
+ def unsupported_feature_result(message)
71
+ {
72
+ ok: false,
73
+ diagnostics: [{ severity: "error", category: "unsupported_feature", message: message }],
74
+ policies: []
75
+ }
76
+ end
77
+
78
+ module_function(
79
+ :toml_feature_profile,
80
+ :available_toml_backends,
81
+ :toml_backend_feature_profile,
82
+ :toml_plan_context,
83
+ :parse_toml,
84
+ :match_toml_owners,
85
+ :merge_toml,
86
+ :unsupported_feature_result
87
+ )
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "citrus/toml/merge"
data.tar.gz.sig ADDED
Binary file
metadata ADDED
@@ -0,0 +1,109 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: citrus-toml-merge
3
+ version: !ruby/object:Gem::Version
4
+ version: 7.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Peter H. Boling
8
+ bindir: bin
9
+ cert_chain:
10
+ - |
11
+ -----BEGIN CERTIFICATE-----
12
+ MIIEgDCCAuigAwIBAgIBATANBgkqhkiG9w0BAQsFADBDMRUwEwYDVQQDDAxwZXRl
13
+ ci5ib2xpbmcxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkW
14
+ A2NvbTAeFw0yNTA1MDQxNTMzMDlaFw00NTA0MjkxNTMzMDlaMEMxFTATBgNVBAMM
15
+ DHBldGVyLmJvbGluZzEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPy
16
+ LGQBGRYDY29tMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAruUoo0WA
17
+ uoNuq6puKWYeRYiZekz/nsDeK5x/0IEirzcCEvaHr3Bmz7rjo1I6On3gGKmiZs61
18
+ LRmQ3oxy77ydmkGTXBjruJB+pQEn7UfLSgQ0xa1/X3kdBZt6RmabFlBxnHkoaGY5
19
+ mZuZ5+Z7walmv6sFD9ajhzj+oIgwWfnEHkXYTR8I6VLN7MRRKGMPoZ/yvOmxb2DN
20
+ coEEHWKO9CvgYpW7asIihl/9GMpKiRkcYPm9dGQzZc6uTwom1COfW0+ZOFrDVBuV
21
+ FMQRPswZcY4Wlq0uEBLPU7hxnCL9nKK6Y9IhdDcz1mY6HZ91WImNslOSI0S8hRpj
22
+ yGOWxQIhBT3fqCBlRIqFQBudrnD9jSNpSGsFvbEijd5ns7Z9ZMehXkXDycpGAUj1
23
+ to/5cuTWWw1JqUWrKJYoifnVhtE1o1DZ+LkPtWxHtz5kjDG/zR3MG0Ula0UOavlD
24
+ qbnbcXPBnwXtTFeZ3C+yrWpE4pGnl3yGkZj9SMTlo9qnTMiPmuWKQDatAgMBAAGj
25
+ fzB9MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQWBBQE8uWvNbPVNRXZ
26
+ HlgPbc2PCzC4bjAhBgNVHREEGjAYgRZwZXRlci5ib2xpbmdAZ21haWwuY29tMCEG
27
+ A1UdEgQaMBiBFnBldGVyLmJvbGluZ0BnbWFpbC5jb20wDQYJKoZIhvcNAQELBQAD
28
+ ggGBAJbnUwfJQFPkBgH9cL7hoBfRtmWiCvdqdjeTmi04u8zVNCUox0A4gT982DE9
29
+ wmuN12LpdajxZONqbXuzZvc+nb0StFwmFYZG6iDwaf4BPywm2e/Vmq0YG45vZXGR
30
+ L8yMDSK1cQXjmA+ZBKOHKWavxP6Vp7lWvjAhz8RFwqF9GuNIdhv9NpnCAWcMZtpm
31
+ GUPyIWw/Cw/2wZp74QzZj6Npx+LdXoLTF1HMSJXZ7/pkxLCsB8m4EFVdb/IrW/0k
32
+ kNSfjtAfBHO8nLGuqQZVH9IBD1i9K6aSs7pT6TW8itXUIlkIUI2tg5YzW6OFfPzq
33
+ QekSkX3lZfY+HTSp/o+YvKkqWLUV7PQ7xh1ZYDtocpaHwgxe/j3bBqHE+CUPH2vA
34
+ 0V/FwdTRWcwsjVoOJTrYcff8pBZ8r2MvtAc54xfnnhGFzeRHfcltobgFxkAXdE6p
35
+ DVjBtqT23eugOqQ73umLcYDZkc36vnqGxUBSsXrzY9pzV5gGr2I8YUxMqf6ATrZt
36
+ L9nRqA==
37
+ -----END CERTIFICATE-----
38
+ date: 1980-01-02 00:00:00.000000000 Z
39
+ dependencies:
40
+ - !ruby/object:Gem::Dependency
41
+ name: toml-merge
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - '='
45
+ - !ruby/object:Gem::Version
46
+ version: 7.0.0
47
+ type: :runtime
48
+ prerelease: false
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - '='
52
+ - !ruby/object:Gem::Version
53
+ version: 7.0.0
54
+ - !ruby/object:Gem::Dependency
55
+ name: toml-rb
56
+ requirement: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '4.1'
61
+ type: :runtime
62
+ prerelease: false
63
+ version_requirements: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '4.1'
68
+ description: Citrus-backed TOML provider gem for the Structured Merge TOML family.
69
+ email:
70
+ - info@structuredmerge.org
71
+ executables: []
72
+ extensions: []
73
+ extra_rdoc_files: []
74
+ files:
75
+ - lib/citrus-toml-merge.rb
76
+ - lib/citrus/toml/merge.rb
77
+ - lib/citrus/toml/merge/version.rb
78
+ homepage: https://github.com/structuredmerge/structuredmerge-ruby
79
+ licenses:
80
+ - AGPL-3.0-only
81
+ - PolyForm-Small-Business-1.0.0
82
+ metadata:
83
+ homepage_uri: https://structuredmerge.org
84
+ source_code_uri: https://github.com/structuredmerge/structuredmerge-ruby/tree/v7.0.0
85
+ changelog_uri: https://github.com/structuredmerge/structuredmerge-ruby/blob/v7.0.0/CHANGELOG.md
86
+ bug_tracker_uri: https://github.com/structuredmerge/structuredmerge-ruby/issues
87
+ documentation_uri: https://www.rubydoc.info/gems/citrus-toml-merge/7.0.0
88
+ funding_uri: https://github.com/sponsors/pboling
89
+ wiki_uri: https://github.com/structuredmerge/structuredmerge-ruby/wiki
90
+ discord_uri: https://discord.gg/3qme4XHNKN
91
+ rubygems_mfa_required: 'true'
92
+ rdoc_options: []
93
+ require_paths:
94
+ - lib
95
+ required_ruby_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: 4.0.0
100
+ required_rubygems_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ requirements: []
106
+ rubygems_version: 4.0.10
107
+ specification_version: 4
108
+ summary: Structured Merge Citrus-backed TOML analysis for Ruby
109
+ test_files: []
metadata.gz.sig ADDED
Binary file