diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..589390b --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,9 @@ +## HEAD (unreleased) + +## 0.1.1 + +- Fix error message detection to fire on more rubies () + +## 0.1.0 + +- Initial release diff --git a/Gemfile.lock b/Gemfile.lock index 5029f2c..6749024 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - syntax_search (0.1.0) + syntax_search (0.1.1) parser GEM diff --git a/README.md b/README.md index 6eb4197..0f3d25e 100644 --- a/README.md +++ b/README.md @@ -45,10 +45,18 @@ And then execute: $ bundle install +If your application is not calling `Bundler.require` then you must manually add a require: + +```ruby +require "syntax_search/auto" +``` + To get the CLI and manually search for syntax errors, install the gem: $ gem install syntax_search +This gives you the CLI command `$ syntax_search` for more info run `$ syntax_search --help`. + ## What does it do? 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. diff --git a/lib/syntax_search.rb b/lib/syntax_search.rb index 2513716..39e5877 100644 --- a/lib/syntax_search.rb +++ b/lib/syntax_search.rb @@ -12,7 +12,7 @@ class Error < StandardError; end SEARCH_SOURCE_ON_ERROR_DEFAULT = true def self.handle_error(e, search_source_on_error: SEARCH_SOURCE_ON_ERROR_DEFAULT) - raise e if !e.message.include?("expecting end-of-input") + raise e if !e.message.include?("end-of-input") filename = e.message.split(":").first diff --git a/lib/syntax_search/version.rb b/lib/syntax_search/version.rb index 18b6e47..b49bfe6 100644 --- a/lib/syntax_search/version.rb +++ b/lib/syntax_search/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module SyntaxErrorSearch - VERSION = "0.1.0" + VERSION = "0.1.1" end