https://github.com/gbaptista/sublime-3-pretty-ruby
Use Ruby PP and RuboCop Autocorrect to indent, format and prettify your Ruby code.
https://github.com/gbaptista/sublime-3-pretty-ruby
Last synced: 2 months ago
JSON representation
Use Ruby PP and RuboCop Autocorrect to indent, format and prettify your Ruby code.
- Host: GitHub
- URL: https://github.com/gbaptista/sublime-3-pretty-ruby
- Owner: gbaptista
- License: mit
- Created: 2015-05-25T19:53:36.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2019-11-18T23:17:06.000Z (almost 6 years ago)
- Last Synced: 2024-10-11T18:58:15.851Z (12 months ago)
- Language: Python
- Homepage: https://packagecontrol.io/packages/Pretty%20Ruby
- Size: 457 KB
- Stars: 13
- Watchers: 3
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pretty Ruby
Use [Ruby PP](http://ruby-doc.org/stdlib-2.0/libdoc/pp/rdoc/PP.html) and [RuboCop Autocorrect](https://github.com/bbatsov/rubocop#autocorrect) to indent, format and prettify your Ruby code.

### Dependencies:
* [Ruby](https://www.ruby-lang.org/)
* [RuboCop](https://github.com/bbatsov/rubocop)`gem install rubocop`
### Command Palette
Pretty Ruby: Format `pretty_ruby_format`
### Default Shortcuts
* Linux: _ctrl + shift + r + p_ `["ctrl+shift+r", "ctrl+shift+p"]`
* Mac: _shift + super + r + p_ `["shift+super+r", "shift+super+p"]`
* Windows: _ctrl + shift + r + p_ `["ctrl+shift+r", "ctrl+shift+p"]`### Custom Shortcuts
`User/Default (Linux).sublime-keymap`:
```python
{ "keys": ["ctrl+shift+h"], "command": "pretty_ruby_format" }
```### Custom Ruby/RuboCop path:
`User/Preferences.sublime-settings`:
```python
// which ruby
"ruby_path": "/home/user/.rvm/rubies/ruby-2.2.2/bin/ruby",// which rubocop
"rubocop_path": "/home/user/.rvm/gems/ruby-2.2.2/bin/rubocop"
```#### RuboCop Problem (RVM): executable hooks
`/usr/bin/env: ruby_executable_hooks: No such file or directory`Use `wrappers` instead of `bin`:
`User/Preferences.sublime-settings`:
```python
// which rubocop
// "rubocop_path": "/home/user/.rvm/gems/ruby-2.2.2/bin/rubocop" // wrong
"rubocop_path": "/home/user/.rvm/gems/ruby-2.2.2/wrappers/rubocop" // correct
```#### Ruby Problem (RVM): /wrappers/ruby: not found
`/bin/sh: 1: /home/user/.rvm/rubies/ruby-2.2.2/wrappers/ruby: not found`Don't use `wrappers` for ruby bin.
`User/Preferences.sublime-settings`:
```python
// which rubocop
// "ruby_path": "/home/user/.rvm/rubies/ruby-2.2.2/wrappers/ruby" // wrong
"ruby_path": "/home/user/.rvm/rubies/ruby-2.2.2/bin/ruby" // correct
```