Ruby
- Files
.rb- Formats as
- RuboCop
- Lints
- Every rule that reads its code
- In
ur.toml [format.ruby]
Formatted
cart.rb, as written# What a cart costs.
def subtotal(items)
items.sum { |item| item.price*item.quantity }
end
def label(item) = item.name+" x"+item.quantity.to_s
ur format --style rubocop cart.rb# What a cart costs.
def subtotal(items)
items.sum { |item| item.price * item.quantity }
end
def label(item) = item.name + " x" + item.quantity.to_s
Versions
Ur reads Ruby as the profiles below name it. Name the versions a project targets in target; without it, Ur reads ruby-4.0.
| Profile | Dialect |
|---|---|
ruby-3.3 | CRuby |
ruby-3.4 | CRuby |
ruby-4.0 | CRuby |