rage_flip 2.5.2 → 2.6.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aba53959f80e42aea3bad97b53270a8a94f919a454041f608a3b5254c9a81960
4
- data.tar.gz: 339c8ec100a6af097943c5dd2da01ad0ead2560965ab409e2234fe37362f3af6
3
+ metadata.gz: 216f4365cd7a026366fec93f1c3fed6c05e07ba1bebdc3857930002dc93868d4
4
+ data.tar.gz: a3256822c6849e2384beb3481bec49f0dec448811240dfcf8f5396b7cf20d198
5
5
  SHA512:
6
- metadata.gz: ab33ecbad214b3aa56885fe4a5f2a97926d1484f0dc1411adad7494af114be791cc398e5230387b80f3e0720fd08f669d549d9f2899278617841162273f8c6f8
7
- data.tar.gz: 1187dca4e5f08e748112fab921efe45ec732e7a2e2a573d2d8dacb8356e5769206026ef549688a80d6c1b6fa8da79cee1c0f4def99793dfc0c5eee9f4e0c42ef
6
+ metadata.gz: 87cdc366d70375cc3acb84278e9f5901230ebb4b2ab828974fbac2d9cd77bebbd7babb97ce84d6eb8797162d53988772032c298430fe11cc48b8ea7217b92949
7
+ data.tar.gz: 1cc819347d8550d0a73e65bc0c9638b2cc3885d2f2c1cc38b8c32048252e622c8f6778b3c48ac63630973b58691a8f15bf767ec545fd09be857ec6a763868b54
data/CHANGELOG.md CHANGED
@@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8
8
  ## [Unreleased]
9
9
 
10
10
  ### Added
11
+ - `emote celsius`, `fahrenheit`, `kelvin`, and `rankine` temperature unit symbols (℃ ℉ K °R)
12
+ - `italic` command that swaps letters for slanted Unicode alternatives, or script ones with `--script`
11
13
  - `flip_text` command for flipping text without any emoticons
12
14
  - `emote` command system with disapproval and animal+poop combinations
13
15
  - `emote disapproval` outputs `(ಠ_ಠ)`
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  `rage_flip` is a comprehensive Ruby gem that provides text manipulation utilities with clipboard integration. It flips text upside down with rage table flip emoticons, includes extensive text formatting tools, and features a rich collection of emotes and text substitutions for enhanced communication.
4
4
 
5
+ Prefer an app? The same functionality is also available [on the App Store](https://apps.apple.com/app/id6827749145).
6
+
5
7
  ## Installation
6
8
 
7
9
  Add this line to your application's Gemfile:
@@ -109,6 +111,15 @@ emote shft # Output: ⇧
109
111
  emote shift # Output: ⇧
110
112
  ```
111
113
 
114
+ Temperature units:
115
+
116
+ ```bash
117
+ emote celsius # Output: ℃
118
+ emote fahrenheit # Output: ℉
119
+ emote kelvin # Output: K (U+212A KELVIN SIGN)
120
+ emote rankine # Output: °R
121
+ ```
122
+
112
123
  #### Special Emotes
113
124
  Multi-line and unique expressions:
114
125
 
@@ -181,6 +192,18 @@ doubleunderline "double underlined"
181
192
  # Output: d̳o̳u̳b̳l̳e̳ ̳u̳n̳d̳e̳r̳l̳i̳n̳e̳d̳
182
193
  ```
183
194
 
195
+ ### italic
196
+
197
+ Swaps letters for slanted Unicode alternatives, or script ones with `--script`. Digits, punctuation, and accented letters are left unchanged:
198
+
199
+ ```bash
200
+ italic "italic text"
201
+ # Output: 𝑖𝑡𝑎𝑙𝑖𝑐 𝑡𝑒𝑥𝑡
202
+
203
+ italic --script "script text"
204
+ # Output: 𝓈𝒸𝓇𝒾𝓅𝓉 𝓉ℯ𝓍𝓉
205
+ ```
206
+
184
207
  ### chaos
185
208
 
186
209
  Adds random Unicode combining characters for a chaotic effect:
@@ -241,6 +264,9 @@ The gem includes an extensive collection of emotes organized into categories:
241
264
  ### Keyboard Symbols
242
265
  - `cmd`/`command` (⌘), `optn`/`option` (⌥), `cntl` (⌃), `shft`/`shift` (⇧), `cmd-` (⌘-)
243
266
 
267
+ ### Temperature Units
268
+ - `celsius` (℃), `fahrenheit` (℉), `kelvin` (K), `rankine` (°R)
269
+
244
270
  ### Special Characters
245
271
  - `noevil` (🙈🙉🙊), `omw` ("On my way!"), `heresatable`, `kungfuhamster` (ASCII art), `unsee`
246
272
 
@@ -296,6 +322,13 @@ RageFlip::Underline.single_underline("text")
296
322
  RageFlip::Underline.double_underline("text")
297
323
  # => "t̳e̳x̳t̳"
298
324
 
325
+ # Italic (slanted or script)
326
+ RageFlip::Italic.slanted("text")
327
+ # => "𝑡𝑒𝑥𝑡"
328
+
329
+ RageFlip::Italic.script("text")
330
+ # => "𝓉ℯ𝓍𝓉"
331
+
299
332
  # Chaos
300
333
  RageFlip::Chaos.process("text", 5)
301
334
  # => "t̸e̷x̸t̷"
data/exe/italic ADDED
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require_relative "../lib/rage_flip"
4
+
5
+ script = ARGV.first == "--script"
6
+ text = ARGV.drop(script ? 1 : 0).join(" ")
7
+
8
+ if text.empty?
9
+ puts "Usage: italic [--script] <text_to_italicize>"
10
+ exit 1
11
+ end
12
+
13
+ result = RageFlip::Italic.process(text, script: script)
14
+
15
+ if RageFlip::Clipboard.copy(result)
16
+ else
17
+ puts "Failed to copy to clipboard, but here's your italic text:"
18
+ end
19
+ puts result
@@ -34,6 +34,12 @@ module RageFlip
34
34
  "shft" => "⇧",
35
35
  "shift" => "⇧",
36
36
 
37
+ # Temperature Units
38
+ "celsius" => "\u2103", # ℃ DEGREE CELSIUS
39
+ "fahrenheit" => "\u2109", # ℉ DEGREE FAHRENHEIT
40
+ "kelvin" => "\u212A", # K KELVIN SIGN
41
+ "rankine" => "\u00B0R", # °R (Unicode has no dedicated Rankine sign)
42
+
37
43
  # Smileys & People
38
44
  "grin" => "😀",
39
45
  "smiley" => "😃",
@@ -1605,6 +1611,10 @@ module RageFlip
1605
1611
  description: "Keyboard Shortcuts",
1606
1612
  emotes: ["cmd-", "cmd", "command", "cntl", "optn", "option", "shft", "shift"]
1607
1613
  },
1614
+ "temperature" => {
1615
+ description: "Temperature Units",
1616
+ emotes: ["celsius", "fahrenheit", "kelvin", "rankine"]
1617
+ },
1608
1618
  "smileys" => {
1609
1619
  description: "Smileys & People",
1610
1620
  emotes: EMOTES.keys.select { |k|
@@ -0,0 +1,49 @@
1
+ module RageFlip
2
+ class Italic
3
+ # Unicode leaves holes in these alphabets for letters that were already
4
+ # encoded in the Letterlike Symbols block, so those are mapped explicitly.
5
+ SLANTED_EXCEPTIONS = {
6
+ "h" => "ℎ"
7
+ }.freeze
8
+
9
+ SCRIPT_EXCEPTIONS = {
10
+ "B" => "ℬ",
11
+ "E" => "ℰ",
12
+ "F" => "ℱ",
13
+ "H" => "ℋ",
14
+ "I" => "ℐ",
15
+ "L" => "ℒ",
16
+ "M" => "ℳ",
17
+ "R" => "ℛ",
18
+ "e" => "ℯ",
19
+ "g" => "ℊ",
20
+ "o" => "ℴ"
21
+ }.freeze
22
+
23
+ def self.build_map(upper_start, lower_start, exceptions)
24
+ upper = ("A".."Z").each_with_index.to_h { |c, i| [c, [upper_start + i].pack("U")] }
25
+ lower = ("a".."z").each_with_index.to_h { |c, i| [c, [lower_start + i].pack("U")] }
26
+ upper.merge(lower).merge(exceptions).freeze
27
+ end
28
+ private_class_method :build_map
29
+
30
+ # Mathematical Italic
31
+ SLANTED_MAP = build_map(0x1D434, 0x1D44E, SLANTED_EXCEPTIONS)
32
+ # Mathematical Script
33
+ SCRIPT_MAP = build_map(0x1D49C, 0x1D4B6, SCRIPT_EXCEPTIONS)
34
+
35
+ # Characters without an alternative (digits, punctuation, accented
36
+ # letters) pass through unchanged.
37
+ def self.process(text, script: false)
38
+ text.gsub(/[A-Za-z]/, script ? SCRIPT_MAP : SLANTED_MAP)
39
+ end
40
+
41
+ def self.slanted(text)
42
+ process(text, script: false)
43
+ end
44
+
45
+ def self.script(text)
46
+ process(text, script: true)
47
+ end
48
+ end
49
+ end
@@ -1,3 +1,3 @@
1
1
  module RageFlip
2
- VERSION = "2.5.2"
2
+ VERSION = "2.6.1"
3
3
  end
data/lib/rage_flip.rb CHANGED
@@ -3,6 +3,7 @@ require_relative "rage_flip/flipper"
3
3
  require_relative "rage_flip/sarcasm"
4
4
  require_relative "rage_flip/strikethrough"
5
5
  require_relative "rage_flip/underline"
6
+ require_relative "rage_flip/italic"
6
7
  require_relative "rage_flip/chaos"
7
8
  require_relative "rage_flip/clipboard"
8
9
  require_relative "rage_flip/emote"
@@ -112,6 +112,44 @@ RSpec.describe RageFlip do
112
112
  end
113
113
  end
114
114
 
115
+ describe RageFlip::Italic do
116
+ describe ".slanted" do
117
+ it "swaps letters for mathematical italic characters" do
118
+ expect(RageFlip::Italic.slanted("Az")).to eq("\u{1D434}\u{1D467}")
119
+ end
120
+
121
+ it "uses the Letterlike Symbols character for h" do
122
+ expect(RageFlip::Italic.slanted("h")).to eq("\u210E")
123
+ end
124
+ end
125
+
126
+ describe ".script" do
127
+ it "swaps letters for mathematical script characters" do
128
+ expect(RageFlip::Italic.script("Az")).to eq("\u{1D49C}\u{1D4CF}")
129
+ end
130
+
131
+ it "uses the Letterlike Symbols characters for letters missing from the script block" do
132
+ expect(RageFlip::Italic.script("BEFHILMRego")).to eq("\u212C\u2130\u2131\u210B\u2110\u2112\u2133\u211B\u212F\u210A\u2134")
133
+ end
134
+ end
135
+
136
+ describe ".process" do
137
+ it "maps every ASCII letter to a distinct, assigned character" do
138
+ letters = [*"A".."Z", *"a".."z"]
139
+ [false, true].each do |script|
140
+ mapped = letters.map { |c| RageFlip::Italic.process(c, script: script) }
141
+ expect(mapped.uniq.length).to eq(52)
142
+ expect(mapped).to all(match(/\A\p{Assigned}\z/))
143
+ end
144
+ end
145
+
146
+ it "leaves digits, punctuation, whitespace and accented letters unchanged" do
147
+ expect(RageFlip::Italic.process("1 2, é!")).to eq("1 2, é!")
148
+ expect(RageFlip::Italic.process("1 2, é!", script: true)).to eq("1 2, é!")
149
+ end
150
+ end
151
+ end
152
+
115
153
  describe RageFlip::Chaos do
116
154
  let(:chaos_file) { File.expand_path("~/.chaos_level.txt") }
117
155
 
@@ -195,6 +233,13 @@ RSpec.describe RageFlip do
195
233
  expect(result).to eq("🐶💩")
196
234
  end
197
235
 
236
+ it "returns temperature unit symbols" do
237
+ expect(RageFlip::Emote.process("celsius")).to eq("℃")
238
+ expect(RageFlip::Emote.process("fahrenheit")).to eq("℉")
239
+ expect(RageFlip::Emote.process("kelvin")).to eq("K")
240
+ expect(RageFlip::Emote.process("rankine")).to eq("°R")
241
+ end
242
+
198
243
  it "handles case insensitive input" do
199
244
  result = RageFlip::Emote.process("DISAPPROVAL")
200
245
  expect(result).to eq("(ಠ_ಠ)")
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.5.2
4
+ version: 2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Powell
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-10-27 00:00:00.000000000 Z
11
+ date: 2026-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -52,6 +52,7 @@ executables:
52
52
  - flip
53
53
  - flip_text
54
54
  - frustrated
55
+ - italic
55
56
  - rage_flip
56
57
  - sarcasm
57
58
  - strikethrough
@@ -77,6 +78,7 @@ files:
77
78
  - exe/flip
78
79
  - exe/flip_text
79
80
  - exe/frustrated
81
+ - exe/italic
80
82
  - exe/rage_flip
81
83
  - exe/sarcasm
82
84
  - exe/strikethrough
@@ -89,6 +91,7 @@ files:
89
91
  - lib/rage_flip/emote.rb
90
92
  - lib/rage_flip/flipper.rb
91
93
  - lib/rage_flip/frustrated.rb
94
+ - lib/rage_flip/italic.rb
92
95
  - lib/rage_flip/sarcasm.rb
93
96
  - lib/rage_flip/strikethrough.rb
94
97
  - lib/rage_flip/text_substitution.rb