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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1bd3ed5ae531078970bd28dd6e2f1eb4e6d759652620b8c6afa339baa66b6302
4
- data.tar.gz: 7e0b8d80c5d490ed36baa045cee3c11da9a51bb34baf8915d4514508e1dee14a
3
+ metadata.gz: 3b2322461fc3abb52a77604f2b6791c82941983bb490a8281eceb336336ae2f1
4
+ data.tar.gz: 395163315be211645af6b4ed60852342d247b428cda0d29a546f700a3d311387
5
5
  SHA512:
6
- metadata.gz: d47ecd8be7ae9416005b10c71047cd80b0a06ecfe44b036d690d981a9ccd24dcb9f1d90e98198c29d3d08463ffe119f08edfe64914adf01f5f05770efc34debb
7
- data.tar.gz: 1c01da0e77f9b9b633cf6dbce058f8e1aa889572a201ef223455ba0155b68ff978d4088d78e4a4c78e30a853fc994b05d2901f2a189c90beff643653a1b6eb6b
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.0...HEAD
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- syntax_tree (5.0.0)
4
+ syntax_tree (5.0.1)
5
5
  prettier_print (>= 1.1.0)
6
6
 
7
7
  GEM
@@ -377,14 +377,19 @@ module SyntaxTree
377
377
  :plugins,
378
378
  :print_width,
379
379
  :scripts,
380
- :formatter_options
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
- @formatter_options = Formatter::Options.new
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
- @formatter_options =
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SyntaxTree
4
- VERSION = "5.0.0"
4
+ VERSION = "5.0.1"
5
5
  end
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.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-09 00:00:00.000000000 Z
11
+ date: 2022-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: prettier_print