bubs 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/bubs +9 -1
- data/bubs.gemspec +1 -1
- data/lib/bubs.rb +2 -67
- metadata +1 -1
data/bin/bubs
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
$:.unshift File.expand_path('../../lib', __FILE__)
|
3
3
|
require 'bubs'
|
4
4
|
|
5
|
-
|
5
|
+
if $stdin.stat.size > 0
|
6
|
+
args = $stdin.read
|
7
|
+
else
|
8
|
+
args = ARGV.join(' ')
|
9
|
+
end
|
10
|
+
|
11
|
+
abort(Bubs.convert(Bubs::VERSION)) if args == "--version" || args == "-v"
|
12
|
+
|
13
|
+
text = Bubs.convert(args)
|
6
14
|
Bubs.copy(text)
|
7
15
|
puts text
|
data/bubs.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
|
|
13
13
|
## If your rubyforge_project name is different, then edit it and comment out
|
14
14
|
## the sub! line in the Rakefile
|
15
15
|
s.name = 'bubs'
|
16
|
-
s.version = '0.0.
|
16
|
+
s.version = '0.0.3'
|
17
17
|
s.date = '2013-06-20'
|
18
18
|
s.rubyforge_project = 'bubs'
|
19
19
|
|
data/lib/bubs.rb
CHANGED
@@ -1,77 +1,12 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
class Bubs
|
3
|
-
VERSION = '0.0.
|
4
|
-
|
5
|
-
CONVERT_MAP = {
|
6
|
-
'A' => 'Ⓐ',
|
7
|
-
'B' => 'Ⓑ',
|
8
|
-
'C' => 'Ⓒ',
|
9
|
-
'D' => 'Ⓓ',
|
10
|
-
'E' => 'Ⓔ',
|
11
|
-
'F' => 'Ⓕ',
|
12
|
-
'G' => 'Ⓖ',
|
13
|
-
'H' => 'Ⓗ',
|
14
|
-
'I' => 'Ⓘ',
|
15
|
-
'J' => 'Ⓙ',
|
16
|
-
'K' => 'Ⓚ',
|
17
|
-
'L' => 'Ⓛ',
|
18
|
-
'M' => 'Ⓜ',
|
19
|
-
'N' => 'Ⓝ',
|
20
|
-
'O' => 'Ⓞ',
|
21
|
-
'P' => 'Ⓟ',
|
22
|
-
'Q' => 'Ⓠ',
|
23
|
-
'R' => 'Ⓡ',
|
24
|
-
'S' => 'Ⓢ',
|
25
|
-
'T' => 'Ⓣ',
|
26
|
-
'U' => 'Ⓤ',
|
27
|
-
'V' => 'Ⓥ',
|
28
|
-
'W' => 'Ⓦ',
|
29
|
-
'X' => 'Ⓧ',
|
30
|
-
'Y' => 'Ⓨ',
|
31
|
-
'Z' => 'Ⓩ',
|
32
|
-
'a' => 'ⓐ',
|
33
|
-
'b' => 'ⓑ',
|
34
|
-
'c' => 'ⓒ',
|
35
|
-
'd' => 'ⓓ',
|
36
|
-
'e' => 'ⓔ',
|
37
|
-
'f' => 'ⓕ',
|
38
|
-
'g' => 'ⓖ',
|
39
|
-
'h' => 'ⓗ',
|
40
|
-
'i' => 'ⓘ',
|
41
|
-
'j' => 'ⓙ',
|
42
|
-
'k' => 'ⓚ',
|
43
|
-
'l' => 'ⓛ',
|
44
|
-
'm' => 'ⓜ',
|
45
|
-
'n' => 'ⓝ',
|
46
|
-
'o' => 'ⓞ',
|
47
|
-
'p' => 'ⓟ',
|
48
|
-
'q' => 'ⓠ',
|
49
|
-
'r' => 'ⓡ',
|
50
|
-
's' => 'ⓢ',
|
51
|
-
't' => 'ⓣ',
|
52
|
-
'u' => 'ⓤ',
|
53
|
-
'v' => 'ⓥ',
|
54
|
-
'w' => 'ⓦ',
|
55
|
-
'x' => 'ⓧ',
|
56
|
-
'y' => 'ⓨ',
|
57
|
-
'z' => 'ⓩ',
|
58
|
-
'1' => '①',
|
59
|
-
'2' => '②',
|
60
|
-
'3' => '③',
|
61
|
-
'4' => '④',
|
62
|
-
'5' => '⑤',
|
63
|
-
'6' => '⑥',
|
64
|
-
'7' => '⑦',
|
65
|
-
'8' => '⑧',
|
66
|
-
'9' => '⑨',
|
67
|
-
'0' => '⓪'
|
68
|
-
}
|
3
|
+
VERSION = '0.0.3'
|
69
4
|
|
70
5
|
# Convert words to ⓌⓄⓇⒹⓈ.
|
71
6
|
#
|
72
7
|
# Returns a String, but a much cooler string than what you had initially.
|
73
8
|
def self.convert(text)
|
74
|
-
text.
|
9
|
+
text.tr('A-Za-z1-90', 'Ⓐ-Ⓩⓐ-ⓩ①-⑨⓪')
|
75
10
|
end
|
76
11
|
|
77
12
|
# Copies the text to clipboard
|