string_pattern 1.1.1 → 1.1.2
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 +4 -4
- data/README.md +21 -20
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7cce1e48cb65359785eb5d36f0794e04da7ec95e97b16b07a0c3e47d5ed8e347
|
4
|
+
data.tar.gz: 0733b4a8abb8b182c229b6a2c5086b88c63656f942ce6debd0e19ae3a5c2156a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d53ffbec78b439ec29ebbff2f6bd5b95511da43a9a3bf6691d2e63ebb01bd4a7c9aef2e0025f2a4d39366c378d380d580bae6bb473d010487507d21cc64d882c
|
7
|
+
data.tar.gz: f448aefaf8fdf04b82cf0a37f6a174c7d0cc885e00eff726522ba18f48f59b70bffcb62834f7bcb72e177b517c27f6ccfd5720ed34f81b995c65261a1497ff03
|
data/README.md
CHANGED
@@ -48,31 +48,32 @@ A pattern is a string where we supply these elements "a-b:c" where a is min_leng
|
|
48
48
|
To generate a string following a pattern you can do it using directly the StringPattern class or the generate method in the class, be aware you can always use also the alias method: gen
|
49
49
|
|
50
50
|
```ruby
|
51
|
-
require 'string_pattern'
|
52
51
|
|
53
|
-
|
54
|
-
p StringPattern.generate "10:N"
|
55
|
-
#>3448910834
|
56
|
-
p StringPattern.gen "5:X"
|
57
|
-
#>JDDDK
|
52
|
+
require 'string_pattern'
|
58
53
|
|
59
|
-
#
|
60
|
-
p "
|
61
|
-
#>
|
54
|
+
#StringPattern class
|
55
|
+
p StringPattern.generate "10:N"
|
56
|
+
#>3448910834
|
57
|
+
p StringPattern.gen "5:X"
|
58
|
+
#>JDDDK
|
62
59
|
|
63
|
-
#
|
64
|
-
p
|
65
|
-
#>
|
60
|
+
#String class
|
61
|
+
p "4:Nx".gen
|
62
|
+
#>xaa3
|
66
63
|
|
67
|
-
#
|
68
|
-
p
|
69
|
-
#>
|
70
|
-
p "(,3:N,) ,3:N,-,2:N,-,2:N".split(',').generate
|
71
|
-
#>(937) 980-65-05
|
64
|
+
#Symbol class
|
65
|
+
p :"10:T".generate
|
66
|
+
#>AccBdjklñD
|
72
67
|
|
73
|
-
#
|
74
|
-
p
|
75
|
-
#>
|
68
|
+
#Array class
|
69
|
+
p [:"3:N", "fixed", :"3:N"].gen
|
70
|
+
#>334fixed920
|
71
|
+
p "(,3:N,) ,3:N,-,2:N,-,2:N".split(',').generate
|
72
|
+
#>(937) 980-65-05
|
73
|
+
|
74
|
+
#Kernel
|
75
|
+
p gen "3:N"
|
76
|
+
#>443
|
76
77
|
```
|
77
78
|
|
78
79
|
#### Custom characters
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: string_pattern
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mario Ruiz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: You can easily generate strings supplying a very simple pattern. Also
|
14
14
|
you can validate if a text fulfill an specific pattern or even generate a string
|