unicode-multibyte 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
data/.Rakefile.swp CHANGED
Binary file
Binary file
@@ -10,12 +10,12 @@ module UnicodeMultibyte::Multibyte
10
10
  # String methods are proxied through the Chars object, and can be accessed through the +chars+ method. Methods
11
11
  # which would normally return a String object now return a Chars object so methods can be chained.
12
12
  #
13
- # "The Perfect String ".chars.downcase.strip.normalize #=> "the perfect string"
13
+ # "The Perfect String ".multibyte_chars.downcase.strip.normalize #=> "the perfect string"
14
14
  #
15
15
  # Chars objects are perfectly interchangeable with String objects as long as no explicit class checks are made.
16
16
  # If certain methods do explicitly check the class, call +to_s+ before you pass chars objects to them.
17
17
  #
18
- # bad.explicit_checking_method "T".chars.downcase.to_s
18
+ # bad.explicit_checking_method "T".multibyte_chars.downcase.to_s
19
19
  #
20
20
  # The actual operations on the string are delegated to handlers. Theoretically handlers can be implemented for
21
21
  # any encoding, but the default handler handles UTF-8. This handler is set during initialization, if you want to
@@ -80,11 +80,11 @@ module UnicodeMultibyte::Multibyte
80
80
  # Works just like String#split, with the exception that the items in the resulting list are Chars
81
81
  # instances instead of String. This makes chaining methods easier.
82
82
  def split(*args)
83
- @string.split(*args).map { |i| i.chars }
83
+ @string.split(*args).map { |i| i.multibyte_chars }
84
84
  end
85
85
 
86
86
  # Gsub works exactly the same as gsub on a normal string.
87
- def gsub(*a, &b); @string.gsub(*a, &b).chars; end
87
+ def gsub(*a, &b); @string.gsub(*a, &b).multibyte_chars; end
88
88
 
89
89
  # Like String.=~ only it returns the character offset (in codepoints) instead of the byte offset.
90
90
  def =~(other)
@@ -114,7 +114,7 @@ module UnicodeMultibyte::Multibyte
114
114
  end
115
115
 
116
116
  if result.kind_of?(String)
117
- result.chars
117
+ result.multibyte_chars
118
118
  else
119
119
  result
120
120
  end
Binary file
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "unicode-multibyte"
6
- s.version = "0.2.5"
6
+ s.version = "0.2.6"
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Kevin Le"]
9
9
  s.email = ["kle@ooyala.com"]
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: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 5
10
- version: 0.2.5
9
+ - 6
10
+ version: 0.2.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Kevin Le
@@ -41,6 +41,7 @@ files:
41
41
  - Rakefile
42
42
  - setup.rb
43
43
  - unicode-multibyte-0.2.4.gem
44
+ - unicode-multibyte-0.2.5.gem
44
45
  - unicode-multibyte.gemspec
45
46
  - .project
46
47
  - .Rakefile.swp