unparser 0.5.0 → 0.5.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: c326e601dd3bcfdc7363e456e07d1b15ef323ae095e39026e094205de5206119
4
- data.tar.gz: a839f69163fab291b893a7e0702771848fc4632161414dff4b4528ad12568573
3
+ metadata.gz: 5edf8f2731473b62649c92936d8c04ff8a19e598bdc9811feb332d8cd3cff58f
4
+ data.tar.gz: 8e47978900270932616a7c7b1a8869442d0d0e64c90a6147b7bd6d0938edea44
5
5
  SHA512:
6
- metadata.gz: b6821013d903d32988111efbea734cc1daaeb02d5fc4b3073c215365f365fd86d52a40c4b495175610d30c30a467670ea2c37357acbb8191623940673119cfae
7
- data.tar.gz: 924afece12fe65ab3c4783420ca6ce200db08249830eb0a0cdd16b69ddb05f7377dc0900e832abd0957c97b0d4fe259eaa0c320c67e714d9daeed033575bd235
6
+ metadata.gz: d5966f2f944ee5f596a3919d9c6d6b1ce1406ba4ab015b39d220941f35c4c5e5aeb401c270dab0b60883bd8b5fb3379d7dafe28be657a4af9fa4045be784a6f4
7
+ data.tar.gz: 837b201d4d4ea307cbdc50d04640957618f6ccec1e7d5782b5b3654901369d80f02425d5c4a9b61cb1f90fb87d14146fff4889b7b1d49039369d58fdc33aa7d8
@@ -46,7 +46,7 @@ module Unparser
46
46
  end
47
47
 
48
48
  def heredoc?
49
- children.empty? || (nl_last_child? && heredoc_pattern?)
49
+ !children.empty? && (nl_last_child? && heredoc_pattern?)
50
50
  end
51
51
 
52
52
  def emit_heredoc_header
@@ -169,8 +169,12 @@ module Unparser
169
169
  end
170
170
 
171
171
  def emit_dstr
172
- segments.each_with_index do |children, index|
173
- emit_segment(children, index)
172
+ if children.empty?
173
+ write('%()')
174
+ else
175
+ segments.each_with_index do |children, index|
176
+ emit_segment(children, index)
177
+ end
174
178
  end
175
179
  end
176
180
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unparser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Markus Schirp
@@ -347,7 +347,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
347
347
  - !ruby/object:Gem::Version
348
348
  version: '0'
349
349
  requirements: []
350
- rubygems_version: 3.2.0.rc.1
350
+ rubygems_version: 3.1.4
351
351
  signing_key:
352
352
  specification_version: 4
353
353
  summary: Generate equivalent source for parser gem AST nodes