unicode_alphanumeric 0.0.0 → 0.0.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/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: