unicode-multibyte 0.2.3 → 0.2.4
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.
- data/.Rakefile.swp +0 -0
- data/.unicode-multibyte.gemspec.swp +0 -0
- data/Rakefile +1 -1
- data/lib/unicodechars/multibyte/chars.rb +3 -3
- data/lib/unicodechars/multibyte/handlers/passthru_handler.rb +1 -1
- data/lib/unicodechars/multibyte/handlers/utf8_handler.rb +1 -1
- data/lib/unicodechars/multibyte.rb +2 -8
- data/unicode-multibyte.gemspec +1 -1
- metadata +3 -7
- data/unicode-multibyte-0.1.0.gem +0 -0
- data/unicode-multibyte-0.2.0.gem +0 -0
- data/unicode-multibyte-0.2.1.gem +0 -0
- data/unicode-multibyte-0.2.2.gem +0 -0
data/.Rakefile.swp
CHANGED
Binary file
|
Binary file
|
data/Rakefile
CHANGED
@@ -125,7 +125,7 @@ module UnicodeMultibyte::Multibyte
|
|
125
125
|
@@handler = klass
|
126
126
|
end
|
127
127
|
|
128
|
-
# Returns the proper handler for the contained string depending on $
|
128
|
+
# Returns the proper handler for the contained string depending on $MULTIBYTE_CODE and the encoding of the string. This
|
129
129
|
# method is used internally to always redirect messages to the proper classes depending on the context.
|
130
130
|
def handler
|
131
131
|
if utf8_pragma?
|
@@ -137,10 +137,10 @@ module UnicodeMultibyte::Multibyte
|
|
137
137
|
|
138
138
|
private
|
139
139
|
|
140
|
-
# +utf8_pragma+ checks if it can send this string to the handlers. It makes sure @string isn't nil and $
|
140
|
+
# +utf8_pragma+ checks if it can send this string to the handlers. It makes sure @string isn't nil and $MULTIBYTE_CODE is
|
141
141
|
# set to 'UTF8'.
|
142
142
|
def utf8_pragma?
|
143
|
-
!@string.nil? && ($
|
143
|
+
!@string.nil? && ($MULTIBYTE_CODE == 'UTF8')
|
144
144
|
end
|
145
145
|
end
|
146
146
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Chars uses this handler when $
|
1
|
+
# Chars uses this handler when $MULTIBYTE_CODE is not set to 'UTF8'. Because this handler doesn't define any methods all call
|
2
2
|
# will be forwarded to String.
|
3
3
|
class UnicodeMultibyte::Multibyte::Handlers::PassthruHandler
|
4
4
|
|
@@ -52,7 +52,7 @@ module UnicodeMultibyte::Multibyte::Handlers
|
|
52
52
|
end
|
53
53
|
|
54
54
|
# UTF8Handler implements Unicode aware operations for strings, these operations will be used by the Chars
|
55
|
-
# proxy when $
|
55
|
+
# proxy when $MULTIBYTE_CODE is set to 'UTF8'.
|
56
56
|
class UTF8Handler
|
57
57
|
# Hangul character boundaries and properties
|
58
58
|
HANGUL_SBASE = 0xAC00
|
@@ -1,4 +1,4 @@
|
|
1
|
-
$
|
1
|
+
$MULTIBYTE_CODE = "UTF8"
|
2
2
|
|
3
3
|
module UnicodeMultibyte
|
4
4
|
module Multibyte
|
@@ -10,14 +10,8 @@ end
|
|
10
10
|
|
11
11
|
require File.join(File.dirname(__FILE__), "multibyte", "chars")
|
12
12
|
|
13
|
-
module Kernel
|
14
|
-
def u(str)
|
15
|
-
UnicodeMultibyte::Multibyte::Chars.new(str)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
13
|
class String
|
20
14
|
def mb_chars
|
21
|
-
|
15
|
+
UnicodeMultibyte::Multibyte::Chars.new(self)
|
22
16
|
end
|
23
17
|
end
|
data/unicode-multibyte.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unicode-multibyte
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 4
|
10
|
+
version: 0.2.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Kevin Le
|
@@ -40,10 +40,6 @@ files:
|
|
40
40
|
- lib/unicodechars.rb
|
41
41
|
- Rakefile
|
42
42
|
- setup.rb
|
43
|
-
- unicode-multibyte-0.1.0.gem
|
44
|
-
- unicode-multibyte-0.2.0.gem
|
45
|
-
- unicode-multibyte-0.2.1.gem
|
46
|
-
- unicode-multibyte-0.2.2.gem
|
47
43
|
- unicode-multibyte.gemspec
|
48
44
|
- .project
|
49
45
|
- .Rakefile.swp
|
data/unicode-multibyte-0.1.0.gem
DELETED
Binary file
|
data/unicode-multibyte-0.2.0.gem
DELETED
Binary file
|
data/unicode-multibyte-0.2.1.gem
DELETED
Binary file
|
data/unicode-multibyte-0.2.2.gem
DELETED
Binary file
|