rufo 0.4.1 → 0.4.2

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: c61c7219203fc96ae65a699fe47915af93accda41694e258ab14e370f27b0d7b
4
- data.tar.gz: ccbd7e574472ae99b6fc097c57ccc83bfb4c29d6c35255108964bcff7b7d7b38
3
+ metadata.gz: db1dcca141aa241d1f18e99eb17cab04fe26a2f922fbcd0272c371b43f62459d
4
+ data.tar.gz: 5319a68334194f410d607a24425584ed114c9fb775908fa9f09eb37101d31da8
5
5
  SHA512:
6
- metadata.gz: c7662f8ebec1d49f1d1c9fef7731960e28d7e165723acc01b76e0cd8218af50c69ee8fb09b7228962a796744b5fbcbccfbfda5b91dac08b263569e52d45726e8
7
- data.tar.gz: 1a180929b2a7b6d3f421208f853346649c6866fb23f0d623f8064dc486cce6c2401eaa38da6304ad1128446d74dc33bd2ace15c26931bf55a2f885d0c1d9a7de
6
+ metadata.gz: 9ba69ebe856e99f8a0a2d1bd467b0b61e1e12f7d0b3c0dd26d4e0de2b2d4adb5804fdf864904dcf5bccc05afe2e5607f67a4f8be28d9dc5d5004b955ff76d96c
7
+ data.tar.gz: 276167c342eeddcf7e45608a9219029216081c34a0021aeb35504d4239078ac0a8f31f667d255a76fb384ee7d801857d64954ac7c8abebb0d37bec8120039554
data/.travis.yml CHANGED
@@ -2,6 +2,7 @@ sudo: false
2
2
  language: ruby
3
3
  cache: bundler
4
4
  rvm:
5
+ - 2.6.0
5
6
  - 2.5.1
6
7
  - 2.4.4
7
8
  - 2.3.7
data/CHANGELOG.md CHANGED
@@ -10,7 +10,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
10
10
 
11
11
  ### Added
12
12
 
13
- ## [0.4.1] - 2018-08-09
13
+ ## [0.4.2] - 2019-01-22
14
+
15
+ ### Fixed
16
+ - Fix bug: Rufo indents squiggly HEREDOC incorrectly causing bad formating (issue [136](https://github.com/ruby-formatter/rufo/issues/136))
17
+
18
+ ### Added
19
+
20
+ - Chore: Added ruby 2.6.0 to CI test runs.
21
+
22
+ ## [0.4.1] - 2018-10-27
14
23
 
15
24
  ### Fixed
16
25
  - Fix bug for double colon operator in method definition (issue [#120](https://github.com/ruby-formatter/rufo/issues/120))
data/README.md CHANGED
@@ -120,7 +120,11 @@ so they look good.
120
120
  ### Format files or directories
121
121
 
122
122
  ```
123
- $ rufo file names or dir names
123
+ # All directories (recursive)
124
+ $ rufo .
125
+
126
+ # Specific file or directory
127
+ $ rufo [file or directory name]
124
128
  ```
125
129
 
126
130
  ### Format STDIN
@@ -245,25 +245,32 @@ class Rufo::Formatter
245
245
  if heredoc && tilde && broken_ripper_version?
246
246
  @squiggly_flag = true
247
247
  end
248
- # For heredocs with tilde we sometimes need to align the contents
249
- if heredoc && tilde && @last_was_newline
250
- unless (current_token_value == "\n" ||
251
- current_token_kind == :on_heredoc_end)
252
- write_indent(next_indent)
253
- end
254
- skip_ignored_space
255
- if current_token_kind == :on_tstring_content
256
- check :on_tstring_content
257
- consume_token_value(current_token_value)
258
- next_token
259
- end
248
+ looking_at_newline = current_token_kind == :on_tstring_content && current_token_value == "\n"
249
+ if heredoc && tilde && !@last_was_newline && looking_at_newline
250
+ check :on_tstring_content
251
+ consume_token_value(current_token_value)
252
+ next_token
260
253
  else
261
- while (current_token_kind == :on_ignored_sp) ||
262
- (current_token_kind == :on_tstring_content) ||
263
- (current_token_kind == :on_embexpr_beg)
264
- check current_token_kind
265
- break if current_token_kind == :on_embexpr_beg
266
- consume_token current_token_kind
254
+ # For heredocs with tilde we sometimes need to align the contents
255
+ if heredoc && tilde && @last_was_newline
256
+ unless (current_token_value == "\n" ||
257
+ current_token_kind == :on_heredoc_end)
258
+ write_indent(next_indent)
259
+ end
260
+ skip_ignored_space
261
+ if current_token_kind == :on_tstring_content
262
+ check :on_tstring_content
263
+ consume_token_value(current_token_value)
264
+ next_token
265
+ end
266
+ else
267
+ while (current_token_kind == :on_ignored_sp) ||
268
+ (current_token_kind == :on_tstring_content) ||
269
+ (current_token_kind == :on_embexpr_beg)
270
+ check current_token_kind
271
+ break if current_token_kind == :on_embexpr_beg
272
+ consume_token current_token_kind
273
+ end
267
274
  end
268
275
  end
269
276
  when :string_content
@@ -638,6 +645,8 @@ class Rufo::Formatter
638
645
  return if string.include?("\\")
639
646
  # don't format strings that contain our quote character
640
647
  return if string.include?(quote_char)
648
+ return if string.include?('#{')
649
+ return if string.include?('#$')
641
650
  true
642
651
  end
643
652
 
data/lib/rufo/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rufo
4
- VERSION = "0.4.1"
4
+ VERSION = "0.4.2"
5
5
  end
data/rufo.gemspec CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.require_paths = ["lib"]
23
23
  spec.required_ruby_version = '>= 2.3.5'
24
24
 
25
- spec.add_development_dependency "bundler", "~> 1.15"
25
+ spec.add_development_dependency "bundler", ">= 1.15"
26
26
  spec.add_development_dependency "rake", "~> 10.0"
27
27
  spec.add_development_dependency "rspec", "~> 3.0"
28
28
  spec.add_development_dependency "guard-rspec", "~> 4.0"
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rufo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
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-10-27 00:00:00.000000000 Z
11
+ date: 2019-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.15'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.15'
27
27
  - !ruby/object:Gem::Dependency
@@ -120,8 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  - !ruby/object:Gem::Version
121
121
  version: '0'
122
122
  requirements: []
123
- rubyforge_project:
124
- rubygems_version: 2.7.3
123
+ rubygems_version: 3.0.1
125
124
  signing_key:
126
125
  specification_version: 4
127
126
  summary: Ruby code formatter