brandur / json_schema

A JSON Schema V4 and Hyperschema V4 parser and validator.
MIT License
230 stars 45 forks source link

Remove check for filename in validate-schema #118

Closed slhck closed 4 years ago

slhck commented 4 years ago

Per https://github.com/rbenv/rbenv/issues/1178, the validate-schema binary does not work when used as a binstub generated by RubyGems.

The problem has to do with https://github.com/brandur/json_schema/blob/3316dfea3b766df2b505f9214fe41e1b06692009/bin/validate-schema#L29.

The issue is that:

The current script ($0) will not be equal to the current file (__FILE__) because the script would typically be a binstub generated by Rubygems: ~/.rbenv/versions/2.6.3/bin/validate-schema

The script name check therefore makes the script unusable in this case. Since I don't see any obvious benefit from it, I suggest removing the check.