rufo 0.3.0 → 0.3.1

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
  SHA1:
3
- metadata.gz: 68781ad7a9acb9d0469157827d84c19a3c43582d
4
- data.tar.gz: 8dd6f678a49a8e26bd01f534ca0b3c060b88d8a9
3
+ metadata.gz: 6403e7160a1d00c65b0562de144fe3aebf112a7e
4
+ data.tar.gz: d175a0ae7c46af1e5ebdfa7b4db59e324af1fdf3
5
5
  SHA512:
6
- metadata.gz: 82a80a462d83f51b449a64c6b12c6a49fdd658b3321bc720a24239613ca375e5340585e2e81bd667c9c88eb956bf5d5dae557434186924817b8e9ef3c8f9ec9d
7
- data.tar.gz: df226a82d72e7ec562b6b002e9c89956a6add4a8b5f2933c7e4f53ea53140f270acbf21e50ab297689dab1a0dad2e71fc671ee5fa24a2a638a6756cec8762dbd
6
+ metadata.gz: 8664f038f6bb0f10e60a7e84278bcfd91ae6205d71b7e73b50dfdaf39145664c8300e2b10cfe0eddb2551eb2fd81e81e6a50ae9a6e5de3f6c1500f51ea155c18
7
+ data.tar.gz: 4d6390b9b88aeb21d97090326b9ae2eb923fdb299b658209efaf30f21b0830bc37778ced67811d550eaedc3c9f9125618b6f88e4ac2287db3e5c67e6caf66c86
@@ -6,13 +6,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.3.1] - 2018-04-12
10
+
11
+ ### Fixed
12
+ - Fix `quote_style` config not being respected (issue [#95](https://github.com/ruby-formatter/rufo/issues/95)).
13
+
9
14
  ## [0.3.0] - 2018-03-24
10
15
 
11
16
  ### Added
12
17
  - Added Idempotency check to source_specs/ tester.
13
18
  - Normalize string quotes according to quote_style, which defaults to :double.
14
19
 
15
- ## Fixed
20
+ ### Fixed
16
21
  - Fix printing of extraneous trailing semicolons from inline classes, modules, methods (issue [#59](https://github.com/ruby-formatter/rufo/issues/59))
17
22
  - Fix unhandled white space between array getter/setters `x[0] [0]` (issue [#62](https://github.com/ruby-formatter/rufo/issues/62))
18
23
  - Fix comma printing for heredocs when inside a hash (issue [#61](https://github.com/ruby-formatter/rufo/issues/61))
@@ -170,9 +170,6 @@ class Rufo::Formatter
170
170
  @literal_elements_level = nil
171
171
 
172
172
  init_settings(options)
173
-
174
- # Which quote character are we using?
175
- @quote_char = (quote_style == :double) ? '"' : "'"
176
173
  end
177
174
 
178
175
  def format
@@ -628,6 +625,11 @@ class Rufo::Formatter
628
625
  string
629
626
  end
630
627
 
628
+ # Which quote character are we using?
629
+ def quote_char
630
+ (quote_style == :double) ? '"' : "'"
631
+ end
632
+
631
633
  # should we format this string according to :quote_style?
632
634
  def should_format_string?(string)
633
635
  # don't format %q or %Q
@@ -635,7 +637,7 @@ class Rufo::Formatter
635
637
  # don't format strings containing slashes
636
638
  return if string.include?("\\")
637
639
  # don't format strings that contain our quote character
638
- return if string.include?(@quote_char)
640
+ return if string.include?(quote_char)
639
641
  true
640
642
  end
641
643
 
@@ -648,13 +650,13 @@ class Rufo::Formatter
648
650
  return if !should_format_string?(string)
649
651
 
650
652
  # success!
651
- write @quote_char
653
+ write quote_char
652
654
  next_token
653
655
  with_unmodifiable_string_lines do
654
656
  inner = node[1][1..-1]
655
657
  visit_exps(inner, with_lines: false)
656
658
  end
657
- write @quote_char
659
+ write quote_char
658
660
  next_token
659
661
 
660
662
  true
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rufo
4
- VERSION = "0.3.0"
4
+ VERSION = "0.3.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rufo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ary Borenszweig
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-27 00:00:00.000000000 Z
11
+ date: 2018-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -121,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  version: '0'
122
122
  requirements: []
123
123
  rubyforge_project:
124
- rubygems_version: 2.6.14
124
+ rubygems_version: 2.6.13
125
125
  signing_key:
126
126
  specification_version: 4
127
127
  summary: Ruby code formatter