[前][次][番号順一覧][スレッド一覧]

ruby-changes:73066

From: Hiroshi <ko1@a...>
Date: Fri, 26 Aug 2022 12:16:10 +0900 (JST)
Subject: [ruby-changes:73066] 8dfc077f70 (master): Added syntax_suggest cli and resolve failing exapmle with it

https://git.ruby-lang.org/ruby.git/commit/?id=8dfc077f70

From 8dfc077f7016715f33b4818ad3e6770d557356a1 Mon Sep 17 00:00:00 2001
From: Hiroshi SHIBATA <hsbt@r...>
Date: Fri, 26 Aug 2022 11:10:15 +0900
Subject: Added syntax_suggest cli and resolve failing exapmle with it

---
 libexec/syntax_suggest                          | 7 +++++++
 spec/syntax_suggest/integration/exe_cli_spec.rb | 6 +++++-
 spec/syntax_suggest/spec_helper.rb              | 4 ++++
 3 files changed, 16 insertions(+), 1 deletion(-)
 create mode 100755 libexec/syntax_suggest

diff --git a/libexec/syntax_suggest b/libexec/syntax_suggest
new file mode 100755
index 0000000000..e4a0b0b658
--- /dev/null
+++ b/libexec/syntax_suggest
@@ -0,0 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/libexec/syntax_suggest#L1
+#!/usr/bin/env ruby
+
+require_relative "../lib/syntax_suggest/api"
+
+SyntaxSuggest::Cli.new(
+  argv: ARGV
+).call
diff --git a/spec/syntax_suggest/integration/exe_cli_spec.rb b/spec/syntax_suggest/integration/exe_cli_spec.rb
index 79e659a27a..f0b49b4386 100644
--- a/spec/syntax_suggest/integration/exe_cli_spec.rb
+++ b/spec/syntax_suggest/integration/exe_cli_spec.rb
@@ -5,7 +5,11 @@ require_relative "../spec_helper" https://github.com/ruby/ruby/blob/trunk/spec/syntax_suggest/integration/exe_cli_spec.rb#L5
 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)
diff --git a/spec/syntax_suggest/spec_helper.rb b/spec/syntax_suggest/spec_helper.rb
index 33f3ef3708..e78dee76bc 100644
--- a/spec/syntax_suggest/spec_helper.rb
+++ b/spec/syntax_suggest/spec_helper.rb
@@ -43,6 +43,10 @@ def fixtures_dir https://github.com/ruby/ruby/blob/trunk/spec/syntax_suggest/spec_helper.rb#L43
   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
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]