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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 70c669ec0be5be6b79c011236f4f54137d399e4b8be06ead9a20ca2e2ea0f683
4
- data.tar.gz: 6a67aa7cf3cab9a5187911ca40de39f1366ed11e80bee913b32527f5c376fc9f
3
+ metadata.gz: e6c725be18b4e942fa4e7fb13ca015901ceeae450aafe4c00eb27dfffabaf4ed
4
+ data.tar.gz: c9d1d0a62c474d3335fca783889a32610aa436f4e127d96a6aee336569d5ba41
5
5
  SHA512:
6
- metadata.gz: '078dc707335ac5a3b0e9b48054ba308c1d32c91b8ef9d3f5f37c577907e4cd74a121c8a221a5c8a829e762204e2f1a72a6e52090f0fded27b256b892fbdb0d68'
7
- data.tar.gz: b6f84dea9be787d81e0206c11219350ba7113ba53f44d222ceab1b4c0a1f87d98c53d5c0344164a0287f988d7c9fb7d7b22894a63b8573ceb619279a62fe3a2d
6
+ metadata.gz: 97a9eea4051c526be80f2577cc2f835a7e89a1230891f222016ab1f02f490d7d8ed08212bf346ef8505a3a96d378d3f29a7548b03d33cd96211c236206b5cf49
7
+ data.tar.gz: f959023348c68024eef0e0533201c4f4802321ac71b90867f57c56e15f6d3c112589d0dc8892b5a43997c750b0084b15b6c8298df02a9dfba173e561daff49b4
@@ -20,7 +20,11 @@ module SimpleEnglish
20
20
  (first == "-" || !first.start_with?("-"))
21
21
  given_args = ["lint", *given_args]
22
22
  end
23
- super
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 `se serve` and read its output."
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 `se serve` to replace it."
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 `se serve` and read its output."
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 `se serve --detached` to restart it."
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SimpleEnglish
4
- VERSION = "0.4.1"
4
+ VERSION = "0.4.2"
5
5
  end
@@ -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 `se serve` and read its output."
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.1
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-01 00:00:00.000000000 Z
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.1/CHANGELOG.md
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: