name100-men 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: b76b0fc7b90712e8f849d02c041559d179f99a9f54ad1c4cd5cb4a36f7d5a298
4
+ data.tar.gz: '0429b9266535aab7280bb36403fb1377f9dc2578a0ca603b6334acedc190452a'
5
+ SHA512:
6
+ metadata.gz: 5779a369b0a310f03e746e2e7fcaa2e5ec2452396a5ed15f7e97d877349af98684cce48e000ff39d4b08a9cf810313a0b02d752a14cdb4939c420ad9835cf64a
7
+ data.tar.gz: d587c3a11985eba65c6946bcdb03835c41cc0a2542a9b08989482b46c70c7359834f19b5e8265bc377c9a0105b0f6aa0dfa8bc537af462a25f8d41eb9f59218a
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Name a Hundred
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,39 @@
1
+ # name100-men
2
+
3
+ Terminal companion for the **Name 100 Men** recall challenge on Name a Hundred.
4
+
5
+ Play the full browser game (live Wikidata checks, shareable score):
6
+
7
+ **https://nameahundred.com/men/**
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ gem install name100-men
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ Offline free-recall practice (timer + your own list — no answer key):
18
+
19
+ ```bash
20
+ name100-men
21
+ ```
22
+
23
+ Print the online challenge URL:
24
+
25
+ ```bash
26
+ name100-men --print-url
27
+ ```
28
+
29
+ Open the online challenge in your browser (Windows):
30
+
31
+ ```bash
32
+ name100-men --web
33
+ ```
34
+
35
+ ## Why this exists
36
+
37
+ The Name 100 Men challenge is a blank-list recall quiz: type men's names from memory while a timer runs. This gem is a lightweight practice mode for when you are offline; for the real checked round, use the website.
38
+
39
+ Not affiliated with Wikidata or any Twitch streamer.
data/exe/name100-men ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "name100_men"
5
+
6
+ exit Name100Men::CLI.run(ARGV)
@@ -0,0 +1,87 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "optparse"
4
+ require "time"
5
+
6
+ module Name100Men
7
+ GOAL = 100
8
+
9
+ module CLI
10
+ module_function
11
+
12
+ def run(argv = ARGV)
13
+ options = { web: false, print_url: false }
14
+ parser = OptionParser.new do |opts|
15
+ opts.banner = "Usage: name100-men [options]"
16
+ opts.on("--web", "Print and open the online Name 100 Men challenge") { options[:web] = true }
17
+ opts.on("--print-url", "Print the online challenge URL only") { options[:print_url] = true }
18
+ opts.on("-v", "--version", "Show version") do
19
+ puts Name100Men::VERSION
20
+ exit 0
21
+ end
22
+ end
23
+ parser.parse!(argv)
24
+
25
+ return puts(PLAY_URL) || 0 if options[:print_url]
26
+ return open_web if options[:web]
27
+
28
+ run_practice
29
+ end
30
+
31
+ def open_web
32
+ puts PLAY_URL
33
+ system("start", PLAY_URL) if Gem.win_platform?
34
+ 0
35
+ end
36
+
37
+ def run_practice
38
+ puts "Name 100 Men — offline practice"
39
+ puts "Online (Wikidata-checked): #{PLAY_URL}"
40
+ puts
41
+ puts "Type a man's name and press Enter. Aim for #{GOAL}."
42
+ puts "Empty line = finish. Ctrl+C = quit."
43
+ puts
44
+
45
+ names = []
46
+ seen = {}
47
+ started = Process.clock_gettime(Process::CLOCK_MONOTONIC)
48
+
49
+ loop do
50
+ break if names.length >= GOAL
51
+
52
+ print "[#{names.length}/#{GOAL}] > "
53
+ raw = $stdin.gets
54
+ break if raw.nil?
55
+
56
+ raw = raw.strip
57
+ break if raw.empty?
58
+
59
+ key = raw.downcase
60
+ if seen[key]
61
+ puts " (already listed)"
62
+ next
63
+ end
64
+ seen[key] = true
65
+ names << raw
66
+ end
67
+ rescue Interrupt
68
+ puts
69
+ ensure
70
+ elapsed = Process.clock_gettime(Process::CLOCK_MONOTONIC) - started
71
+ puts
72
+ puts "Named #{names.length} · #{format_elapsed(elapsed)}"
73
+ if names.any?
74
+ puts "Your list:"
75
+ names.each_with_index { |name, i| puts " #{i + 1}. #{name}" }
76
+ end
77
+ puts
78
+ puts "Play the checked round online → #{PLAY_URL}"
79
+ end
80
+
81
+ def format_elapsed(seconds)
82
+ sec = seconds.to_i
83
+ mm, ss = sec.divmod(60)
84
+ mm.positive? ? format("%d:%02d", mm, ss) : "#{ss} sec"
85
+ end
86
+ end
87
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Name100Men
4
+ VERSION = "0.1.0"
5
+ PLAY_URL = "https://nameahundred.com/men/"
6
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "name100_men/version"
4
+ require_relative "name100_men/cli"
5
+
6
+ module Name100Men
7
+ end
metadata ADDED
@@ -0,0 +1,53 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: name100-men
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Name a Hundred
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2026-09-12 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: |
14
+ Practice naming men offline in the terminal, then play the full Wikidata-checked
15
+ Name 100 Men challenge in your browser.
16
+ email:
17
+ - dev-null@nameahundred.com
18
+ executables:
19
+ - name100-men
20
+ extensions: []
21
+ extra_rdoc_files: []
22
+ files:
23
+ - LICENSE
24
+ - README.md
25
+ - exe/name100-men
26
+ - lib/name100_men.rb
27
+ - lib/name100_men/cli.rb
28
+ - lib/name100_men/version.rb
29
+ homepage: https://nameahundred.com/men/
30
+ licenses:
31
+ - MIT
32
+ metadata:
33
+ rubygems_mfa_required: 'true'
34
+ post_install_message:
35
+ rdoc_options: []
36
+ require_paths:
37
+ - lib
38
+ required_ruby_version: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 2.7.0
43
+ required_rubygems_version: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ requirements: []
49
+ rubygems_version: 3.5.22
50
+ signing_key:
51
+ specification_version: 4
52
+ summary: Terminal companion for the Name 100 Men recall challenge.
53
+ test_files: []