regeng 0.2.1d → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/changelog.md +3 -0
- data/lib/regeng.rb +11 -4
- data/lib/regeng/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82fbddc2a548cfad016f21e2a160319e639ee75a16baf98a80dfbcc344c38c9a
|
4
|
+
data.tar.gz: 037510e387bf5f54ef32d96fcf379206ecd3bec53d33dbd0387dc6fdcc78d8fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef2c8bf1a06014aa12e38a827d54a831fb71f727c142871229b6004894a761acb85b1b1d6746ac2c69a9505d04a5634d7af683eac6603c04c86ccd4d6d31aab9
|
7
|
+
data.tar.gz: 8fd0d4389c1391b5cbf030ab7be8feab92d4fc75ae6d01c7e5e6be973ca38aa8d89f11620056f7b419e8ac38c8aab201ce7c6d0f8db44e29449d65cac5c8d02c
|
data/Gemfile.lock
CHANGED
data/changelog.md
CHANGED
data/lib/regeng.rb
CHANGED
@@ -10,10 +10,14 @@ module Regeng
|
|
10
10
|
CHARACTER_SIMP = /((any )?((uppercase )?|(lowercase )?)(character)(s)?){1}/.freeze
|
11
11
|
|
12
12
|
DIGIT_COND = /((any )?((digit)|(number))(s)?( except)?( between)?( [0-9])+((-)|( through )|( to )|( and )){1}[0-9]){1}/.freeze
|
13
|
-
DIGIT_SIMPLE = /(any ((digit)|(number))){1}/.freeze
|
13
|
+
DIGIT_SIMPLE = /(any ((digit)|(number))(s)?){1}/.freeze
|
14
14
|
|
15
15
|
AT_COND = /( at )((start)|(end))( of )((line)|(string))/.freeze
|
16
16
|
|
17
|
+
def self.new(string)
|
18
|
+
expression(string)
|
19
|
+
end
|
20
|
+
|
17
21
|
def self.expression(string)
|
18
22
|
expression = ''
|
19
23
|
if CHARACTER_COND.match?(string)
|
@@ -39,6 +43,9 @@ module Regeng
|
|
39
43
|
elsif /( ([a-z])(( through )|( to ))(([a-z])))/i.match?(string)
|
40
44
|
unfiltered_mod = string.match(/(([a-z])(( through )|( to ))(([a-z])))/)
|
41
45
|
character_mod = unfiltered_mod.to_s.sub(/( through )|( to )/, '-')
|
46
|
+
elsif /((between) ([a-z])( and )([a-z]))/.match?(string)
|
47
|
+
unfiltered_mod = string.match(/(([a-z])( and )([a-z]))/)
|
48
|
+
character_mod = unfiltered_mod.to_s.sub(/( and )/, '-')
|
42
49
|
elsif /( ([a-z] )+(and )([a-z]))/.match?(string)
|
43
50
|
unfiltered_mod = string.match(/( ([a-z] )+(and )([a-z]))/)
|
44
51
|
character_mod = unfiltered_mod.to_s.gsub(/( )|(and )/, '')
|
@@ -68,9 +75,9 @@ module Regeng
|
|
68
75
|
elsif /((between) ([0-9])( and )([0-9]))/.match?(string)
|
69
76
|
unfiltered_mod = string.match(/(([0-9])( and )([0-9]))/)
|
70
77
|
digit_mod = unfiltered_mod.to_s.sub(/( and )/, '-')
|
71
|
-
|
72
|
-
|
73
|
-
|
78
|
+
elsif /( ([0-9] )+(and )([0-9])+)/.match?(string)
|
79
|
+
unfiltered_mod = string.match(/( ([0-9] )+(and )([0-9]))/)
|
80
|
+
digit_mod = unfiltered_mod.to_s.gsub(/( )|(and )/, '')
|
74
81
|
end
|
75
82
|
"[#{except}#{digit_mod}]#{multiples}"
|
76
83
|
end
|
data/lib/regeng/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: regeng
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- LucHighwalker
|
@@ -92,9 +92,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
92
92
|
version: '0'
|
93
93
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
|
-
- - "
|
95
|
+
- - ">="
|
96
96
|
- !ruby/object:Gem::Version
|
97
|
-
version:
|
97
|
+
version: '0'
|
98
98
|
requirements: []
|
99
99
|
rubyforge_project:
|
100
100
|
rubygems_version: 2.7.8
|