syntax_tree-json 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -2
- data/Gemfile.lock +6 -2
- data/README.md +2 -2
- data/lib/syntax_tree/json/version.rb +1 -1
- data/lib/syntax_tree/json.rb +3 -2
- data/syntax_tree-json.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e254feef0c7698c445f1f926957850da544b82e3d708a4dced11fad5df81de94
|
4
|
+
data.tar.gz: 868de6d426b3a22e66f8ddf8e09df6756ca020cf808bd30d909f8994acfd0bef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc062e3bba849e2948de7219e075b4c06c05b49465b2acfbe0237227989a3847f58031424631fb8954ea31e91e100856d66ede53984fb51033438af13f63e95f
|
7
|
+
data.tar.gz: 5fa6ffe9d9bc18f560e160556369e7717cacd5cf8a0eb172b9f6e33d0d812b51a78e24466ae2ef80bb03c2952cca71a864dab9033d74112ba68adbc87f6e1480
|
data/CHANGELOG.md
CHANGED
@@ -6,11 +6,18 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [0.2.0] - 2022-05-13
|
10
|
+
|
11
|
+
### Changed
|
12
|
+
|
13
|
+
- Use `prettier_print` for formatting.
|
14
|
+
|
9
15
|
## [0.1.0] - 2022-03-31
|
10
16
|
|
11
17
|
### Added
|
12
18
|
|
13
19
|
- 🎉 Initial release! 🎉
|
14
20
|
|
15
|
-
[unreleased]: https://github.com/ruby-syntax-tree/syntax_tree-json/compare/v0.
|
16
|
-
[0.
|
21
|
+
[unreleased]: https://github.com/ruby-syntax-tree/syntax_tree-json/compare/v0.2.0...HEAD
|
22
|
+
[0.2.0]: https://github.com/ruby-syntax-tree/syntax_tree-json/compare/v0.1.0...v0.2.0
|
23
|
+
[0.1.0]: https://github.com/ruby-syntax-tree/syntax_tree-json/compare/291383...v0.1.0
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
syntax_tree-json (0.
|
4
|
+
syntax_tree-json (0.2.0)
|
5
5
|
json
|
6
|
+
prettier_print
|
6
7
|
syntax_tree (>= 2.0.1)
|
7
8
|
|
8
9
|
GEM
|
@@ -11,6 +12,7 @@ GEM
|
|
11
12
|
docile (1.4.0)
|
12
13
|
json (2.6.1)
|
13
14
|
minitest (5.15.0)
|
15
|
+
prettier_print (0.1.0)
|
14
16
|
rake (13.0.6)
|
15
17
|
simplecov (0.21.2)
|
16
18
|
docile (~> 1.1)
|
@@ -18,10 +20,12 @@ GEM
|
|
18
20
|
simplecov_json_formatter (~> 0.1)
|
19
21
|
simplecov-html (0.12.3)
|
20
22
|
simplecov_json_formatter (0.1.4)
|
21
|
-
syntax_tree (2.0
|
23
|
+
syntax_tree (2.5.0)
|
24
|
+
prettier_print
|
22
25
|
|
23
26
|
PLATFORMS
|
24
27
|
x86_64-darwin-21
|
28
|
+
x86_64-linux
|
25
29
|
|
26
30
|
DEPENDENCIES
|
27
31
|
bundler
|
data/README.md
CHANGED
@@ -36,14 +36,14 @@ From the CLI:
|
|
36
36
|
|
37
37
|
```sh
|
38
38
|
$ stree ast --plugins=json file.json
|
39
|
-
(root
|
39
|
+
(root object=(object values={"Hello"=>(literal value="world!")}))
|
40
40
|
```
|
41
41
|
|
42
42
|
or
|
43
43
|
|
44
44
|
```sh
|
45
45
|
$ stree format --plugins=json file.json
|
46
|
-
|
46
|
+
{ "Hello": "world!" }
|
47
47
|
```
|
48
48
|
|
49
49
|
or
|
data/lib/syntax_tree/json.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "json"
|
4
|
+
require "prettier_print"
|
4
5
|
require "syntax_tree"
|
5
6
|
|
6
7
|
require_relative "json/version"
|
@@ -97,8 +98,8 @@ module SyntaxTree
|
|
97
98
|
end
|
98
99
|
|
99
100
|
class << self
|
100
|
-
def format(source)
|
101
|
-
formatter =
|
101
|
+
def format(source, maxwidth = 80)
|
102
|
+
formatter = PrettierPrint.new([], maxwidth)
|
102
103
|
parse(source).format(formatter)
|
103
104
|
|
104
105
|
formatter.flush
|
data/syntax_tree-json.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: syntax_tree-json
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Newton
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-05-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: prettier_print
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: syntax_tree
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|