textoken 1.1.2 → 1.2.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.
- checksums.yaml +5 -5
- data/lib/textoken.rb +1 -0
- data/lib/textoken/compat.rb +1 -0
- data/lib/textoken/errors.rb +2 -5
- data/lib/textoken/findings.rb +2 -2
- data/lib/textoken/options/modules/numeric_option.rb +1 -1
- data/lib/textoken/scanner.rb +1 -1
- data/lib/textoken/version.rb +1 -1
- metadata +4 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: b0cfe84f8bc1d0242712a0a18f783e6993dce951c979dd9ea0d8b49d907b23fb
|
|
4
|
+
data.tar.gz: b646571be4e46d9dbc422ab172ce43c83a1e176c9880aaec1c650c44636400ae
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b75953124e3f380841bcbeb851508c0377b793dbd87e41af1bfe86c0ac5963b7330b4013c6979541bef378d7aa017aefc46dfd50b12408394f3fe7e6e4cd253b
|
|
7
|
+
data.tar.gz: b756c2ccb9e1e4b657b6850530938c3d37046bc1b00c0b5858ee8b4e903e5c7ede165a7dea66b83a141618a81736b4ce0f97aa006035530167d2759385bd62dc
|
data/lib/textoken.rb
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
IntClass = defined?(RUBY_VERSION) && RUBY_VERSION > "2.4" ? Integer : Fixnum
|
data/lib/textoken/errors.rb
CHANGED
data/lib/textoken/findings.rb
CHANGED
|
@@ -16,7 +16,7 @@ module Textoken
|
|
|
16
16
|
|
|
17
17
|
# collection will return a sorted and unique array of tokens
|
|
18
18
|
def collection
|
|
19
|
-
@collection.uniq { |w| w[0]
|
|
19
|
+
@collection.uniq { |w| "#{w[0]}#{w[1]}" }.sort_by(&:first)
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
# result will return a one dimensional array of words
|
|
@@ -27,7 +27,7 @@ module Textoken
|
|
|
27
27
|
private
|
|
28
28
|
|
|
29
29
|
def type_check(i, word)
|
|
30
|
-
return if word.is_a?(String) && (i.is_a?(
|
|
30
|
+
return if word.is_a?(String) && (i.is_a?(IntClass) || i.is_a?(Float))
|
|
31
31
|
Textoken.type_err("#{word} and #{i} has to be a String and Integer")
|
|
32
32
|
end
|
|
33
33
|
end
|
|
@@ -25,7 +25,7 @@ module Textoken
|
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
def validate(&code)
|
|
28
|
-
return if number.class ==
|
|
28
|
+
return if number.class == IntClass && code.call(number)
|
|
29
29
|
Textoken.expression_err "value #{number} is not permitted for
|
|
30
30
|
#{self.class.name} option."
|
|
31
31
|
end
|
data/lib/textoken/scanner.rb
CHANGED
data/lib/textoken/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: textoken
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1
|
|
4
|
+
version: 1.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mehmet Cetin
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2019-05-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rspec
|
|
@@ -50,6 +50,7 @@ files:
|
|
|
50
50
|
- Rakefile
|
|
51
51
|
- lib/textoken.rb
|
|
52
52
|
- lib/textoken/base.rb
|
|
53
|
+
- lib/textoken/compat.rb
|
|
53
54
|
- lib/textoken/errors.rb
|
|
54
55
|
- lib/textoken/factories/option_factory.rb
|
|
55
56
|
- lib/textoken/findings.rb
|
|
@@ -88,10 +89,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
88
89
|
- !ruby/object:Gem::Version
|
|
89
90
|
version: '0'
|
|
90
91
|
requirements: []
|
|
91
|
-
|
|
92
|
-
rubygems_version: 2.5.1
|
|
92
|
+
rubygems_version: 3.0.3
|
|
93
93
|
signing_key:
|
|
94
94
|
specification_version: 4
|
|
95
95
|
summary: Simple and customizable text tokenization gem.
|
|
96
96
|
test_files: []
|
|
97
|
-
has_rdoc:
|