syntax_search 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7bc1e7685829016c797af5b036c68d0ba625a3a195c134486ca2852fda4aa339
4
- data.tar.gz: be5bb2c996fe5a4f9762257be2ff93d028ac3c2faa8db1e27c239c56ad65a552
3
+ metadata.gz: 64d391c1ee60a9784b3b53ec9c404739b06dd390d263793795110cdc555bdfb0
4
+ data.tar.gz: 70cbe011308ad0c94c88240e5aadf4e7e024b0f83ff65377b99fe82550779ebc
5
5
  SHA512:
6
- metadata.gz: ab335dbb7813fca47d939f9e88af8f669eddec5a7e773a846f09fe04082982bc59d79b1f8d7a056c3441e79226536161544aada44fd3eabea72d5363303cc616
7
- data.tar.gz: 47c0ccd38ec581c3266001db6028d71d3fdec089e51edc603ca4d3518eae042753b1fb885e9c194dc697b7522ec5aca8ac23447ff58f79755d7f1291fdef26d6
6
+ metadata.gz: 119be89600a50534968502162df65d972a4fe1ecd93a70378e843cbe22effbe0d3f4a7fb12761740efa95152d81bf3a30abc79401cfbff4ba8ad89e9b9390a47
7
+ data.tar.gz: aa93927ba70886754499d263087c89a546d2791b8de3911175e365d7aa111b1d8d659dd3ae015e8297b75b62b9c4e4958c8e9f6c08ac9a4d444f18ccdc7ad8fb
@@ -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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- syntax_search (0.1.0)
4
+ syntax_search (0.1.1)
5
5
  parser
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -10,34 +10,32 @@ What happened? Likely you forgot a `def`, `do`, or maybe you deleted some code a
10
10
 
11
11
  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.
12
12
 
13
- ```
14
- $ syntax_search <path/to/file.rb>
15
-
16
- SyntaxErrorSearch: A syntax error was detected
17
-
18
- This code has an unmatched `end` this is caused by either
19
- missing a syntax keyword (`def`, `do`, etc.) or inclusion
20
- of an extra `end` line
21
-
22
- file: path/to/file.rb
23
- simplified:
24
-
25
- ```
26
- 1 require 'animals'
27
- 2
28
- 10 defdog
29
- 15 end
30
- 16
31
- 20 def cat
32
- 22 end
33
- ```
34
- ```
13
+ $ syntax_search <path/to/file.rb>
14
+
15
+ SyntaxErrorSearch: A syntax error was detected
16
+
17
+ This code has an unmatched `end` this is caused by either
18
+ missing a syntax keyword (`def`, `do`, etc.) or inclusion
19
+ of an extra `end` line
20
+
21
+ file: path/to/file.rb
22
+ simplified:
23
+
24
+ ```
25
+ 1 require 'animals'
26
+ 2
27
+ ❯ 10 defdog
28
+ 15 end
29
+ 16
30
+ 20 def cat
31
+ 22 end
32
+ ```
35
33
 
36
34
  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!
37
35
 
38
36
  ## Installation
39
37
 
40
- Add this line to your application's Gemfile:
38
+ To automatically search syntax errors when they happen, add this to your Gemfile:
41
39
 
42
40
  ```ruby
43
41
  gem 'syntax_search', require: "syntax_search/auto"
@@ -47,10 +45,18 @@ And then execute:
47
45
 
48
46
  $ bundle install
49
47
 
50
- Or install it yourself as:
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
+
54
+ To get the CLI and manually search for syntax errors, install the gem:
51
55
 
52
56
  $ gem install syntax_search
53
57
 
58
+ This gives you the CLI command `$ syntax_search` for more info run `$ syntax_search --help`.
59
+
54
60
  ## What does it do?
55
61
 
56
62
  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.
@@ -12,7 +12,7 @@ module SyntaxErrorSearch
12
12
  SEARCH_SOURCE_ON_ERROR_DEFAULT = true
13
13
 
14
14
  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")
16
16
 
17
17
  filename = e.message.split(":").first
18
18
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SyntaxErrorSearch
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: syntax_search
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - schneems
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-11-10 00:00:00.000000000 Z
11
+ date: 2020-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parser
@@ -37,6 +37,7 @@ files:
37
37
  - ".gitignore"
38
38
  - ".rspec"
39
39
  - ".travis.yml"
40
+ - CHANGELOG.md
40
41
  - CODE_OF_CONDUCT.md
41
42
  - Gemfile
42
43
  - Gemfile.lock
@@ -77,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
77
78
  - !ruby/object:Gem::Version
78
79
  version: '0'
79
80
  requirements: []
80
- rubygems_version: 3.0.3
81
+ rubygems_version: 3.1.4
81
82
  signing_key:
82
83
  specification_version: 4
83
84
  summary: Find syntax errors in your source in a snap