csg_chamorro 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 +7 -0
- data/LICENSE.txt +22 -0
- data/README.md +420 -0
- data/Rakefile +35 -0
- data/bin/csg_chamorro +93 -0
- data/csg_chamorro.gemspec +31 -0
- data/lib/csg_chamorro/version.rb +6 -0
- data/lib/csg_chamorro.rb +140 -0
- metadata +67 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 7acea0af1e10398563e63235af39779baa15e2a998266a9d1c28e17820b76086
|
|
4
|
+
data.tar.gz: 53a14671ab42321741168cc506a8c97cd4bcc10745de2cfe0721feca36de9ee3
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 998afc74c84b01890e8f8ea70a037d2c701623b97253a2d76b082e4cc78033203fd892d3eba4da43549c6c0a4d85a7d263ecfabd465f8cfd05ed2568515c91d0
|
|
7
|
+
data.tar.gz: e8dd730afa177d220221c8300643530d95313c44057219b61ddc372132c168d91774bb8adaf949368699376278f07c4075502705522a7018b52163bda2c68dfb
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Code School of Guam
|
|
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.
|
|
22
|
+
|
data/README.md
ADDED
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
# CSG Chamorro 🌴
|
|
2
|
+
|
|
3
|
+
Learn Chamorro words and phrases with your Ruby projects! A gem built by Code School of Guam students to preserve and share the Chamorro language.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
- [Why This Gem?](#why-this-gem)
|
|
7
|
+
- [What's Included](#whats-included)
|
|
8
|
+
- [Project Structure](#-project-structure)
|
|
9
|
+
- [Installation](#installation)
|
|
10
|
+
- [Usage](#usage)
|
|
11
|
+
- [Examples](#examples)
|
|
12
|
+
- [Testing Locally](#-testing-locally-for-developers)
|
|
13
|
+
- [Development](#development)
|
|
14
|
+
- [Contributing](#contributing)
|
|
15
|
+
- [Publishing](#-publishing-to-rubygemsorg-optional)
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Why This Gem?
|
|
20
|
+
|
|
21
|
+
The Chamorro language is an important part of Guam's cultural heritage. This gem helps:
|
|
22
|
+
- **Preserve** the language through technology
|
|
23
|
+
- **Share** Chamorro words with developers worldwide
|
|
24
|
+
- **Learn** basic Chamorro phrases in an accessible way
|
|
25
|
+
- **Integrate** language learning into daily development work
|
|
26
|
+
|
|
27
|
+
## What's Included
|
|
28
|
+
|
|
29
|
+
The gem includes **12 common Chamorro words and phrases**:
|
|
30
|
+
|
|
31
|
+
1. **Håfa Adai** - Hello
|
|
32
|
+
2. **Si Yu'os Ma'åse'** - Thank you
|
|
33
|
+
3. **Inafa'maolek** - Harmony/To make good
|
|
34
|
+
4. **Biba** - Long live/Hurray
|
|
35
|
+
5. **Hågat** - Hello (casual)
|
|
36
|
+
6. **Adios** - Goodbye
|
|
37
|
+
7. **Pågo** - Now
|
|
38
|
+
8. **Guåhan** - Guam
|
|
39
|
+
9. **I Manåmko'** - The elders
|
|
40
|
+
10. **Nåna** - Mother
|
|
41
|
+
11. **Tåta** - Father
|
|
42
|
+
12. **Hafa tatatmanu hao?** - How are you?
|
|
43
|
+
|
|
44
|
+
Each word includes:
|
|
45
|
+
- Chamorro spelling
|
|
46
|
+
- English translation
|
|
47
|
+
- Pronunciation guide
|
|
48
|
+
- Usage context
|
|
49
|
+
- Example sentence
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## 📁 Project Structure
|
|
54
|
+
|
|
55
|
+
Understanding what each file and folder does:
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
csg_chamorro/
|
|
59
|
+
├── lib/ ← Your Ruby code lives here
|
|
60
|
+
│ ├── csg_chamorro.rb ← Main file with all the methods
|
|
61
|
+
│ └── csg_chamorro/
|
|
62
|
+
│ └── version.rb ← Just the version number (0.1.0)
|
|
63
|
+
│
|
|
64
|
+
├── bin/ ← Executable command-line tools
|
|
65
|
+
│ └── csg_chamorro ← The CLI script (runs when you type 'csg_chamorro')
|
|
66
|
+
│
|
|
67
|
+
├── test/ ← Automated tests
|
|
68
|
+
│ └── csg_chamorro_test.rb ← Tests all the methods work correctly
|
|
69
|
+
│
|
|
70
|
+
├── csg_chamorro.gemspec ← Gem metadata (name, version, description, etc.)
|
|
71
|
+
├── Gemfile ← Lists dependencies (what other gems this needs)
|
|
72
|
+
├── Gemfile.lock ← Locks exact versions of dependencies
|
|
73
|
+
├── Rakefile ← Defines tasks you can run (rake word, rake list, etc.)
|
|
74
|
+
├── README.md ← Documentation (this file!)
|
|
75
|
+
└── LICENSE.txt ← MIT License (how others can use your code)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### What Each Folder Does:
|
|
79
|
+
|
|
80
|
+
**`lib/`** - The main code
|
|
81
|
+
- This is where your actual Ruby code lives
|
|
82
|
+
- `lib/csg_chamorro.rb` is the "entry point" - it's what runs when someone does `require 'csg_chamorro'`
|
|
83
|
+
- `lib/csg_chamorro/version.rb` stores the version number
|
|
84
|
+
- Ruby convention: main file name matches the gem name
|
|
85
|
+
|
|
86
|
+
**`bin/`** - Command-line executables
|
|
87
|
+
- Contains scripts that users can run from the terminal
|
|
88
|
+
- `bin/csg_chamorro` is the CLI tool
|
|
89
|
+
- After installing the gem, typing `csg_chamorro` in terminal runs this file
|
|
90
|
+
- Must start with `#!/usr/bin/env ruby` (tells system to run it with Ruby)
|
|
91
|
+
|
|
92
|
+
**`test/`** - Automated tests
|
|
93
|
+
- Contains test files that verify your code works
|
|
94
|
+
- `test/csg_chamorro_test.rb` has 11 tests
|
|
95
|
+
- Run with: `ruby test/csg_chamorro_test.rb`
|
|
96
|
+
- Uses Minitest framework (comes with Ruby)
|
|
97
|
+
|
|
98
|
+
### What Each File Does:
|
|
99
|
+
|
|
100
|
+
**`csg_chamorro.gemspec`** - Gem specification
|
|
101
|
+
- Tells RubyGems everything about your gem
|
|
102
|
+
- Name, version, authors, description
|
|
103
|
+
- What files to include in the gem package
|
|
104
|
+
- What dependencies it needs
|
|
105
|
+
- Required for building the gem
|
|
106
|
+
|
|
107
|
+
**`Gemfile`** - Dependency management
|
|
108
|
+
- Lists gems your project depends on
|
|
109
|
+
- In our case, just says `gemspec` (use dependencies from .gemspec)
|
|
110
|
+
- Run `bundle install` to install dependencies
|
|
111
|
+
- Creates `Gemfile.lock` with exact versions
|
|
112
|
+
|
|
113
|
+
**`Rakefile`** - Task definitions
|
|
114
|
+
- Defines shortcuts for common tasks
|
|
115
|
+
- `rake word` - print a random word
|
|
116
|
+
- `rake list` - list all words
|
|
117
|
+
- `rake test` - run tests
|
|
118
|
+
- `rake version` - show version
|
|
119
|
+
- Like npm scripts, but for Ruby
|
|
120
|
+
|
|
121
|
+
**`README.md`** - Documentation
|
|
122
|
+
- First thing people see on GitHub
|
|
123
|
+
- Explains what the gem does
|
|
124
|
+
- Shows how to install and use it
|
|
125
|
+
- Includes examples
|
|
126
|
+
|
|
127
|
+
**`LICENSE.txt`** - Legal stuff
|
|
128
|
+
- MIT License (very permissive)
|
|
129
|
+
- Says others can use, modify, and share your code
|
|
130
|
+
- Required if you publish to RubyGems.org
|
|
131
|
+
|
|
132
|
+
## Installation
|
|
133
|
+
|
|
134
|
+
> **Note:** This gem is not yet published to RubyGems.org. This is a learning/reference project.
|
|
135
|
+
> To use it, follow the "Testing Locally" section below, or publish it yourself!
|
|
136
|
+
|
|
137
|
+
**If this were published to RubyGems.org, users would install it with:**
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
gem install csg_chamorro
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Or add to their Gemfile:
|
|
144
|
+
|
|
145
|
+
```ruby
|
|
146
|
+
gem 'csg_chamorro'
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
**Want to publish it?** See the "Publishing to RubyGems.org" section at the bottom!
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Usage
|
|
154
|
+
|
|
155
|
+
### In Ruby
|
|
156
|
+
|
|
157
|
+
```ruby
|
|
158
|
+
require 'csg_chamorro'
|
|
159
|
+
|
|
160
|
+
# Get a random Chamorro word
|
|
161
|
+
word = CSGChamorro.word_of_day
|
|
162
|
+
puts word[:chamorro] # => "Håfa Adai"
|
|
163
|
+
puts word[:english] # => "Hello"
|
|
164
|
+
puts word[:pronunciation] # => "half-a-day"
|
|
165
|
+
|
|
166
|
+
# Get a nicely formatted word
|
|
167
|
+
puts CSGChamorro.pretty
|
|
168
|
+
# =>
|
|
169
|
+
# 📚 Chamorro Word of the Day
|
|
170
|
+
#
|
|
171
|
+
# Chamorro: Håfa Adai
|
|
172
|
+
# English: Hello
|
|
173
|
+
# Pronunciation: half-a-day
|
|
174
|
+
# Usage: Traditional Chamorro greeting used throughout the day
|
|
175
|
+
# Example: "Håfa Adai! Welcome to Guam!"
|
|
176
|
+
|
|
177
|
+
# Get all words
|
|
178
|
+
all_words = CSGChamorro.all_words # => Array of 12 words
|
|
179
|
+
|
|
180
|
+
# Count total words
|
|
181
|
+
CSGChamorro.count # => 12
|
|
182
|
+
|
|
183
|
+
# Search for a word
|
|
184
|
+
results = CSGChamorro.search("thank")
|
|
185
|
+
# => [{chamorro: "Si Yu'os Ma'åse'", english: "Thank you", ...}]
|
|
186
|
+
|
|
187
|
+
# Get a random greeting
|
|
188
|
+
greeting = CSGChamorro.random_greeting
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Command Line
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
# Random word of the day
|
|
195
|
+
csg_chamorro
|
|
196
|
+
# => Håfa Adai - Hello
|
|
197
|
+
|
|
198
|
+
# Formatted output
|
|
199
|
+
csg_chamorro --pretty
|
|
200
|
+
# => Full formatted output with pronunciation and example
|
|
201
|
+
|
|
202
|
+
# Show all words
|
|
203
|
+
csg_chamorro --all
|
|
204
|
+
|
|
205
|
+
# Count words
|
|
206
|
+
csg_chamorro --count
|
|
207
|
+
# => Total Chamorro words: 12
|
|
208
|
+
|
|
209
|
+
# Get a random greeting
|
|
210
|
+
csg_chamorro --greeting
|
|
211
|
+
|
|
212
|
+
# Search for a word
|
|
213
|
+
csg_chamorro --search "hello"
|
|
214
|
+
|
|
215
|
+
# Help
|
|
216
|
+
csg_chamorro --help
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## Examples
|
|
222
|
+
|
|
223
|
+
### Daily Motivation Bot
|
|
224
|
+
|
|
225
|
+
```ruby
|
|
226
|
+
require 'csg_chamorro'
|
|
227
|
+
|
|
228
|
+
# Print a Chamorro word every time you open your terminal
|
|
229
|
+
# Add to your ~/.zshrc or ~/.bashrc:
|
|
230
|
+
# ruby -e "require 'csg_chamorro'; puts CSGChamorro.pretty"
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Slack Bot
|
|
234
|
+
|
|
235
|
+
```ruby
|
|
236
|
+
require 'csg_chamorro'
|
|
237
|
+
|
|
238
|
+
# Send a Chamorro word to your team Slack
|
|
239
|
+
word = CSGChamorro.word_of_day
|
|
240
|
+
message = "🌴 Chamorro Word of the Day: #{word[:chamorro]} (#{word[:english]})\n" \
|
|
241
|
+
"Pronunciation: #{word[:pronunciation]}\n" \
|
|
242
|
+
"#{word[:usage]}"
|
|
243
|
+
# send_to_slack(message)
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### Learning App
|
|
247
|
+
|
|
248
|
+
```ruby
|
|
249
|
+
require 'csg_chamorro'
|
|
250
|
+
|
|
251
|
+
# Quiz yourself on Chamorro words
|
|
252
|
+
word = CSGChamorro.word_of_day
|
|
253
|
+
puts "What does '#{word[:chamorro]}' mean?"
|
|
254
|
+
# ... get user input ...
|
|
255
|
+
puts word[:english]
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## 🧪 Testing Locally (For Developers)
|
|
261
|
+
|
|
262
|
+
Want to test this gem before installing? Here's how:
|
|
263
|
+
|
|
264
|
+
### Quick Test in IRB
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
# Navigate to the gem folder
|
|
268
|
+
cd csg_chamorro
|
|
269
|
+
|
|
270
|
+
# Open IRB and load the gem
|
|
271
|
+
irb -r ./lib/csg_chamorro.rb
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
Then test the methods:
|
|
275
|
+
```ruby
|
|
276
|
+
CSGChamorro.word_of_day
|
|
277
|
+
CSGChamorro.pretty
|
|
278
|
+
CSGChamorro.search("hello")
|
|
279
|
+
CSGChamorro.random_greeting
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### Run the Tests
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
ruby test/csg_chamorro_test.rb
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
Should see: `11 runs, 15 assertions, 0 failures`
|
|
289
|
+
|
|
290
|
+
### Test Rake Tasks
|
|
291
|
+
|
|
292
|
+
```bash
|
|
293
|
+
bundle install # First time only
|
|
294
|
+
rake word # Random word
|
|
295
|
+
rake list # All words
|
|
296
|
+
rake version # Show version
|
|
297
|
+
rake test # Run tests
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
### Build & Install Locally
|
|
301
|
+
|
|
302
|
+
```bash
|
|
303
|
+
# Build the gem
|
|
304
|
+
gem build csg_chamorro.gemspec
|
|
305
|
+
# Creates: csg_chamorro-0.1.0.gem
|
|
306
|
+
|
|
307
|
+
# Install it
|
|
308
|
+
gem install ./csg_chamorro-0.1.0.gem
|
|
309
|
+
|
|
310
|
+
# Test it works
|
|
311
|
+
csg_chamorro --pretty
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
---
|
|
315
|
+
|
|
316
|
+
## Development
|
|
317
|
+
|
|
318
|
+
After checking out the repo:
|
|
319
|
+
|
|
320
|
+
```bash
|
|
321
|
+
bundle install
|
|
322
|
+
bundle exec rake -T # See available tasks
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
Run tests:
|
|
326
|
+
```bash
|
|
327
|
+
ruby test/csg_chamorro_test.rb
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
Build and install locally:
|
|
331
|
+
```bash
|
|
332
|
+
gem build csg_chamorro.gemspec
|
|
333
|
+
gem install ./csg_chamorro-0.1.0.gem
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
## Contributing
|
|
337
|
+
|
|
338
|
+
We welcome contributions! To add more Chamorro words:
|
|
339
|
+
|
|
340
|
+
1. Fork the repository
|
|
341
|
+
2. Add words to `WORDS` array in `lib/csg_chamorro.rb`
|
|
342
|
+
3. Follow the existing format (chamorro, english, pronunciation, usage, example)
|
|
343
|
+
4. Submit a pull request
|
|
344
|
+
|
|
345
|
+
## About Chamorro Language
|
|
346
|
+
|
|
347
|
+
Chamorro is the indigenous language of the Mariana Islands (Guam and Northern Mariana Islands). It's a vital part of the island's cultural identity and is actively preserved through education and community programs.
|
|
348
|
+
|
|
349
|
+
**Resources for learning more:**
|
|
350
|
+
- [Guampedia](https://www.guampedia.com/)
|
|
351
|
+
- [Chamorro Language & Culture](https://www.chamoru.info/)
|
|
352
|
+
- [University of Guam Chamorro Studies](https://www.uog.edu/)
|
|
353
|
+
|
|
354
|
+
## 🚀 Publishing to RubyGems.org (Optional)
|
|
355
|
+
|
|
356
|
+
Want to share this gem with the world? Here's how to publish it:
|
|
357
|
+
|
|
358
|
+
### Step 1: Create a RubyGems.org Account
|
|
359
|
+
- Go to [rubygems.org](https://rubygems.org)
|
|
360
|
+
- Sign up (it's free!)
|
|
361
|
+
- Verify your email
|
|
362
|
+
|
|
363
|
+
### Step 2: Get Your API Key
|
|
364
|
+
```bash
|
|
365
|
+
gem signin
|
|
366
|
+
# Enter your rubygems.org credentials
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
### Step 3: Build Your Gem
|
|
370
|
+
```bash
|
|
371
|
+
gem build csg_chamorro.gemspec
|
|
372
|
+
# Creates: csg_chamorro-0.1.0.gem
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
### Step 4: Push to RubyGems
|
|
376
|
+
```bash
|
|
377
|
+
gem push csg_chamorro-0.1.0.gem
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
You'll see:
|
|
381
|
+
```
|
|
382
|
+
Pushing gem to https://rubygems.org...
|
|
383
|
+
Successfully registered gem: csg_chamorro (0.1.0)
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
### Step 5: Verify It's Live
|
|
387
|
+
- Visit `https://rubygems.org/gems/csg_chamorro`
|
|
388
|
+
- Try installing: `gem install csg_chamorro`
|
|
389
|
+
|
|
390
|
+
**Now anyone in the world can use your gem!** 🌍
|
|
391
|
+
|
|
392
|
+
### Updating Your Gem
|
|
393
|
+
|
|
394
|
+
When you make changes:
|
|
395
|
+
1. Update version in `lib/csg_chamorro/version.rb` (e.g., `0.1.0` → `0.1.1`)
|
|
396
|
+
2. Rebuild: `gem build csg_chamorro.gemspec`
|
|
397
|
+
3. Push: `gem push csg_chamorro-0.1.1.gem`
|
|
398
|
+
|
|
399
|
+
---
|
|
400
|
+
|
|
401
|
+
## Built by Code School of Guam 🌴
|
|
402
|
+
|
|
403
|
+
This gem was created as a learning project by students at Code School of Guam to:
|
|
404
|
+
- Learn Ruby gem development
|
|
405
|
+
- Practice version control and collaboration
|
|
406
|
+
- Contribute to cultural preservation
|
|
407
|
+
- Build portfolio-worthy projects
|
|
408
|
+
|
|
409
|
+
Learn more at https://codeschoolofguam.com
|
|
410
|
+
|
|
411
|
+
## License
|
|
412
|
+
|
|
413
|
+
MIT License - see LICENSE.txt
|
|
414
|
+
|
|
415
|
+
## Si Yu'os Ma'åse' (Thank You!)
|
|
416
|
+
|
|
417
|
+
Thank you for helping preserve and share the Chamorro language through technology! 🌴
|
|
418
|
+
|
|
419
|
+
**Biba Guåhan!** (Long live Guam!)
|
|
420
|
+
|
data/Rakefile
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "rake"
|
|
4
|
+
|
|
5
|
+
# Task: Print a random Chamorro word with details
|
|
6
|
+
desc "Print a random Chamorro word"
|
|
7
|
+
task :word do
|
|
8
|
+
require_relative "lib/csg_chamorro"
|
|
9
|
+
puts CSGChamorro.pretty
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
# Task: List all words with their English translations
|
|
13
|
+
desc "List all Chamorro words"
|
|
14
|
+
task :list do
|
|
15
|
+
require_relative "lib/csg_chamorro"
|
|
16
|
+
puts "\n📚 All Chamorro Words:\n"
|
|
17
|
+
CSGChamorro.all_words.each_with_index do |word, i|
|
|
18
|
+
puts "#{i + 1}. #{word[:chamorro]} - #{word[:english]}"
|
|
19
|
+
end
|
|
20
|
+
puts
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# Task: Show the gem version
|
|
24
|
+
desc "Show gem version"
|
|
25
|
+
task :version do
|
|
26
|
+
require_relative "lib/csg_chamorro/version"
|
|
27
|
+
puts "CSGChamorro v#{CSGChamorro::VERSION}"
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Task: Run all tests
|
|
31
|
+
desc "Run tests"
|
|
32
|
+
task :test do
|
|
33
|
+
ruby "test/csg_chamorro_test.rb"
|
|
34
|
+
end
|
|
35
|
+
|
data/bin/csg_chamorro
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
require "optparse"
|
|
5
|
+
require_relative "../lib/csg_chamorro"
|
|
6
|
+
|
|
7
|
+
# Hash to store which options the user selected
|
|
8
|
+
options = {}
|
|
9
|
+
|
|
10
|
+
# OptionParser reads the command-line flags
|
|
11
|
+
OptionParser.new do |opts|
|
|
12
|
+
opts.banner = "Usage: csg_chamorro [options]"
|
|
13
|
+
|
|
14
|
+
# --pretty flag: show formatted output
|
|
15
|
+
opts.on("--pretty", "Print a nicely formatted word") do
|
|
16
|
+
options[:pretty] = true
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# --all flag: list all words
|
|
20
|
+
opts.on("--all", "Show all Chamorro words") do
|
|
21
|
+
options[:all] = true
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# --count flag: show total number of words
|
|
25
|
+
opts.on("--count", "Show total number of words") do
|
|
26
|
+
options[:count] = true
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# --greeting flag: show a random greeting
|
|
30
|
+
opts.on("--greeting", "Get a random Chamorro greeting") do
|
|
31
|
+
options[:greeting] = true
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# --search flag: search for a word (takes an argument)
|
|
35
|
+
opts.on("--search TERM", "Search for a word by Chamorro or English") do |term|
|
|
36
|
+
options[:search] = term
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# -h or --help flag: show help
|
|
40
|
+
opts.on("-h", "--help", "Show this help message") do
|
|
41
|
+
puts opts
|
|
42
|
+
exit
|
|
43
|
+
end
|
|
44
|
+
end.parse!
|
|
45
|
+
|
|
46
|
+
# Determine which command to run based on the flags
|
|
47
|
+
if options[:all]
|
|
48
|
+
# Show all words with their pronunciations
|
|
49
|
+
puts "\n📚 All Chamorro Words (#{CSGChamorro.count} total):\n"
|
|
50
|
+
CSGChamorro.all_words.each_with_index do |word, i|
|
|
51
|
+
puts "\n#{i + 1}. #{word[:chamorro]} - #{word[:english]}"
|
|
52
|
+
puts " Pronunciation: #{word[:pronunciation]}"
|
|
53
|
+
end
|
|
54
|
+
puts
|
|
55
|
+
|
|
56
|
+
elsif options[:count]
|
|
57
|
+
# Just show the count
|
|
58
|
+
puts "Total Chamorro words: #{CSGChamorro.count}"
|
|
59
|
+
|
|
60
|
+
elsif options[:greeting]
|
|
61
|
+
# Show a random greeting
|
|
62
|
+
greeting = CSGChamorro.random_greeting
|
|
63
|
+
puts "\n🌴 Chamorro Greeting:\n"
|
|
64
|
+
puts "#{greeting[:chamorro]} - #{greeting[:english]}"
|
|
65
|
+
puts "Pronunciation: #{greeting[:pronunciation]}"
|
|
66
|
+
puts "Example: #{greeting[:example]}\n\n"
|
|
67
|
+
|
|
68
|
+
elsif options[:search]
|
|
69
|
+
# Search for matching words
|
|
70
|
+
results = CSGChamorro.search(options[:search])
|
|
71
|
+
|
|
72
|
+
if results.empty?
|
|
73
|
+
puts "\nNo words found matching '#{options[:search]}'"
|
|
74
|
+
else
|
|
75
|
+
puts "\n🔍 Found #{results.length} word(s):\n"
|
|
76
|
+
results.each do |word|
|
|
77
|
+
puts "\n#{word[:chamorro]} - #{word[:english]}"
|
|
78
|
+
puts "Pronunciation: #{word[:pronunciation]}"
|
|
79
|
+
puts "Example: #{word[:example]}"
|
|
80
|
+
end
|
|
81
|
+
puts
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
elsif options[:pretty]
|
|
85
|
+
# Show formatted word of the day
|
|
86
|
+
puts CSGChamorro.pretty
|
|
87
|
+
|
|
88
|
+
else
|
|
89
|
+
# Default: simple word of the day (just the word)
|
|
90
|
+
word = CSGChamorro.word_of_day
|
|
91
|
+
puts "#{word[:chamorro]} - #{word[:english]}"
|
|
92
|
+
end
|
|
93
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "lib/csg_chamorro/version"
|
|
4
|
+
|
|
5
|
+
Gem::Specification.new do |spec|
|
|
6
|
+
spec.name = "csg_chamorro"
|
|
7
|
+
spec.version = CSGChamorro::VERSION
|
|
8
|
+
spec.authors = ["Code School of Guam"]
|
|
9
|
+
spec.email = ["codeschoolofguam@gmail.com"]
|
|
10
|
+
|
|
11
|
+
spec.summary = "Learn Chamorro words with your Ruby projects"
|
|
12
|
+
spec.description = "A gem that provides Chamorro words of the day with pronunciations, usage, and examples. Built by Code School of Guam students to preserve and share the Chamorro language!"
|
|
13
|
+
spec.homepage = "https://github.com/CSG-Live-July-2025/csg_chamorro"
|
|
14
|
+
spec.license = "MIT"
|
|
15
|
+
|
|
16
|
+
spec.required_ruby_version = ">= 3.0"
|
|
17
|
+
|
|
18
|
+
# Which files to include in the gem
|
|
19
|
+
spec.files = Dir.glob("lib/**/*") + ["README.md", "LICENSE.txt", "Rakefile", "csg_chamorro.gemspec", "bin/csg_chamorro"]
|
|
20
|
+
|
|
21
|
+
# Where the main code lives
|
|
22
|
+
spec.require_paths = ["lib"]
|
|
23
|
+
|
|
24
|
+
# CLI setup
|
|
25
|
+
spec.bindir = "bin"
|
|
26
|
+
spec.executables = ["csg_chamorro"]
|
|
27
|
+
|
|
28
|
+
# Dependencies (json comes with Ruby)
|
|
29
|
+
spec.add_dependency "json"
|
|
30
|
+
end
|
|
31
|
+
|
data/lib/csg_chamorro.rb
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "csg_chamorro/version"
|
|
4
|
+
|
|
5
|
+
module CSGChamorro
|
|
6
|
+
# Collection of Chamorro words with translations and usage
|
|
7
|
+
WORDS = [
|
|
8
|
+
{
|
|
9
|
+
chamorro: "Håfa Adai",
|
|
10
|
+
english: "Hello",
|
|
11
|
+
pronunciation: "half-a-day",
|
|
12
|
+
usage: "Traditional Chamorro greeting used throughout the day",
|
|
13
|
+
example: "Håfa Adai! Welcome to Guam!"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
chamorro: "Si Yu'os Ma'åse'",
|
|
17
|
+
english: "Thank you",
|
|
18
|
+
pronunciation: "see-you-os-ma-ah-see",
|
|
19
|
+
usage: "Expression of gratitude and appreciation",
|
|
20
|
+
example: "Si Yu'os Ma'åse' for helping me today."
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
chamorro: "Inafa'maolek",
|
|
24
|
+
english: "To make good / Harmony",
|
|
25
|
+
pronunciation: "in-a-fa-mow-lek",
|
|
26
|
+
usage: "Core Chamorro value of cooperation and harmony",
|
|
27
|
+
example: "We practice Inafa'maolek in our community."
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
chamorro: "Biba",
|
|
31
|
+
english: "Long live / Hurray",
|
|
32
|
+
pronunciation: "bee-bah",
|
|
33
|
+
usage: "Celebration or showing pride",
|
|
34
|
+
example: "Biba Guåhan! (Long live Guam!)"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
chamorro: "Hågat",
|
|
38
|
+
english: "Hello (casual)",
|
|
39
|
+
pronunciation: "haw-got",
|
|
40
|
+
usage: "Informal greeting among friends",
|
|
41
|
+
example: "Hågat! How are you doing?"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
chamorro: "Adios",
|
|
45
|
+
english: "Goodbye",
|
|
46
|
+
pronunciation: "ah-dee-os",
|
|
47
|
+
usage: "Farewell greeting",
|
|
48
|
+
example: "Adios, see you tomorrow!"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
chamorro: "Pågo",
|
|
52
|
+
english: "Now",
|
|
53
|
+
pronunciation: "paw-go",
|
|
54
|
+
usage: "Refers to the present moment",
|
|
55
|
+
example: "We need to leave pågo."
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
chamorro: "Guåhan",
|
|
59
|
+
english: "Guam",
|
|
60
|
+
pronunciation: "gwa-han",
|
|
61
|
+
usage: "The Chamorro name for the island of Guam",
|
|
62
|
+
example: "I'm from Guåhan, born and raised!"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
chamorro: "I Manåmko'",
|
|
66
|
+
english: "The elders",
|
|
67
|
+
pronunciation: "ee man-am-ko",
|
|
68
|
+
usage: "Respected elders in the community",
|
|
69
|
+
example: "We learn from I Manåmko' and honor their wisdom."
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
chamorro: "Nåna",
|
|
73
|
+
english: "Mother / Mom",
|
|
74
|
+
pronunciation: "nah-nah",
|
|
75
|
+
usage: "Respectful term for mother",
|
|
76
|
+
example: "My nåna makes the best kelaguen."
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
chamorro: "Tåta",
|
|
80
|
+
english: "Father / Dad",
|
|
81
|
+
pronunciation: "tah-tah",
|
|
82
|
+
usage: "Respectful term for father",
|
|
83
|
+
example: "Tåta taught me how to fish."
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
chamorro: "Hafa tatatmanu hao?",
|
|
87
|
+
english: "How are you?",
|
|
88
|
+
pronunciation: "hah-fa ta-tot-ma-nu how",
|
|
89
|
+
usage: "Common greeting to ask about someone's wellbeing",
|
|
90
|
+
example: "Håfa Adai! Hafa tatatmanu hao?"
|
|
91
|
+
}
|
|
92
|
+
].freeze
|
|
93
|
+
|
|
94
|
+
# Get a random Chamorro word
|
|
95
|
+
def self.word_of_day
|
|
96
|
+
WORDS.sample
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Get a nicely formatted word
|
|
100
|
+
def self.pretty
|
|
101
|
+
word = word_of_day
|
|
102
|
+
"\n📚 #{word[:chamorro]} - #{word[:english]}\n" \
|
|
103
|
+
"Pronunciation: #{word[:pronunciation]}\n" \
|
|
104
|
+
"Example: #{word[:example]}\n"
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Get all words
|
|
108
|
+
def self.all_words
|
|
109
|
+
WORDS
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Count total words
|
|
113
|
+
def self.count
|
|
114
|
+
WORDS.length
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Search for words by Chamorro or English term
|
|
118
|
+
# Returns an array of matching words
|
|
119
|
+
def self.search(term)
|
|
120
|
+
# Convert search term to lowercase for case-insensitive search
|
|
121
|
+
search_term = term.downcase
|
|
122
|
+
|
|
123
|
+
# Filter words where chamorro OR english includes the search term
|
|
124
|
+
WORDS.select do |word|
|
|
125
|
+
word[:chamorro].downcase.include?(search_term) ||
|
|
126
|
+
word[:english].downcase.include?(search_term)
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# Get a random greeting from the collection
|
|
131
|
+
# Only returns words that are greetings
|
|
132
|
+
def self.random_greeting
|
|
133
|
+
# Filter to only words with "greeting" in the usage
|
|
134
|
+
greetings = WORDS.select { |word| word[:usage].downcase.include?("greeting") }
|
|
135
|
+
|
|
136
|
+
# Return a random greeting
|
|
137
|
+
greetings.sample
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
|
metadata
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: csg_chamorro
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Code School of Guam
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2025-10-16 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: json
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ">="
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '0'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - ">="
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '0'
|
|
27
|
+
description: A gem that provides Chamorro words of the day with pronunciations, usage,
|
|
28
|
+
and examples. Built by Code School of Guam students to preserve and share the Chamorro
|
|
29
|
+
language!
|
|
30
|
+
email:
|
|
31
|
+
- codeschoolofguam@gmail.com
|
|
32
|
+
executables:
|
|
33
|
+
- csg_chamorro
|
|
34
|
+
extensions: []
|
|
35
|
+
extra_rdoc_files: []
|
|
36
|
+
files:
|
|
37
|
+
- LICENSE.txt
|
|
38
|
+
- README.md
|
|
39
|
+
- Rakefile
|
|
40
|
+
- bin/csg_chamorro
|
|
41
|
+
- csg_chamorro.gemspec
|
|
42
|
+
- lib/csg_chamorro.rb
|
|
43
|
+
- lib/csg_chamorro/version.rb
|
|
44
|
+
homepage: https://github.com/CSG-Live-July-2025/csg_chamorro
|
|
45
|
+
licenses:
|
|
46
|
+
- MIT
|
|
47
|
+
metadata: {}
|
|
48
|
+
post_install_message:
|
|
49
|
+
rdoc_options: []
|
|
50
|
+
require_paths:
|
|
51
|
+
- lib
|
|
52
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
53
|
+
requirements:
|
|
54
|
+
- - ">="
|
|
55
|
+
- !ruby/object:Gem::Version
|
|
56
|
+
version: '3.0'
|
|
57
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - ">="
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '0'
|
|
62
|
+
requirements: []
|
|
63
|
+
rubygems_version: 3.5.11
|
|
64
|
+
signing_key:
|
|
65
|
+
specification_version: 4
|
|
66
|
+
summary: Learn Chamorro words with your Ruby projects
|
|
67
|
+
test_files: []
|