legion-json 1.2.1 → 1.3.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 +4 -4
- data/.github/CODEOWNERS +7 -0
- data/.github/dependabot.yml +18 -0
- data/.github/workflows/ci.yml +20 -2
- data/CHANGELOG.md +9 -0
- data/lib/legion/json/helper.rb +14 -1
- data/lib/legion/json/version.rb +1 -1
- data/lib/legion/json.rb +22 -0
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9d9fac81994418377b668dbf12b3604728fde04c4f1a2817708bb510348ab241
|
|
4
|
+
data.tar.gz: c92b8f3cfe4dcc21edf25f4e85fc46943ec464271b52f88a476370ea4660c260
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f0f1413e53aee221483a807b32758b696479f8e6d61e89275eca79c5ea00597e96db3136c883643a01b389729dace324021ea188363be973e63df923dae12899
|
|
7
|
+
data.tar.gz: a07792a1311935bab4613c2b2a992f72ca4caad6612f3e2ddcb8a5b7f4bff538a741bb401718fbacf75fb007e38d10d630996d8e1d399f536ebe1d07aea2ca15
|
data/.github/CODEOWNERS
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: bundler
|
|
4
|
+
directory: /
|
|
5
|
+
schedule:
|
|
6
|
+
interval: weekly
|
|
7
|
+
day: monday
|
|
8
|
+
open-pull-requests-limit: 5
|
|
9
|
+
labels:
|
|
10
|
+
- "type:dependencies"
|
|
11
|
+
- package-ecosystem: github-actions
|
|
12
|
+
directory: /
|
|
13
|
+
schedule:
|
|
14
|
+
interval: weekly
|
|
15
|
+
day: monday
|
|
16
|
+
open-pull-requests-limit: 5
|
|
17
|
+
labels:
|
|
18
|
+
- "type:dependencies"
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -3,14 +3,32 @@ on:
|
|
|
3
3
|
push:
|
|
4
4
|
branches: [main]
|
|
5
5
|
pull_request:
|
|
6
|
+
schedule:
|
|
7
|
+
- cron: '0 9 * * 1'
|
|
6
8
|
|
|
7
9
|
jobs:
|
|
8
10
|
ci:
|
|
9
11
|
uses: LegionIO/.github/.github/workflows/ci.yml@main
|
|
10
12
|
|
|
13
|
+
lint:
|
|
14
|
+
uses: LegionIO/.github/.github/workflows/lint-patterns.yml@main
|
|
15
|
+
|
|
16
|
+
security:
|
|
17
|
+
uses: LegionIO/.github/.github/workflows/security-scan.yml@main
|
|
18
|
+
|
|
19
|
+
version-changelog:
|
|
20
|
+
uses: LegionIO/.github/.github/workflows/version-changelog.yml@main
|
|
21
|
+
|
|
22
|
+
dependency-review:
|
|
23
|
+
uses: LegionIO/.github/.github/workflows/dependency-review.yml@main
|
|
24
|
+
|
|
25
|
+
stale:
|
|
26
|
+
if: github.event_name == 'schedule'
|
|
27
|
+
uses: LegionIO/.github/.github/workflows/stale.yml@main
|
|
28
|
+
|
|
11
29
|
release:
|
|
12
|
-
needs: ci
|
|
30
|
+
needs: [ci, lint]
|
|
13
31
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
14
32
|
uses: LegionIO/.github/.github/workflows/release.yml@main
|
|
15
33
|
secrets:
|
|
16
|
-
rubygems-api-key: ${{ secrets.RUBYGEMS_API_KEY }}
|
|
34
|
+
rubygems-api-key: ${{ secrets.RUBYGEMS_API_KEY }}
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Legion::JSON
|
|
2
2
|
|
|
3
|
+
## [1.3.0] - 2026-03-26
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- `.parse(string, symbolize_names: true)` — wraps `::JSON.parse` with `ParseError` error handling and symbol keys by default
|
|
7
|
+
- `.generate(object)` — wraps `::JSON.generate` for compact output
|
|
8
|
+
- `.pretty_generate(object)` — wraps `::JSON.pretty_generate` for formatted output
|
|
9
|
+
- `.fast_generate(object)` — wraps `::JSON.fast_generate` for unchecked fast output
|
|
10
|
+
- Helper methods: `json_parse`, `json_generate`, `json_pretty_generate` in `Legion::JSON::Helper`
|
|
11
|
+
|
|
3
12
|
## [1.2.1] - 2026-03-22
|
|
4
13
|
|
|
5
14
|
### Added
|
data/lib/legion/json/helper.rb
CHANGED
|
@@ -8,7 +8,20 @@ module Legion
|
|
|
8
8
|
end
|
|
9
9
|
|
|
10
10
|
def json_dump(object, pretty: false)
|
|
11
|
-
|
|
11
|
+
opts = { pretty: pretty }
|
|
12
|
+
Legion::JSON.dump(object, **opts)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def json_parse(string, symbolize_names: true)
|
|
16
|
+
Legion::JSON.parse(string, symbolize_names: symbolize_names)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def json_generate(object)
|
|
20
|
+
Legion::JSON.generate(object)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def json_pretty_generate(object)
|
|
24
|
+
Legion::JSON.pretty_generate(object)
|
|
12
25
|
end
|
|
13
26
|
end
|
|
14
27
|
end
|
data/lib/legion/json/version.rb
CHANGED
data/lib/legion/json.rb
CHANGED
|
@@ -25,5 +25,27 @@ module Legion
|
|
|
25
25
|
parser.dump(object, pretty: pretty)
|
|
26
26
|
end
|
|
27
27
|
module_function :dump
|
|
28
|
+
|
|
29
|
+
def parse(string, symbolize_names: true)
|
|
30
|
+
::JSON.parse(string, symbolize_names: symbolize_names)
|
|
31
|
+
rescue StandardError => e
|
|
32
|
+
raise Legion::JSON::ParseError.build(e, string)
|
|
33
|
+
end
|
|
34
|
+
module_function :parse
|
|
35
|
+
|
|
36
|
+
def generate(object)
|
|
37
|
+
::JSON.generate(object)
|
|
38
|
+
end
|
|
39
|
+
module_function :generate
|
|
40
|
+
|
|
41
|
+
def pretty_generate(object)
|
|
42
|
+
::JSON.pretty_generate(object)
|
|
43
|
+
end
|
|
44
|
+
module_function :pretty_generate
|
|
45
|
+
|
|
46
|
+
def fast_generate(object)
|
|
47
|
+
::JSON.fast_generate(object)
|
|
48
|
+
end
|
|
49
|
+
module_function :fast_generate
|
|
28
50
|
end
|
|
29
51
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: legion-json
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Esity
|
|
@@ -47,6 +47,8 @@ extra_rdoc_files:
|
|
|
47
47
|
- LICENSE
|
|
48
48
|
- README.md
|
|
49
49
|
files:
|
|
50
|
+
- ".github/CODEOWNERS"
|
|
51
|
+
- ".github/dependabot.yml"
|
|
50
52
|
- ".github/workflows/ci.yml"
|
|
51
53
|
- ".gitignore"
|
|
52
54
|
- ".rubocop.yml"
|