rufo 0.0.38 → 0.1.0
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 +4 -4
- data/README.md +9 -9
- data/lib/rufo/command.rb +2 -2
- data/lib/rufo/version.rb +1 -1
- data/rufo.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 79ef4a1c02b2ae85e1c35468b779ef931a14ccb6
|
|
4
|
+
data.tar.gz: c6ff325301c90a8840e44301c8547a8a757ef4a9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5b48e1a4c25987a2eceb77b8e4d346afc261cf8a9317be090a36c524a02ed36b66f0e33b0a61fb6e1c7fda4e7df7b57f3076bb4e7a0c2e9375936f686e51b89f
|
|
7
|
+
data.tar.gz: 891eb7a6d97363517b1350ffc9244f257d591f2fa474673555767db95db6709993c6a7de039bc067e814e604d4e13463b1c5d8425c658e542f57b597230417cb
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Rufo
|
|
2
2
|
|
|
3
|
-
[](https://travis-ci.org/ruby-formatter/rufo)
|
|
4
4
|
|
|
5
5
|
**Ru**by **fo**rmatter
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ Rufo's primary use case is as a text-editor plugin, to autoformat files on save
|
|
|
10
10
|
on demand. For this reason it needs to be fast. If the formatter is slow, saving
|
|
11
11
|
a file becomes painful.
|
|
12
12
|
|
|
13
|
-
Right now, Rufo can format it's [formatter](https://github.com/
|
|
13
|
+
Right now, Rufo can format it's [formatter](https://github.com/ruby-formatter/rufo/blob/master/lib/rufo/formatter.rb),
|
|
14
14
|
a 3000+ lines file, in about 290ms. It can format a ~500 lines file in 180ms. Since most files
|
|
15
15
|
have less than 500 lines, the time is acceptable.
|
|
16
16
|
|
|
@@ -102,7 +102,7 @@ If Rufo does not change these things by default, what does it do? Well, it makes
|
|
|
102
102
|
- a trailing newline at the end of the file remains
|
|
103
103
|
|
|
104
104
|
And of course it can be configured to do much more.
|
|
105
|
-
Check the [Settings](https://github.com/
|
|
105
|
+
Check the [Settings](https://github.com/ruby-formatter/rufo/wiki/Settings) section in the [Wiki](https://github.com/ruby-formatter/rufo/wiki) for more details.
|
|
106
106
|
|
|
107
107
|
## Installation
|
|
108
108
|
|
|
@@ -155,7 +155,7 @@ according to **Rufo**, and will exit with exit code 3.
|
|
|
155
155
|
|
|
156
156
|
- Atom: [rufo-atom](https://github.com/bmulvihill/rufo-atom) :construction:
|
|
157
157
|
- Emacs [emacs-rufo](https://github.com/aleandros/emacs-rufo) :construction: or [rufo.el](https://github.com/danielma/rufo.el)
|
|
158
|
-
- Sublime Text: [sublime-rufo](https://github.com/
|
|
158
|
+
- Sublime Text: [sublime-rufo](https://github.com/ruby-formatter/sublime-rufo)
|
|
159
159
|
- Vim: [rufo-vim](https://github.com/splattael/rufo-vim)
|
|
160
160
|
- Visual Studio Code: [rufo-vscode](https://marketplace.visualstudio.com/items?itemName=siliconsenthil.rufo-vscode) or [vscode-rufo](https://marketplace.visualstudio.com/items?itemName=mbessey.vscode-rufo)
|
|
161
161
|
|
|
@@ -174,10 +174,10 @@ pretty annoying if the cursor is reset to the top of the editor.
|
|
|
174
174
|
|
|
175
175
|
You should compute a diff between the old content and new content
|
|
176
176
|
and apply the necessary changes. You can check out how this is done in the
|
|
177
|
-
[Sublime Text plugin for Rufo](https://github.com/
|
|
177
|
+
[Sublime Text plugin for Rufo](https://github.com/ruby-formatter/sublime-rufo):
|
|
178
178
|
|
|
179
|
-
- [diff_match_patch.py](https://github.com/
|
|
180
|
-
- [rufo_format.py](https://github.com/
|
|
179
|
+
- [diff_match_patch.py](https://github.com/ruby-formatter/sublime-rufo/blob/master/diff_match_patch.py) contains the diff algorithm (you can port it to other languages or try to search for a similar algorithm online)
|
|
180
|
+
- [rufo_format.py](https://github.com/ruby-formatter/sublime-rufo/blob/master/rufo_format.py#L46-L53) consumes the diff result and applies it chunk by chunk in the editor's view
|
|
181
181
|
|
|
182
182
|
## Configuration
|
|
183
183
|
|
|
@@ -185,7 +185,7 @@ To configure Rufo, place a `.rufo` file in your project. Then when you format a
|
|
|
185
185
|
Rufo will look for a `.rufo` file in that directory or parent directories and apply the configuration.
|
|
186
186
|
|
|
187
187
|
The `.rufo` file is a Ruby file that is evaluated in the context of the formatter.
|
|
188
|
-
The available settings are listed [here](https://github.com/
|
|
188
|
+
The available settings are listed [here](https://github.com/ruby-formatter/rufo/wiki/Settings).
|
|
189
189
|
|
|
190
190
|
## How it works
|
|
191
191
|
|
|
@@ -211,7 +211,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
|
211
211
|
|
|
212
212
|
## Contributing
|
|
213
213
|
|
|
214
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
|
214
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/ruby-formatter/rufo.
|
|
215
215
|
|
|
216
216
|
## License
|
|
217
217
|
|
data/lib/rufo/command.rb
CHANGED
|
@@ -41,7 +41,7 @@ class Rufo::Command
|
|
|
41
41
|
CODE_ERROR
|
|
42
42
|
rescue => ex
|
|
43
43
|
STDERR.puts "You've found a bug!"
|
|
44
|
-
STDERR.puts "Please report it to https://github.com/
|
|
44
|
+
STDERR.puts "Please report it to https://github.com/ruby-formatter/rufo/issues with code that triggers it"
|
|
45
45
|
STDERR.puts
|
|
46
46
|
raise ex
|
|
47
47
|
end
|
|
@@ -106,7 +106,7 @@ class Rufo::Command
|
|
|
106
106
|
rescue => ex
|
|
107
107
|
STDERR.puts "You've found a bug!"
|
|
108
108
|
STDERR.puts "It happened while trying to format the file #{filename}"
|
|
109
|
-
STDERR.puts "Please report it to https://github.com/
|
|
109
|
+
STDERR.puts "Please report it to https://github.com/ruby-formatter/rufo/issues with code that triggers it"
|
|
110
110
|
STDERR.puts
|
|
111
111
|
raise ex
|
|
112
112
|
end
|
data/lib/rufo/version.rb
CHANGED
data/rufo.gemspec
CHANGED
|
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
|
11
11
|
|
|
12
12
|
spec.summary = %q{Ruby code formatter}
|
|
13
13
|
spec.description = %q{Fast and unobtrusive Ruby code formatter}
|
|
14
|
-
spec.homepage = "https://github.com/
|
|
14
|
+
spec.homepage = "https://github.com/ruby-formatter/rufo"
|
|
15
15
|
spec.license = "MIT"
|
|
16
16
|
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
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.0
|
|
4
|
+
version: 0.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ary Borenszweig
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-07-
|
|
11
|
+
date: 2017-07-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -81,7 +81,7 @@ files:
|
|
|
81
81
|
- rakelib/ci.rake
|
|
82
82
|
- rakelib/rufo.rake
|
|
83
83
|
- rufo.gemspec
|
|
84
|
-
homepage: https://github.com/
|
|
84
|
+
homepage: https://github.com/ruby-formatter/rufo
|
|
85
85
|
licenses:
|
|
86
86
|
- MIT
|
|
87
87
|
metadata: {}
|
|
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
101
101
|
version: '0'
|
|
102
102
|
requirements: []
|
|
103
103
|
rubyforge_project:
|
|
104
|
-
rubygems_version: 2.6.
|
|
104
|
+
rubygems_version: 2.6.11
|
|
105
105
|
signing_key:
|
|
106
106
|
specification_version: 4
|
|
107
107
|
summary: Ruby code formatter
|