Commit graph

14 commits

Author SHA1 Message Date
Nobuyoshi Nakada
e537aa65c0 [ruby/syntax_suggest] Run with the given ruby command
Running the file with shebang has a few issues.

* shebang is an OS dependent feature. Many modern UNIX-like OSes
  support it, but not all, e.g., Windows.
* `env` command may not be in `/usr/bin`.
* "ruby" command may not be "ruby", when `--program-suffix` or other
  configuration option is used.

2edf241055
2023-01-07 17:02:49 +09:00
Hiroshi SHIBATA
4aeea3cc09 Removed the needless test guard for syntax_suggest.
It's resolved by 5bb43aeb89
2022-12-23 14:07:02 +09:00
Nobuyoshi Nakada
bf3b376522 [ruby/syntax_suggest] Remove debug print
4d53d31bc5
2022-12-23 13:05:26 +09:00
Nobuyoshi Nakada
5bb43aeb89 [ruby/syntax_suggest] Should not hardcode ruby name
0d5201b24d
2022-12-23 13:05:25 +09:00
Hiroshi SHIBATA
93ac1503be Added condition for ruby/ruby repository 2022-12-09 16:36:22 +09:00
Hiroshi SHIBATA
0677bbe3ff Merge syntax_suggest master
Pick from daee74dcb0
2022-12-09 16:36:22 +09:00
Hiroshi SHIBATA
d55d1a737b
Skip examples for SyntaxError extensions on Ruby 3.2 2022-12-02 10:34:00 +09:00
schneems
d6e91784ab Update SyntaxSuggest to use angle brackets >
```
$ ruby tool/sync_default_gems.rb syntax_suggest
Sync ruby/syntax_suggest
```

https://github.com/ruby/syntax_suggest/pull/161
2022-11-30 12:58:47 +09:00
schneems
f64ba0fadd
[ruby/syntax_suggest] Do not output "Syntax OK" when there's an error
Due to a problem with ripper we do not recognize `break` as invalid code. It's confusing that "Syntax OK" is output in that case.

When there's no syntax error, the algorithm should not say anything. The exception is in the CLI and that's for compatibility with `ruby -wc`

```
$ cat /tmp/break.rb
break
️ 3.1.2 🚀 /Users/rschneeman/Documents/projects/syntax_suggest (schneems/no-syntax-not-okay-break)
$ ruby -wc /tmp/break.rb
Syntax OK
```

> Note that this is invalid, running this code will raise a Syntax error.

```
$ exe/syntax_suggest /tmp/break.rb
Syntax OK
```

Close https://github.com/ruby/syntax_suggest/pull/157

d7bd8f03a2
2022-11-28 20:55:41 +09:00
schneems
4d51a0b495
[ruby/syntax_suggest] Failing test for #157
14e8cdc916
2022-11-28 20:55:41 +09:00
Hiroshi SHIBATA
5e4d1f9908 Skip examples to need installed ruby exe 2022-08-26 12:15:47 +09:00
Hiroshi SHIBATA
8dfc077f70 Added syntax_suggest cli and resolve failing exapmle with it 2022-08-26 12:15:47 +09:00
Hiroshi SHIBATA
bd1b1eeb0e ruby-prof is now optional 2022-08-26 12:15:47 +09:00
Hiroshi SHIBATA
0d9f4ea0d4 Import spec examples from ruby/syntax_suggest 2022-08-26 12:15:47 +09:00