unicode_alphanumeric 0.0.0 → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/unicode_alphanumeric.rb +5 -1
  2. metadata +1 -1
@@ -30,7 +30,11 @@ module UnicodeAlphanumeric
30
30
  def self.alphanumeric?(char, options)
31
31
  # If there's any intersection between the string's categories and the alphanumeric
32
32
  # categories, then the character is alphanumeric.
33
- !(alphanumeric_categories(options) & Unicode.categories(char)).empty?
33
+ #
34
+ # If we're using the :include options, we also have to check against that.
35
+ !(alphanumeric_categories(options) & Unicode.categories(char)).empty? or
36
+ (options[:include].is_a?(Array) and options[:include].include?(char)) or
37
+ (options[:include].is_a?(Regexp) and options[:include] =~ char)
34
38
  end
35
39
 
36
40
  def self.alphanumeric_categories(options)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unicode_alphanumeric
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: