rage_flip 2.0.4 → 2.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 +4 -4
- data/README.md +102 -0
- data/lib/rage_flip/emote.rb +67 -1
- data/lib/rage_flip/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a523a2de14aa77843d7979b673df597b40fe6fa34a8420648d165cece935392e
|
|
4
|
+
data.tar.gz: f9029563c8e5e474e581555a99364b4e786ca1d6f1cb7237c1005aecf59487df
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7d01d950eaf17374cadfc9da09ef84a2e18112888883483882d86dd181c0edce63c844a2b98ec6c2a0df184eca8695886f00c8940390a60affebfa6d1c3577d5
|
|
7
|
+
data.tar.gz: 9f58db6db32b784c5ff65f2acc7bac53fe35b31a9658a8a6b200d81bcae8217b52c8c934672f9aceab21f4b1975967f34a1f74c7fa46540fd931b56614c680d0
|
data/README.md
CHANGED
|
@@ -127,6 +127,82 @@ emote yuno # Output: ლ(ಠ益ಠლ)
|
|
|
127
127
|
|
|
128
128
|
All emotes are accessed through the `emote` command followed by the emote name. Use `emote list` to see the complete collection of available emotes.
|
|
129
129
|
|
|
130
|
+
#### Multi-Emote Combinations
|
|
131
|
+
|
|
132
|
+
The emote system supports combining multiple emoji-only emotes into compound expressions. This allows you to create custom combinations on the fly:
|
|
133
|
+
|
|
134
|
+
**With Hyphens:**
|
|
135
|
+
```bash
|
|
136
|
+
emote bullshit-catshit # Output: 🐄💩🐱💩
|
|
137
|
+
emote omg-cat # Output: 😱🐱
|
|
138
|
+
emote dog-panda-cat # Output: 🐶🐼🐱
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**Without Separators:**
|
|
142
|
+
```bash
|
|
143
|
+
emote bullshitcatshit # Output: 🐄💩🐱💩
|
|
144
|
+
emote omgcat # Output: 😱🐱 (also available as a standalone emote)
|
|
145
|
+
emote dogpandacat # Output: 🐶🐼🐱
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
The system uses dynamic programming to automatically detect and combine emoji-only emotes. Note that:
|
|
149
|
+
- Only emoji-only emotes can be combined (ASCII art emotes like `shrug` or `kungfuhamster` cannot be combined)
|
|
150
|
+
- The longest matching emote names are prioritized
|
|
151
|
+
- If an exact emote name exists (like `omgcat`), it will be used instead of parsing as a combination
|
|
152
|
+
|
|
153
|
+
**Example emoji-only emotes that can be combined:**
|
|
154
|
+
`bullshit`, `catshit`, `dogshit`, `pandashit`, `horseshit`, `koalashit`, `batshit`, `shboatload`, `popcorn`, `omg`, `omgcat`, `deer`, `middlefinger`, `noevil`
|
|
155
|
+
|
|
156
|
+
#### Custom Emotes
|
|
157
|
+
|
|
158
|
+
You can define your own custom emotes that persist across sessions:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
# Initialize a custom emote configuration file
|
|
162
|
+
emote init-custom
|
|
163
|
+
# Creates ~/.config/rage_flip/emote.json with sample emotes
|
|
164
|
+
|
|
165
|
+
# List only your custom emotes
|
|
166
|
+
emote list-custom
|
|
167
|
+
# Shows all custom emotes and the config file location
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
**Configuration Format:**
|
|
171
|
+
|
|
172
|
+
Custom emotes can be defined in either JSON or YAML format:
|
|
173
|
+
|
|
174
|
+
**JSON** (`~/.config/rage_flip/emote.json`):
|
|
175
|
+
```json
|
|
176
|
+
{
|
|
177
|
+
"myemote": "🎉🎊",
|
|
178
|
+
"team": "👥💪",
|
|
179
|
+
"coffee": "☕"
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
**YAML** (`~/.config/rage_flip/emote.yml`):
|
|
184
|
+
```yaml
|
|
185
|
+
myemote: "🎉🎊"
|
|
186
|
+
team: "👥💪"
|
|
187
|
+
coffee: "☕"
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Custom emotes:
|
|
191
|
+
- Are automatically merged with built-in emotes
|
|
192
|
+
- Can override built-in emotes (use with caution)
|
|
193
|
+
- Support all emoji and Unicode characters
|
|
194
|
+
- Work with multi-emote combinations if they are emoji-only
|
|
195
|
+
- Persist across terminal sessions and system reboots
|
|
196
|
+
|
|
197
|
+
**Usage:**
|
|
198
|
+
```bash
|
|
199
|
+
emote myemote # Output: 🎉🎊
|
|
200
|
+
emote coffee # Output: ☕
|
|
201
|
+
emote team-coffee # Multi-emote combination: 👥💪☕
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
The `init-custom` command creates a sample configuration file with examples to get you started. Edit the file to add your own custom emotes, then use `emote list` to see all available emotes (both built-in and custom) or `emote list-custom` to see only your custom emotes.
|
|
205
|
+
|
|
130
206
|
### sarcasm
|
|
131
207
|
|
|
132
208
|
Alternates between uppercase and lowercase characters:
|
|
@@ -299,6 +375,16 @@ RageFlip::Emote.process("cmd")
|
|
|
299
375
|
RageFlip::Emote.process("shrug")
|
|
300
376
|
# => "¯\_(ツ)_/¯"
|
|
301
377
|
|
|
378
|
+
# Multi-emote combinations
|
|
379
|
+
RageFlip::Emote.process("bullshit-catshit")
|
|
380
|
+
# => "🐄💩🐱💩"
|
|
381
|
+
|
|
382
|
+
RageFlip::Emote.process("bullshitcatshit")
|
|
383
|
+
# => "🐄💩🐱💩"
|
|
384
|
+
|
|
385
|
+
RageFlip::Emote.process("omg-deer-popcorn")
|
|
386
|
+
# => "😱🦌🍿"
|
|
387
|
+
|
|
302
388
|
RageFlip::Emote.list_emotes
|
|
303
389
|
# => "Available emotes:\n batshit - 🦇💩\n bugeyes - (⊙_◎)\n..."
|
|
304
390
|
|
|
@@ -310,6 +396,22 @@ RageFlip::Emote.emote_exists?("rage")
|
|
|
310
396
|
RageFlip::Emote.emote_names
|
|
311
397
|
# => ["disapproval", "bullshit", "catshit", ...]
|
|
312
398
|
|
|
399
|
+
# Custom emotes
|
|
400
|
+
RageFlip::Emote.init_custom_config
|
|
401
|
+
# => "Custom emote config initialized: ~/.config/rage_flip/emote.json\nEdit this file..."
|
|
402
|
+
|
|
403
|
+
RageFlip::Emote.list_custom_emotes
|
|
404
|
+
# => "Custom emotes:\n myemote - 🎉🎊\n..."
|
|
405
|
+
|
|
406
|
+
RageFlip::Emote.load_custom_emotes
|
|
407
|
+
# => {"myemote" => "🎉🎊", "team" => "👥💪", ...}
|
|
408
|
+
|
|
409
|
+
RageFlip::Emote.all_emotes
|
|
410
|
+
# => {"disapproval" => "(ಠ_ಠ)", "bullshit" => "🐄💩", "myemote" => "🎉🎊", ...}
|
|
411
|
+
|
|
412
|
+
RageFlip::Emote.refresh_emotes
|
|
413
|
+
# Reloads custom emotes from disk (useful after editing config file)
|
|
414
|
+
|
|
313
415
|
# Copy to clipboard
|
|
314
416
|
RageFlip::Clipboard.copy("text to copy")
|
|
315
417
|
```
|
data/lib/rage_flip/emote.rb
CHANGED
|
@@ -10,6 +10,7 @@ module RageFlip
|
|
|
10
10
|
"catshit" => "🐱💩",
|
|
11
11
|
"dogshit" => "🐶💩",
|
|
12
12
|
"pandashit" => "🐼💩",
|
|
13
|
+
"popcorn" => "🍿",
|
|
13
14
|
"horseshit" => "🐴💩",
|
|
14
15
|
"koalashit" => "🐨💩",
|
|
15
16
|
"batshit" => "🦇💩",
|
|
@@ -18,6 +19,7 @@ module RageFlip
|
|
|
18
19
|
"cmd-" => "⌘-",
|
|
19
20
|
"cmd" => "⌘",
|
|
20
21
|
"command" => "⌘",
|
|
22
|
+
"deer" => "🦌",
|
|
21
23
|
"cntl" => "⌃",
|
|
22
24
|
"dogshrug" => '¯\_🐶_/¯',
|
|
23
25
|
"facepalm" => "(-‸ლ)",
|
|
@@ -80,14 +82,78 @@ module RageFlip
|
|
|
80
82
|
|
|
81
83
|
def self.refresh_emotes
|
|
82
84
|
@all_emotes = nil
|
|
85
|
+
@emoji_only_emotes = nil
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Check if an emote value contains only emoji (no ASCII art or text)
|
|
89
|
+
def self.emoji_only?(value)
|
|
90
|
+
# Remove all emoji and see if anything is left (besides spaces)
|
|
91
|
+
# This regex matches emoji characters
|
|
92
|
+
value.gsub(/[\p{Emoji}\p{Emoji_Presentation}\p{Emoji_Modifier}\p{Emoji_Component}]/, '').strip.empty?
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Get all emoji-only emotes
|
|
96
|
+
def self.emoji_only_emotes
|
|
97
|
+
@emoji_only_emotes ||= all_emotes.select { |name, value| emoji_only?(value) }
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Try to split a compound emote name into parts
|
|
101
|
+
# Returns an array of emote values if successful, nil otherwise
|
|
102
|
+
def self.split_compound_emote(compound_name)
|
|
103
|
+
# First try splitting by hyphen
|
|
104
|
+
if compound_name.include?('-')
|
|
105
|
+
parts = compound_name.split('-')
|
|
106
|
+
results = parts.map { |part| all_emotes[part] }
|
|
107
|
+
return results if results.all? && results.all? { |r| emoji_only?(r) }
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Try to find a combination of emoji-only emotes without separator
|
|
111
|
+
# Use dynamic programming to find valid splits
|
|
112
|
+
return find_emote_combination(compound_name)
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Find a valid combination of emoji-only emotes that match the compound name
|
|
116
|
+
def self.find_emote_combination(name, start = 0, memo = {})
|
|
117
|
+
return [] if start >= name.length
|
|
118
|
+
return memo[[name, start]] if memo.key?([name, start])
|
|
119
|
+
|
|
120
|
+
# Try each emoji-only emote starting at this position
|
|
121
|
+
emoji_only_emotes.each do |emote_name, emote_value|
|
|
122
|
+
next unless name[start..-1].start_with?(emote_name)
|
|
123
|
+
|
|
124
|
+
rest_start = start + emote_name.length
|
|
125
|
+
if rest_start >= name.length
|
|
126
|
+
# We've matched the entire string
|
|
127
|
+
memo[[name, start]] = [emote_value]
|
|
128
|
+
return [emote_value]
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Try to match the rest
|
|
132
|
+
rest = find_emote_combination(name, rest_start, memo)
|
|
133
|
+
if rest
|
|
134
|
+
result = [emote_value] + rest
|
|
135
|
+
memo[[name, start]] = result
|
|
136
|
+
return result
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
memo[[name, start]] = nil
|
|
141
|
+
nil
|
|
83
142
|
end
|
|
84
143
|
|
|
85
144
|
def self.process(emote_name)
|
|
86
145
|
emote_name = emote_name.downcase
|
|
87
146
|
|
|
147
|
+
# First check if it exists as-is
|
|
88
148
|
if all_emotes.key?(emote_name)
|
|
89
|
-
all_emotes[emote_name]
|
|
149
|
+
return all_emotes[emote_name]
|
|
90
150
|
end
|
|
151
|
+
|
|
152
|
+
# Try to split as compound emote
|
|
153
|
+
compound_result = split_compound_emote(emote_name)
|
|
154
|
+
return compound_result.join('') if compound_result
|
|
155
|
+
|
|
156
|
+
nil
|
|
91
157
|
end
|
|
92
158
|
|
|
93
159
|
def self.list_emotes
|
data/lib/rage_flip/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rage_flip
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0
|
|
4
|
+
version: 2.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Thomas Powell
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-11-
|
|
11
|
+
date: 2025-11-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rspec
|