unparser 0.6.5 → 0.6.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bd425c8abea3ba512e8652c7f913b5ed09b5254fa868358f000f3af1fcd3ed82
4
- data.tar.gz: caf2e58c2f862bd94f63d3290876b61620cf100a22c88a07d3916d87f253c0c0
3
+ metadata.gz: 43c55e0072230fba02c24266555e1599559396739677e4371b6c9bca4b2a29b1
4
+ data.tar.gz: 4743b675c63ed3cf84ee3c784b70fd5078f8ed4e022e02bde27473a7bf44dbbe
5
5
  SHA512:
6
- metadata.gz: f45782eed90b778fbde30cdbd90f388a4b9f649e0080c26618e9243014618774d3afd9eb2076c7a47d0a0d43e137d1940382c85d0dea0915afa232f87d9e950d
7
- data.tar.gz: 2fda013558e05453f9ea1540b64bb51a9bd9269f6166395bd92f775aed3523abc5878b1c92c5ba4f0352842b6b4fb532f317f8a5d54aa108822f94dfcb7d9e9a
6
+ metadata.gz: 94bc33d333f3652cbdfa12169432d7a139b568cb72d4ae08994921760d2f7c8348a8d35f717053c059866ce7e640d08c9af6495a5e37132b2b667d1895b889da
7
+ data.tar.gz: ee2ee8e37250de111c419566c74d7b5954b02137f9e6fcb88cf9ff26820583698faf2533e6d01ae5738481bab91797060e2773781e9c93cb8da26efce602c1b0
data/README.md CHANGED
@@ -187,10 +187,15 @@ Contributing
187
187
  * Make your feature addition or bug fix.
188
188
  * Add tests for it. This is important so I don't break it in a
189
189
  future version unintentionally.
190
- * Commit, do not mess with Rakefile or version
190
+ * Commit, do not mess with version
191
191
  (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
192
192
  * Send me a pull request. Bonus points for topic branches.
193
193
 
194
+ Known Users
195
+ -------------
196
+
197
+ * [RailsRocket](https://www.railsrocket.app) - A no-code app builder that creates Rails apps
198
+
194
199
  License
195
200
  -------
196
201
 
data/bin/unparser CHANGED
@@ -2,7 +2,7 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  trap('INT') do |status|
5
- exit! 128 + status
5
+ exit! status + 128
6
6
  end
7
7
 
8
8
  require 'unparser'
@@ -44,7 +44,6 @@ module Unparser
44
44
  #
45
45
  def append_without_prefix(string)
46
46
  write(string)
47
- self
48
47
  end
49
48
 
50
49
  # Increase indent
@@ -77,7 +76,6 @@ module Unparser
77
76
  #
78
77
  def nl
79
78
  write(NL)
80
- self
81
79
  end
82
80
 
83
81
  def root_indent
@@ -107,18 +105,6 @@ module Unparser
107
105
  @content.dup.freeze
108
106
  end
109
107
 
110
- # Capture the content written to the buffer within the block
111
- #
112
- # @return [String]
113
- #
114
- # @api private
115
- #
116
- def capture_content
117
- size_before = content.size
118
- yield
119
- content[size_before..]
120
- end
121
-
122
108
  # Write raw fragment to buffer
123
109
  #
124
110
  # Does not do indentation logic.
@@ -28,7 +28,10 @@ module Unparser
28
28
 
29
29
  private
30
30
 
31
+ # Well rubocop you are static so you do not have a clue here ;)
32
+ # rubocop:disable Style/RedundantInitialize
31
33
  def initialize; end
34
+ # rubocop:enable Style/RedundantInitialize
32
35
 
33
36
  end.new
34
37
 
@@ -2,11 +2,13 @@
2
2
 
3
3
  module Unparser
4
4
  class Emitter
5
- # Emitter for block and kwrestarg arguments
6
- class Morearg < self
5
+ # Emitter for forwarding arguments
6
+ class ForwardArg < self
7
7
  MAP = {
8
- blockarg: '&',
9
- kwrestarg: '**'
8
+ blockarg: '&',
9
+ forwarded_kwrestarg: '**',
10
+ forwarded_restarg: '*',
11
+ kwrestarg: '**'
10
12
  }.freeze
11
13
 
12
14
  handle(*MAP.keys)
@@ -6,14 +6,6 @@ module Unparser
6
6
  class Hash < self
7
7
  handle :hash
8
8
 
9
- def emit_last_argument_hash
10
- if children.empty?
11
- write('{}')
12
- else
13
- emit_hash_body
14
- end
15
- end
16
-
17
9
  def emit_heredoc_reminders
18
10
  children.each(&method(:emit_heredoc_reminder_member))
19
11
  end
@@ -19,9 +19,9 @@ module Unparser
19
19
  end
20
20
 
21
21
  def binary_syntax_allowed?
22
- selector_binary_operator? \
23
- && arguments.one? \
24
- && !n_splat?(arguments.first) \
22
+ selector_binary_operator? \
23
+ && arguments.one? \
24
+ && !n_splat?(arguments.first) \
25
25
  && !n_kwargs?(arguments.first)
26
26
  end
27
27
 
@@ -113,18 +113,6 @@ module Unparser
113
113
  n_str?(last) && last.children.first[-1].eql?("\n")
114
114
  end
115
115
 
116
- def emit_squiggly_heredoc_body
117
- buffer.indent
118
- children.each do |child|
119
- if n_str?(child)
120
- write(escape_dynamic(child.children.first))
121
- else
122
- emit_dynamic(child)
123
- end
124
- end
125
- buffer.unindent
126
- end
127
-
128
116
  def emit_normal_heredoc_body
129
117
  buffer.root_indent do
130
118
  children.each do |child|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unparser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.5
4
+ version: 0.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Markus Schirp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-18 00:00:00.000000000 Z
11
+ date: 2023-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: diff-lcs
@@ -30,42 +30,42 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 3.1.0
33
+ version: 3.2.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 3.1.0
40
+ version: 3.2.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: mutant
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.11.4
47
+ version: 0.11.18
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.11.4
54
+ version: 0.11.18
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: mutant-rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.11.4
61
+ version: 0.11.18
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.11.4
68
+ version: 0.11.18
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -251,6 +251,7 @@ metadata:
251
251
  bug_tracker_uri: https://github.com/mbj/unparser/issues
252
252
  changelog_uri: https://github.com/mbj/unparser/blob/master/Changelog.md
253
253
  funding_uri: https://github.com/sponsors/mbj
254
+ rubygems_mfa_required: 'true'
254
255
  post_install_message:
255
256
  rdoc_options: []
256
257
  require_paths:
@@ -266,7 +267,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
266
267
  - !ruby/object:Gem::Version
267
268
  version: '0'
268
269
  requirements: []
269
- rubygems_version: 3.1.6
270
+ rubygems_version: 3.3.26
270
271
  signing_key:
271
272
  specification_version: 4
272
273
  summary: Generate equivalent source for parser gem AST nodes