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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dc48c96f2816dc74555db0375be84de43f4b90ce4b3d2fee735169a0356641b6
4
- data.tar.gz: 00307c3d2c33780afe803fcf3869f87a7f0d02b37bafaf4d47a8d568b5a09228
3
+ metadata.gz: 82fbddc2a548cfad016f21e2a160319e639ee75a16baf98a80dfbcc344c38c9a
4
+ data.tar.gz: 037510e387bf5f54ef32d96fcf379206ecd3bec53d33dbd0387dc6fdcc78d8fd
5
5
  SHA512:
6
- metadata.gz: ad69acaec97a94da3bacbb836a6b72694b72deabdc0d8330543fe055016f85c3d5f44b99cb4a69e588328f5c87df3517215a4396fcbd2b44d6ac91a6c2966833
7
- data.tar.gz: 6ff492642a080b6e54379dc92fb5ac1d9650e39f3698faf4af5f2f9a9eaab2b6887526c6086b9dacc717a83b819a5c6b516a8fcc183920f1a3f1e5bad188385c
6
+ metadata.gz: ef2c8bf1a06014aa12e38a827d54a831fb71f727c142871229b6004894a761acb85b1b1d6746ac2c69a9505d04a5634d7af683eac6603c04c86ccd4d6d31aab9
7
+ data.tar.gz: 8fd0d4389c1391b5cbf030ab7be8feab92d4fc75ae6d01c7e5e6be973ca38aa8d89f11620056f7b419e8ac38c8aab201ce7c6d0f8db44e29449d65cac5c8d02c
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- regeng (0.2.1d)
4
+ regeng (0.2.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,3 +1,6 @@
1
+ [12-11-18][0.2.2]: Now can use .new to mimic Regex behaviour.
2
+ Slightly expanded functionality.
3
+
1
4
  [12-11-18][0.2.1d]: Dev Build: At modifiers and simple digit expressions.
2
5
 
3
6
  [12-10-18][0.2.0d]: Dev Build: Refactored gem, refactored character functionality.
@@ -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
- # elsif /( ([a-z] )+(and )([a-z]))/.match?(string)
72
- # unfiltered_mod = string.match(/( ([a-z] )+(and )([a-z]))/)
73
- # digit_mod = unfiltered_mod.to_s.gsub(/( )|(and )/, '')
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
@@ -1,3 +1,3 @@
1
1
  module Regeng
2
- VERSION = "0.2.1d"
2
+ VERSION = "0.2.2"
3
3
  end
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.1d
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: 1.3.1
97
+ version: '0'
98
98
  requirements: []
99
99
  rubyforge_project:
100
100
  rubygems_version: 2.7.8