syntax_tree 5.0.0 → 5.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -1
- data/Gemfile.lock +1 -1
- data/lib/syntax_tree/cli.rb +8 -6
- data/lib/syntax_tree/version.rb +1 -1
- data/lib/syntax_tree.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b2322461fc3abb52a77604f2b6791c82941983bb490a8281eceb336336ae2f1
|
4
|
+
data.tar.gz: 395163315be211645af6b4ed60852342d247b428cda0d29a546f700a3d311387
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d6754a8cc53af931bc1c14a18ed85a86e0c15412e127ad9a0c94592694c8ffdb359cf51e89ba87b84c9c3c5da64a2cee4ebf5638cbb2d2c672f47bc69a4d376
|
7
|
+
data.tar.gz: 90d86586324ca16f482f29f77dc8091a297b237970abdbb95745455ef6619cce854682be8f4ea98e5a6b6006379379fe5cc5e3e15ce96d1883da983b085fce22
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [5.0.1] - 2022-11-10
|
10
|
+
|
11
|
+
### Changed
|
12
|
+
|
13
|
+
- Fix the plugin parsing on the CLI so that they are respected.
|
14
|
+
|
9
15
|
## [5.0.0] - 2022-11-09
|
10
16
|
|
11
17
|
### Added
|
@@ -450,7 +456,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
|
|
450
456
|
|
451
457
|
- 🎉 Initial release! 🎉
|
452
458
|
|
453
|
-
[unreleased]: https://github.com/ruby-syntax-tree/syntax_tree/compare/v5.0.
|
459
|
+
[unreleased]: https://github.com/ruby-syntax-tree/syntax_tree/compare/v5.0.1...HEAD
|
460
|
+
[5.0.1]: https://github.com/ruby-syntax-tree/syntax_tree/compare/v5.0.0...v5.0.1
|
454
461
|
[5.0.0]: https://github.com/ruby-syntax-tree/syntax_tree/compare/v4.3.0...v5.0.0
|
455
462
|
[4.3.0]: https://github.com/ruby-syntax-tree/syntax_tree/compare/v4.2.0...v4.3.0
|
456
463
|
[4.2.0]: https://github.com/ruby-syntax-tree/syntax_tree/compare/v4.1.0...v4.2.0
|
data/Gemfile.lock
CHANGED
data/lib/syntax_tree/cli.rb
CHANGED
@@ -377,14 +377,19 @@ module SyntaxTree
|
|
377
377
|
:plugins,
|
378
378
|
:print_width,
|
379
379
|
:scripts,
|
380
|
-
:
|
380
|
+
:target_ruby_version
|
381
381
|
|
382
382
|
def initialize
|
383
383
|
@ignore_files = []
|
384
384
|
@plugins = []
|
385
385
|
@print_width = DEFAULT_PRINT_WIDTH
|
386
386
|
@scripts = []
|
387
|
-
@
|
387
|
+
@target_ruby_version = DEFAULT_RUBY_VERSION
|
388
|
+
end
|
389
|
+
|
390
|
+
def formatter_options
|
391
|
+
@formatter_options ||=
|
392
|
+
Formatter::Options.new(target_ruby_version: target_ruby_version)
|
388
393
|
end
|
389
394
|
|
390
395
|
def parse(arguments)
|
@@ -430,10 +435,7 @@ module SyntaxTree
|
|
430
435
|
# If there is a target ruby version specified on the command line,
|
431
436
|
# parse that out and use it when formatting.
|
432
437
|
opts.on("--target-ruby-version=VERSION") do |version|
|
433
|
-
@
|
434
|
-
Formatter::Options.new(
|
435
|
-
target_ruby_version: Formatter::SemanticVersion.new(version)
|
436
|
-
)
|
438
|
+
@target_ruby_version = Formatter::SemanticVersion.new(version)
|
437
439
|
end
|
438
440
|
end
|
439
441
|
end
|
data/lib/syntax_tree/version.rb
CHANGED
data/lib/syntax_tree.rb
CHANGED
@@ -40,6 +40,10 @@ module SyntaxTree
|
|
40
40
|
# optional second argument to ::format.
|
41
41
|
DEFAULT_PRINT_WIDTH = 80
|
42
42
|
|
43
|
+
# This is the default ruby version that we're going to target for formatting.
|
44
|
+
# It shouldn't really be changed except in very niche circumstances.
|
45
|
+
DEFAULT_RUBY_VERSION = Formatter::SemanticVersion.new(RUBY_VERSION).freeze
|
46
|
+
|
43
47
|
# This is a hook provided so that plugins can register themselves as the
|
44
48
|
# handler for a particular file type.
|
45
49
|
def self.register_handler(extension, handler)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: syntax_tree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.1
|
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-
|
11
|
+
date: 2022-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: prettier_print
|