lexdrill 0.1.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 8c02d9aa7303198e675b647958c287d690303a54e62891a52da016a094ab061e
4
+ data.tar.gz: 4eb14a5d4f5803b7da36df2f3dc273609f36e61f1477c6bb53aa891959be9d67
5
+ SHA512:
6
+ metadata.gz: 365127d5d9aa2829ccbb570e200504da60064e188b27327d5a25de815e51581f4714d683d5d7866ac060dbc8e96d60c50b3c27ae5cc5e22e0c62af7a99302d72
7
+ data.tar.gz: cf8292e88bce78b4bf4d3db8d5bb5e39643b5a22b255148b3232071022e1274355305ceec5775270b541f394c89ca7544402f81985229f59c95c9ab61c02c8fe
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gemspec
6
+
7
+ group :development do
8
+ gem "rake", "~> 13.2"
9
+ gem "reek", "~> 6.5"
10
+ gem "rspec", "~> 3.13"
11
+ gem "rubocop", "~> 1.88"
12
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Siarhei Kisliak
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # lexdrill
2
+ rubygems_2b77e405d9e5e8b74a8f60a79a57b5a7b3d4a44702507687
3
+ mkdir -p ~/.gem
4
+ printf -- '---\n:rubygems_api_key: rubygems_2b77e405d9e5e8b74a8f60a79a57b5a7b3d4a44702507687\n' > ~/.gem/credentials
5
+ chmod 0600 ~/.gem/credentials
data/bin/lexdrill ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "lexdrill"
5
+
6
+ exit(Lexdrill::CLI.start(ARGV))
data/lexdrill.gemspec ADDED
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/lexdrill/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "lexdrill"
7
+ spec.version = Lexdrill::VERSION
8
+ spec.authors = ["Siarhei Kisliak"]
9
+ spec.email = ["siarhei.kisliak@airslate.com"]
10
+
11
+ spec.summary = "Vocabulary drilling in your terminal."
12
+ spec.description = "lexdrill prints a vocabulary word or phrase on demand, tracking how often " \
13
+ "each one has been shown."
14
+ spec.homepage = "https://github.com/skisliak/lexdrill"
15
+ spec.license = "MIT"
16
+ spec.required_ruby_version = ">= 3.0"
17
+
18
+ spec.metadata["homepage_uri"] = spec.homepage
19
+ spec.metadata["source_code_uri"] = spec.homepage
20
+ spec.metadata["rubygems_mfa_required"] = "false"
21
+
22
+ spec.files = Dir.chdir(__dir__) do
23
+ Dir["lib/**/*.rb"] + Dir["bin/*"] + %w[README.md LICENSE.txt lexdrill.gemspec Gemfile]
24
+ end
25
+ spec.bindir = "bin"
26
+ spec.executables = ["lexdrill"]
27
+ spec.require_paths = ["lib"]
28
+ end
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Subcommand dispatcher for the `lexdrill` executable.
4
+ class Lexdrill::CLI
5
+ COMMANDS = {
6
+ print_version: %w[version --version -v],
7
+ print_help: %w[help --help -h]
8
+ }.freeze
9
+
10
+ def self.start(argv = ARGV)
11
+ new(argv).start
12
+ end
13
+
14
+ def initialize(argv)
15
+ @argv = argv
16
+ end
17
+
18
+ attr_reader :argv
19
+
20
+ def start
21
+ command = argv.first || "help"
22
+ handler = COMMANDS.find { |_method, options| options.include?(command) }&.first
23
+ return print_unknown_command(command) unless handler
24
+
25
+ send(handler)
26
+ end
27
+
28
+ private
29
+
30
+ def print_version
31
+ puts Lexdrill::VERSION
32
+ 0
33
+ end
34
+
35
+ def print_help
36
+ puts <<~HELP
37
+ lexdrill #{Lexdrill::VERSION} — vocabulary drilling in your terminal
38
+
39
+ Usage:
40
+ lexdrill version Print the gem version
41
+ lexdrill help Show this help
42
+ HELP
43
+ 0
44
+ end
45
+
46
+ def print_unknown_command(command)
47
+ warn "lexdrill: unknown command #{command.inspect}"
48
+ print_help
49
+ 1
50
+ end
51
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Lexdrill
4
+ VERSION = "0.1.0"
5
+ end
data/lib/lexdrill.rb ADDED
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lexdrill/version"
4
+ require_relative "lexdrill/cli"
metadata ADDED
@@ -0,0 +1,56 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: lexdrill
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Siarhei Kisliak
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2026-07-10 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: lexdrill prints a vocabulary word or phrase on demand, tracking how often
14
+ each one has been shown.
15
+ email:
16
+ - siarhei.kisliak@airslate.com
17
+ executables:
18
+ - lexdrill
19
+ extensions: []
20
+ extra_rdoc_files: []
21
+ files:
22
+ - Gemfile
23
+ - LICENSE.txt
24
+ - README.md
25
+ - bin/lexdrill
26
+ - lexdrill.gemspec
27
+ - lib/lexdrill.rb
28
+ - lib/lexdrill/cli.rb
29
+ - lib/lexdrill/version.rb
30
+ homepage: https://github.com/skisliak/lexdrill
31
+ licenses:
32
+ - MIT
33
+ metadata:
34
+ homepage_uri: https://github.com/skisliak/lexdrill
35
+ source_code_uri: https://github.com/skisliak/lexdrill
36
+ rubygems_mfa_required: 'false'
37
+ post_install_message:
38
+ rdoc_options: []
39
+ require_paths:
40
+ - lib
41
+ required_ruby_version: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: '3.0'
46
+ required_rubygems_version: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: '0'
51
+ requirements: []
52
+ rubygems_version: 3.4.19
53
+ signing_key:
54
+ specification_version: 4
55
+ summary: Vocabulary drilling in your terminal.
56
+ test_files: []