Skip to content

Commit d9673a9

Browse files
authored
Merge pull request #8 from zombocom/schneems/error-match
Schneems/error match
2 parents fc920a1 + e42fd4e commit d9673a9

File tree

5 files changed

+20
-3
lines changed

5 files changed

+20
-3
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## HEAD (unreleased)
2+
3+
## 0.1.1
4+
5+
- Fix error message detection to fire on more rubies ()
6+
7+
## 0.1.0
8+
9+
- Initial release

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
syntax_search (0.1.0)
4+
syntax_search (0.1.1)
55
parser
66

77
GEM

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,18 @@ And then execute:
4545

4646
$ bundle install
4747

48+
If your application is not calling `Bundler.require` then you must manually add a require:
49+
50+
```ruby
51+
require "syntax_search/auto"
52+
```
53+
4854
To get the CLI and manually search for syntax errors, install the gem:
4955

5056
$ gem install syntax_search
5157

58+
This gives you the CLI command `$ syntax_search` for more info run `$ syntax_search --help`.
59+
5260
## What does it do?
5361

5462
When your code triggers a SyntaxError due to an "unexpected `end'" in a file, this library fires to narrow down your search to the most likely offending locations.

lib/syntax_search.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Error < StandardError; end
1212
SEARCH_SOURCE_ON_ERROR_DEFAULT = true
1313

1414
def self.handle_error(e, search_source_on_error: SEARCH_SOURCE_ON_ERROR_DEFAULT)
15-
raise e if !e.message.include?("expecting end-of-input")
15+
raise e if !e.message.include?("end-of-input")
1616

1717
filename = e.message.split(":").first
1818

lib/syntax_search/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module SyntaxErrorSearch
4-
VERSION = "0.1.0"
4+
VERSION = "0.1.1"
55
end

0 commit comments

Comments
 (0)