iww 0.1.1 → 0.1.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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/CLAUDE.md +84 -0
  3. data/lib/iww/version.rb +1 -1
  4. data/lib/iww.rb +13 -12
  5. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7974e7adfaee8bbab21f62fb3c9c4beee5f3427d44a42338f5678924d46ed032
4
- data.tar.gz: a6011bc2c80d652631480119cd5608aea7b1125a5316ec349a5739f048362bd9
3
+ metadata.gz: c9c2b8ec1cece0a321f8229b4cc543959381e3c6604d800b03a88b60ebd9c544
4
+ data.tar.gz: fa50b1a1f2f79e9660dd6d1bbfbbb198a29c7c6f637ab84e682dfdd214f12ad5
5
5
  SHA512:
6
- metadata.gz: 4a4e1640acbaffb6e223d52390f5a75adef322394f043d983ef2d2d8576431f6d9e567f5ba62e31b18568d015d0733b1bc72e5973981c6a1e863687129a3810d
7
- data.tar.gz: 5ef658055ba42b1af673697c8df022e92ebfbaef6b5de3679de0c40f6d07a837718dcb9010e4c73034f2d8ed5138e8621aced9bf2268b613da1a44a01373d683
6
+ metadata.gz: 250f7a7ff865f1a12f828c74a107d0e65b107672b0ea3afb7718292d2e41448dba9dcd9dd42510120387b84d875b4d60768f8914dc9b2d99a29e4a30ebeda088
7
+ data.tar.gz: 7510914c3123992e9bdc781648bb7b74c38d5a361b9506d5d6533c69a104d8292c1899a83ea6e895806631943e375fad10f87db349f98117294e8ff23b48426c
data/CLAUDE.md ADDED
@@ -0,0 +1,84 @@
1
+ # I.W.W. (iww)
2
+
3
+ Short description
4
+ -----------------
5
+ I.W.W. (iww) is a small Ruby gem that provides convenient access to information and helpers related to the Industrial Workers of the World ("One Big Union"). It exposes a simple API to fetch the preamble, join link, images, job listings, and perform lookup/search of divisions or jobs.
6
+
7
+ Key features
8
+ ------------
9
+ - Access the I.W.W. preamble and join link programmatically
10
+ - Retrieve logos and seal images
11
+ - List jobs and industries represented
12
+ - Lookup divisions, jobs, and perform simple searches
13
+ - Small, dependency-free library with an interactive console for experimentation
14
+
15
+ Installation
16
+ ------------
17
+ Install via Bundler or gem:
18
+
19
+ bundle add iww
20
+
21
+ or
22
+
23
+ gem install iww
24
+
25
+ Usage
26
+ -----
27
+ Require the library and use the top-level Iww API:
28
+
29
+ require 'iww'
30
+
31
+ # get the I.W.W. preamble
32
+ Iww.preamble
33
+
34
+ # open/call the join link (returns URL)
35
+ Iww.join!
36
+
37
+ # fetch images (logos/seal)
38
+ Iww.image
39
+
40
+ # list represented jobs and industries
41
+ Iww.jobs
42
+
43
+ # lookup/search
44
+ Iww[123] # lookup division by number
45
+ Iww['123'] # lookup by string number
46
+ Iww[:job] # lookup by job symbol
47
+ Iww['division'] # lookup by division name
48
+
49
+ Interactive console
50
+ -------------------
51
+ Run the bundled console to experiment with the library:
52
+
53
+ ruby bin/console
54
+
55
+ API overview
56
+ ------------
57
+ - Iww.preamble -> String
58
+ - Iww.join! -> String (URL or link)
59
+ - Iww.image -> Hash or URL(s) for logos/seal
60
+ - Iww.jobs -> Array or Hash of jobs/industries
61
+ - Iww[query] -> Hash mapping division numbers (as strings) to descriptions
62
+
63
+ Examples
64
+ --------
65
+ - Programmatically include the IWW preamble in a website or documentation generator.
66
+ - Build an index of job/industry names for quick lookup in an application.
67
+ - Use Iww[division] to find contact or division descriptions for outreach.
68
+
69
+ Notes
70
+ -----
71
+ - The gem focuses on providing authoritative reference data and simple helpers rather than advanced search features. For richer text search consider combining with a tokenizer or search library.
72
+ - Data and behavior are intentionally straightforward; check the README and source for exact return types in your version.
73
+
74
+ Contributing
75
+ ------------
76
+ Contributions are welcome. Please open issues or PRs; include tests and follow repository guidelines.
77
+
78
+ License
79
+ -------
80
+ This project is licensed under the MIT License. See LICENSE.txt for details.
81
+
82
+ Repository
83
+ ----------
84
+ https://github.com/xorgnak/iww
data/lib/iww/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Iww
4
4
  # current version.
5
- VERSION = "0.1.1"
5
+ VERSION = "0.1.2"
6
6
  end
data/lib/iww.rb CHANGED
@@ -7,11 +7,11 @@ module Iww
7
7
  class Error < StandardError; end # :nodoc:
8
8
 
9
9
  @@LOGO = {
10
- black: %[https://store.iww.org/wp-content/uploads/2019/09/logo-300x300.png],
11
- white: %[https://www.iww.org/images/globe.svg],
12
- red: %[https://www.iww.org/images/iww-globe-red.svg],
13
- cat: %[https://store.iww.org/wp-content/uploads/2019/09/sabo-cat.png],
14
- seal: %[https://www.iww.org/images/entitled-iww-logo-white.svg]
10
+ black: %[https://redcard.iww.org/sites/default/files/iww-logo.png],
11
+ white: %[https://www.iww.org/wp-content/uploads/2023/08/globe-2.svg],
12
+ red: %[https://iww.org.uk/app/uploads/Industrial_Workers_of_the_World-white-red.png],
13
+ cat: %[https://i0.wp.com/www.buckeyemuse.com/wp-content/uploads/2020/10/1024px-Anarchist_black_cat.png?ssl=1],
14
+ seal: %[https://www.iww.org/wp-content/uploads/2023/09/entitled-iww-logo-white.svg]
15
15
  }
16
16
  # images
17
17
  def self.image
@@ -135,15 +135,16 @@ module Iww
135
135
 
136
136
  # job lookup.
137
137
  def self.[] x
138
- if @@MAP.has_key? x.to_s
138
+ xx = x.to_s.downcase
139
+ if @@MAP.has_key? xx
139
140
  o = {}
140
- @@MAP[x.to_s].each { |e| o[e] = @@DIV[e] }
141
+ @@MAP[xx].each { |e| o[e] = @@DIV[e] }
141
142
  return o
142
- elsif @@DIV.has_key? x.to_s
143
- return { x.to_s => @@DIV[x.to_s] }
144
- elsif @@DIV.has_value? x.to_s.capitalize
145
- xx = @@DIV.key(x.to_s.capitalize)
146
- return { xx => x.to_s.capitalize }
143
+ elsif @@DIV.has_key? xx
144
+ return { xx => @@DIV[xx] }
145
+ elsif @@DIV.has_value? xx.to_s.capitalize
146
+ xxx = @@DIV.key(xx.to_s.capitalize)
147
+ return { xxx => xx.to_s.capitalize }
147
148
  else
148
149
  return false
149
150
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iww
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erik Olson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-02-25 00:00:00.000000000 Z
11
+ date: 2026-01-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A helpful ruby library to do union division lookups by job, number, or
14
14
  description.
@@ -19,6 +19,7 @@ extensions: []
19
19
  extra_rdoc_files: []
20
20
  files:
21
21
  - CHANGELOG.md
22
+ - CLAUDE.md
22
23
  - CODE_OF_CONDUCT.md
23
24
  - LICENSE.txt
24
25
  - README.md