Skip to content

Commit 2452669

Browse files
committed
Deprecate syntax_search
1 parent e4cc8c0 commit 2452669

36 files changed

+20
-3167
lines changed

CHANGELOG.md

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,5 @@
11
## HEAD (unreleased)
22

3-
- Trailing slashes are now handled (joined) before the code search (https://github.com/zombocom/syntax_search/pull/28)
3+
## 0.2.1
44

5-
## 0.2.0
6-
7-
- Simplify large file output so minimal context around the invalid section is shown (https://github.com/zombocom/syntax_search/pull/26)
8-
- Block expansion is now lexically aware of keywords (def/do/end etc.) (https://github.com/zombocom/syntax_search/pull/24)
9-
- Fix bug where not all of a source is lexed which is used in heredoc detection/removal (https://github.com/zombocom/syntax_search/pull/23)
10-
11-
## 0.1.5
12-
13-
- Strip out heredocs in documents first (https://github.com/zombocom/syntax_search/pull/19)
14-
15-
## 0.1.4
16-
17-
- Parser gem replaced with Ripper (https://github.com/zombocom/syntax_search/pull/17)
18-
19-
## 0.1.3
20-
21-
- Internal refactor (https://github.com/zombocom/syntax_search/pull/13)
22-
23-
## 0.1.2
24-
25-
- Codeblocks in output are now indented with 4 spaces and "code fences" are removed (https://github.com/zombocom/syntax_search/pull/11)
26-
- "Unmatched end" and "missing end" not generate different error text instructions (https://github.com/zombocom/syntax_search/pull/10)
27-
28-
## 0.1.1
29-
30-
- Fire search on both unexpected end-of-input and unexected end (https://github.com/zombocom/syntax_search/pull/8)
31-
32-
## 0.1.0
33-
34-
- Initial release
5+
This gem is moved to the `dead_end` gem. Please use that instead

Gemfile.lock

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
PATH
22
remote: .
33
specs:
4-
syntax_search (0.2.0)
4+
syntax_search (0.2.1)
5+
dead_end (> 0)
56

67
GEM
78
remote: https://rubygems.org/
89
specs:
10+
dead_end (1.0.0)
911
diff-lcs (1.4.4)
1012
rake (12.3.3)
1113
rspec (3.10.0)

exe/syntax_search

Lines changed: 5 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,8 @@
11
#!/usr/bin/env ruby
22

3-
require 'pathname'
4-
require "optparse"
5-
require_relative "../lib/syntax_search.rb"
3+
warn "syntax_search gem is deprecated please use `dead_end` instead"
4+
warn
5+
warn " $ gem install dead_end`"
6+
warn
67

7-
options = {}
8-
options[:terminal] = true
9-
options[:record_dir] = ENV["SYNTAX_SEARCH_RECORD_DIR"]
10-
11-
parser = OptionParser.new do |opts|
12-
opts.banner = <<~EOM
13-
Usage: syntax_search <file> [options]
14-
15-
Parses a ruby source file and searches for syntax error(s) unexpected `end', expecting end-of-input.
16-
17-
Example:
18-
19-
$ syntax_search dog.rb
20-
21-
# ...
22-
23-
```
24-
1 require 'animals'
25-
2
26-
❯ 10 defdog
27-
❯ 15 end
28-
❯ 16
29-
20 def cat
30-
22 end
31-
```
32-
33-
Env options:
34-
35-
SYNTAX_SEARCH_RECORD_DIR=<dir>
36-
37-
When enabled, records the steps used to search for a syntax error to the given directory
38-
39-
Options:
40-
EOM
41-
42-
opts.on("--help", "Help - displays this message") do |v|
43-
puts opts
44-
exit
45-
end
46-
47-
opts.on("--record <dir>", "When enabled, records the steps used to search for a syntax error to the given directory") do |v|
48-
options[:record_dir] = v
49-
end
50-
51-
opts.on("--no-terminal", "Disable terminal highlighting") do |v|
52-
options[:terminal] = false
53-
end
54-
end
55-
parser.parse!
56-
57-
file = ARGV[0]
58-
59-
if file.nil? || file.empty?
60-
# Display help if raw command
61-
parser.parse! %w[--help]
62-
end
63-
64-
file = Pathname(file)
65-
options[:record_dir] = "tmp" if ENV["DEBUG"]
66-
67-
$stderr.puts "Record dir: #{options[:record_dir]}" if options[:record_dir]
68-
69-
SyntaxErrorSearch.call(
70-
source: file.read,
71-
filename: file.expand_path,
72-
terminal: options[:terminal],
73-
record_dir: options[:record_dir]
74-
)
8+
exit 1

lib/syntax_search.rb

Lines changed: 0 additions & 153 deletions
This file was deleted.

0 commit comments

Comments
 (0)