lexdrill 0.26.1 → 0.26.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: 1d3dc4600b6ad7303df0b607b7b9ded50b00cf4b3a7ca98e4fa05ca0e1663121
4
- data.tar.gz: 90c8bedb7c4145f633b88506cd190f840ec9f87b5bbc1286803aa264da56eb8d
3
+ metadata.gz: 5def35b24b644705c2d31eb7ba3e4271a9ec1c0d435447891f8dc7215c7c863b
4
+ data.tar.gz: e6b0775b9b40e25b66ba5bf0d63fed476001ab980f5eb9fe9e73222a058c10e8
5
5
  SHA512:
6
- metadata.gz: a3d24e21d27f2b7bfbba4fdd738adce07c6a7006e53334fde2a9e061351c15da86b3e1f7b24e5dc90828e4aa0577af0669eec4d331fa3d36ae1abaa9ba31e998
7
- data.tar.gz: 4558b0d82b02be2c20a7921c741ca066d857f3aa43cdfa006318647dc709757ff360fbba0a0cdafb160254311fb8a43486e491e033a85b8a4ab68260b165039e
6
+ metadata.gz: fdab075aa28e3d06b651a55ba5336fa2b084a3452544a53d51c276dc6b7e8f7ca6c743c0fcfe884eb823a984c42dd865e5a9a96e641289f2142eb1262eb9ab95
7
+ data.tar.gz: fddb514b41a049af0a622bdfc7412aad4438ff75ca0dc3bb7636ba337fa95b0406b7b793c868b58edf22cdf1dc890fe4591d7497f29ea54fe5656a7c1a45cfea
@@ -7,7 +7,7 @@
7
7
  module Lexdrill::ShellSnippet
8
8
  ZSH = <<~SNIPPET
9
9
  drill_precmd() {
10
- [[ -f "$HOME/.drill.disabled" ]] && return
10
+ [[ -f "$HOME/.drill/disabled" || -f "$HOME/.drill.disabled" ]] && return
11
11
  command drill next 2>/dev/null
12
12
  }
13
13
  if [[ -z "${precmd_functions[(r)drill_precmd]}" ]]; then
@@ -24,6 +24,7 @@ module Lexdrill::ShellSnippet
24
24
  # codes).
25
25
  BASH = <<~SNIPPET
26
26
  drill_precmd() {
27
+ [ -f "$HOME/.drill/disabled" ] && return
27
28
  [ -f "$HOME/.drill.disabled" ] && return
28
29
  command drill next >/dev/tty 2>/dev/null
29
30
  }
@@ -6,16 +6,27 @@ require "fileutils"
6
6
  # marker file's presence means stopped.
7
7
  module Lexdrill::Toggle
8
8
  PATH = Lexdrill::Config.path("disabled")
9
+ LEGACY_PATH = File.join(Dir.home, ".drill.disabled")
9
10
 
10
11
  def self.enabled?
11
- !File.exist?(PATH)
12
+ return false if File.exist?(PATH)
13
+ return false if use_legacy? && File.exist?(LEGACY_PATH)
14
+
15
+ true
12
16
  end
13
17
 
14
18
  def self.start
15
19
  FileUtils.rm_f(PATH)
20
+ FileUtils.rm_f(LEGACY_PATH) if use_legacy?
16
21
  end
17
22
 
18
23
  def self.stop
19
24
  File.write(PATH, "")
25
+ File.write(LEGACY_PATH, "") if use_legacy?
26
+ end
27
+
28
+ def self.use_legacy?
29
+ File.join(Dir.home, ".drill.disabled") != LEGACY_PATH || Lexdrill::Config.path("disabled") == PATH
20
30
  end
31
+ private_class_method :use_legacy?
21
32
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Lexdrill
4
- VERSION = "0.26.1"
4
+ VERSION = "0.26.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lexdrill
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.1
4
+ version: 0.26.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Siarhei Kisliak
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-07-16 00:00:00.000000000 Z
11
+ date: 2026-10-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: lexdrill prints a vocabulary word or phrase on demand, tracking how often
14
14
  each one has been shown.