зеркало из https://github.com/github/ruby.git
Added syntax_suggest cli and resolve failing exapmle with it
This commit is contained in:
Родитель
bd1b1eeb0e
Коммит
8dfc077f70
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
require_relative "../lib/syntax_suggest/api"
|
||||
|
||||
SyntaxSuggest::Cli.new(
|
||||
argv: ARGV
|
||||
).call
|
|
@ -5,7 +5,11 @@ require_relative "../spec_helper"
|
|||
module SyntaxSuggest
|
||||
RSpec.describe "exe" do
|
||||
def exe_path
|
||||
root_dir.join("exe").join("syntax_suggest")
|
||||
if ruby_core?
|
||||
root_dir.join("../libexec").join("syntax_suggest")
|
||||
else
|
||||
root_dir.join("exe").join("syntax_suggest")
|
||||
end
|
||||
end
|
||||
|
||||
def exe(cmd)
|
||||
|
|
|
@ -43,6 +43,10 @@ def fixtures_dir
|
|||
spec_dir.join("fixtures")
|
||||
end
|
||||
|
||||
def ruby_core?
|
||||
!root_dir.join("syntax_suggest.gemspec").exist?
|
||||
end
|
||||
|
||||
def code_line_array(source)
|
||||
SyntaxSuggest::CleanDocument.new(source: source).call.lines
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче