simple_english 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/simple_english/cli.rb +6 -2
- data/lib/simple_english/client/daemon.rb +12 -3
- data/lib/simple_english/version.rb +1 -1
- data/lib/simple_english.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e6c725be18b4e942fa4e7fb13ca015901ceeae450aafe4c00eb27dfffabaf4ed
|
|
4
|
+
data.tar.gz: c9d1d0a62c474d3335fca783889a32610aa436f4e127d96a6aee336569d5ba41
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 97a9eea4051c526be80f2577cc2f835a7e89a1230891f222016ab1f02f490d7d8ed08212bf346ef8505a3a96d378d3f29a7548b03d33cd96211c236206b5cf49
|
|
7
|
+
data.tar.gz: f959023348c68024eef0e0533201c4f4802321ac71b90867f57c56e15f6d3c112589d0dc8892b5a43997c750b0084b15b6c8298df02a9dfba173e561daff49b4
|
data/lib/simple_english/cli.rb
CHANGED
|
@@ -20,7 +20,11 @@ module SimpleEnglish
|
|
|
20
20
|
(first == "-" || !first.start_with?("-"))
|
|
21
21
|
given_args = ["lint", *given_args]
|
|
22
22
|
end
|
|
23
|
-
|
|
23
|
+
# Thor's own commands (help, tree) return junk like nil or a
|
|
24
|
+
# Hash, not an exit status. Contract: start always returns an
|
|
25
|
+
# Integer so every caller (bin/se, tests) can exit on it.
|
|
26
|
+
status = super
|
|
27
|
+
status.is_a?(Integer) ? status : 0
|
|
24
28
|
end
|
|
25
29
|
|
|
26
30
|
# The test entry point. It keeps the old module interface.
|
|
@@ -89,7 +93,7 @@ module SimpleEnglish
|
|
|
89
93
|
return 0
|
|
90
94
|
end
|
|
91
95
|
warn "error: detached daemon did not come up. " \
|
|
92
|
-
"Run
|
|
96
|
+
"Run `#{Client.runner} serve` and read its output."
|
|
93
97
|
return 2
|
|
94
98
|
end
|
|
95
99
|
log = options[:"dev-log"] ? File.open(options[:"dev-log"], "w") : $stderr
|
|
@@ -19,6 +19,15 @@ module SimpleEnglish
|
|
|
19
19
|
DEFAULT_PORT = 8181
|
|
20
20
|
REQUEST_TIMEOUT = 30
|
|
21
21
|
|
|
22
|
+
# The executable that daemon advice tells you to run. Resolved
|
|
23
|
+
# from this file, so it names the code that is actually loaded:
|
|
24
|
+
# a checkout names its bin/se, a gem install names its bundled
|
|
25
|
+
# bin/se. $PROGRAM_NAME is wrong for library callers: their host
|
|
26
|
+
# script is not se.
|
|
27
|
+
def runner
|
|
28
|
+
File.expand_path("../../../bin/se", __dir__)
|
|
29
|
+
end
|
|
30
|
+
|
|
22
31
|
def url
|
|
23
32
|
ENV.fetch("SE_SERVER_URL") { "http://localhost:#{DEFAULT_PORT}" }
|
|
24
33
|
end
|
|
@@ -113,7 +122,7 @@ module SimpleEnglish
|
|
|
113
122
|
"It is not restarted automatically."
|
|
114
123
|
else
|
|
115
124
|
warn "se: daemon at #{url} is not a handshake-capable se daemon. " \
|
|
116
|
-
"Run
|
|
125
|
+
"Run `#{runner} serve` to replace it."
|
|
117
126
|
end
|
|
118
127
|
return true
|
|
119
128
|
end
|
|
@@ -151,7 +160,7 @@ module SimpleEnglish
|
|
|
151
160
|
if daemon
|
|
152
161
|
check_daemon(daemon)
|
|
153
162
|
else
|
|
154
|
-
warn "error: se daemon did not come up. Run
|
|
163
|
+
warn "error: se daemon did not come up. Run `#{runner} serve` and read its output."
|
|
155
164
|
false
|
|
156
165
|
end
|
|
157
166
|
end
|
|
@@ -171,7 +180,7 @@ module SimpleEnglish
|
|
|
171
180
|
return
|
|
172
181
|
end
|
|
173
182
|
fix = ENV["SE_SERVER_URL"] ? "It is not restarted automatically." :
|
|
174
|
-
"Run
|
|
183
|
+
"Run `#{runner} serve --detached` to restart it."
|
|
175
184
|
warn "se: daemon at #{url} runs se #{daemon["version"]}, different code than this install " \
|
|
176
185
|
"(#{VERSION}). #{fix} Linting against it meanwhile."
|
|
177
186
|
end
|
data/lib/simple_english.rb
CHANGED
|
@@ -49,7 +49,7 @@ module SimpleEnglish
|
|
|
49
49
|
return nil unless Client.ensure_up(install: Install.from_env)
|
|
50
50
|
result = Client.lint(text, language: language)
|
|
51
51
|
if result.nil?
|
|
52
|
-
warn "error: se daemon did not answer. Run
|
|
52
|
+
warn "error: se daemon did not answer. Run `#{Client.runner} serve` and read its output."
|
|
53
53
|
end
|
|
54
54
|
result
|
|
55
55
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: simple_english
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- TonyCTHsu
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: tree_sitter_language_pack
|
|
@@ -165,7 +165,7 @@ licenses:
|
|
|
165
165
|
metadata:
|
|
166
166
|
homepage_uri: https://github.com/TonyCTHsu/simple-english
|
|
167
167
|
source_code_uri: https://github.com/TonyCTHsu/simple-english
|
|
168
|
-
changelog_uri: https://github.com/TonyCTHsu/simple-english/blob/v0.4.
|
|
168
|
+
changelog_uri: https://github.com/TonyCTHsu/simple-english/blob/v0.4.2/CHANGELOG.md
|
|
169
169
|
post_install_message:
|
|
170
170
|
rdoc_options: []
|
|
171
171
|
require_paths:
|