wcwidth 0.0.1 → 0.0.1.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.
Files changed (2) hide show
  1. data/lib/wcwidth.rb +4 -2
  2. metadata +1 -1
@@ -112,13 +112,15 @@ protected
112
112
 
113
113
  def mk_wcswidth
114
114
  ws = self.each_char.map(&:width)
115
- return -1 unless ws.select {|x| x < 0 }.empty?
115
+ return -1 unless ws.all?{|x|x>=0}
116
116
  ws.inject(:+)
117
117
  end
118
118
 
119
119
  public
120
120
  def width
121
- if self.size == 1
121
+ if self.size == 0
122
+ 0
123
+ elsif self.size == 1
122
124
  self.mk_wcwidth
123
125
  else
124
126
  self.mk_wcswidth
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wcwidth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: