Skip to content

README #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 22 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,32 @@ What happened? Likely you forgot a `def`, `do`, or maybe you deleted some code a

What if I told you, that there was a library that helped find your missing `def`s and missing `do`s. What if instead of searching through hundreds of lines of source for the cause of your syntax error, there was a way to highlight just code in the file that contained syntax errors.

```
$ syntax_search <path/to/file.rb>

SyntaxErrorSearch: A syntax error was detected

This code has an unmatched `end` this is caused by either
missing a syntax keyword (`def`, `do`, etc.) or inclusion
of an extra `end` line

file: path/to/file.rb
simplified:

```
1 require 'animals'
2
❯ 10 defdog
❯ 15 end
❯ 16
20 def cat
22 end
```
```
$ syntax_search <path/to/file.rb>

SyntaxErrorSearch: A syntax error was detected

This code has an unmatched `end` this is caused by either
missing a syntax keyword (`def`, `do`, etc.) or inclusion
of an extra `end` line

file: path/to/file.rb
simplified:

```
1 require 'animals'
2
❯ 10 defdog
❯ 15 end
❯ 16
20 def cat
22 end
```

How much would you pay for such a library? A million, a billion, a trillion? Well friends, today is your lucky day because you can use this library today for free!

## Installation

Add this line to your application's Gemfile:
To automatically search syntax errors when they happen, add this to your Gemfile:

```ruby
gem 'syntax_search', require: "syntax_search/auto"
Expand All @@ -47,7 +45,7 @@ And then execute:

$ bundle install

Or install it yourself as:
To get the CLI and manually search for syntax errors, install the gem:

$ gem install syntax_search

Expand Down