ruby/README.md

57 lines
1.6 KiB
Markdown
Raw Permalink Normal View History

2023-09-29 14:32:15 +00:00
# Ruby Starter
A super simple Ruby starter project.
2023-09-30 15:03:36 +00:00
Rubocop and Solargraph are included for linting and code completion,
respectively and are configured to be used with [Zed](https://zed.dev/).
2023-09-29 14:32:15 +00:00
## Prerequisites
- [Ruby](https://www.ruby-lang.org/en/documentation/installation/)
- [Bundler](https://bundler.io/)
- [StandardRB](https://github.com/standardrb/standard)
## Setup
1. Clone this repository
2. Install dependencies: `bundle install`
3. Write awesome code
## Usage with Zed
Zed is a rough-around-the-edges editor in Beta. It's not very configurable yet,
so we're locked into using Solargraph as our language server. Solargraph is
2023-09-30 15:03:36 +00:00
only officially compatible with [Rubocop](https://rubocop.org/) _(ACAB)_ for
linting, but we use our ruleset of choice, StandardRB by configuring it in
`.rubocop.yml`.
2023-09-29 14:32:15 +00:00
For now, make sure that StandardRB is installed globally, as Zed can't yet reach
into your local Gem's, as far as we are aware.
Solargraph is configured in `.solargraph.yml` to use robocop, but to enable
inline diagnostics and formatting on save you must add the following to your Zed
`settings.json`:
```json
{
"lsp": {
"solargraph": {
"initialization_options": {
"diagnostics": true,
"formatting": true,
2023-09-29 14:32:15 +00:00
}
}
}
}
```
## Documentation
If you'd like to generate some user-friendly documentation, you can run
2023-09-30 15:03:36 +00:00
`rake rdoc` on the command line to generate some HTML docs in the `rdoc` directory, made up of your comments and some metadata from your code.
## Testing
An example unit test is included in `test/example_test.rb`. You can run the
tests with `rake test`.