iww 0.1.1 → 0.1.3
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 +4 -4
- data/CLAUDE.md +84 -0
- data/lib/iww/version.rb +1 -1
- data/lib/iww.rb +13 -12
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7bc2c0872c301e06b53991b8dd6194733fc247dcf3e6473226f22528fa26af02
|
|
4
|
+
data.tar.gz: a7d267ed33f9732bf323d5ed2096bd4269696942cd854b4b87a9265242c606b9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1bf39cccc5a8ce9071f45e04286b1806c41b0ebca46edf612849806808a07ff2b6e6fe399c5d723ffe05b82b57c2e24a481a72b6fa6fc1cf2bf79216a7d3b304
|
|
7
|
+
data.tar.gz: ddf42e48034ef89c41c76182975b621a898719379349b6bffea60f47c1aaa472b8d66d875091ae951085a5d1a7287179192477a11a6e3ec47bd3fc9239bd5188
|
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
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://
|
|
11
|
-
white: %[https://www.iww.org/
|
|
12
|
-
red: %[https://
|
|
13
|
-
cat: %[https://
|
|
14
|
-
seal: %[https://www.iww.org/
|
|
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
|
-
|
|
138
|
+
xx = x.to_s.downcase
|
|
139
|
+
if @@MAP.has_key? xx
|
|
139
140
|
o = {}
|
|
140
|
-
@@MAP[
|
|
141
|
+
@@MAP[xx].each { |e| o[e] = @@DIV[e] }
|
|
141
142
|
return o
|
|
142
|
-
elsif @@DIV.has_key?
|
|
143
|
-
return {
|
|
144
|
-
elsif @@DIV.has_value?
|
|
145
|
-
|
|
146
|
-
return {
|
|
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.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Erik Olson
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
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
|