regxlib 0.1.3 → 0.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f9f22c57a3a645ee32d64fbffd2c335fb2cdf51
4
- data.tar.gz: 1e8c356843e6cf3eaca5c2f92c903afd22a2bcff
3
+ metadata.gz: 3d7ca0535703135cb3758bd0bc6b65d5aedbc999
4
+ data.tar.gz: b53d64090de584955fcf327f0d89471a1d10926e
5
5
  SHA512:
6
- metadata.gz: 4c6f24d57d67f915bdb8b009596b87193cfd65fca87f82c6047e5f7483a6f8644f7b3dfbe6a245f1ec3ef15a51ecb4beb15953c03618f87e4afa9200f15c4462
7
- data.tar.gz: 3ab584fa5dc9b243fcacb5c5415eb55b75aafff986ad1b4fa69fff6d378f3f33013a0a9db2711417bdd2ef13e1d3c906b0fe832aa685bc73d6da624ee55bf40f
6
+ metadata.gz: 7280b86b8ed8227c6b99df2d689c17eed389d72de964240a1080778409d154dc81a8499731e10b612fa4cbe752b7d729f7c2f1f0f16b20946f737202b6e2599e
7
+ data.tar.gz: 703f09acb37e477d5a667d3176646ac27aa057e62ada6422b7ffab35a53989ba8c4398db5e522c4558e5462a88c262ebde4119338d15b1e9810e4b63505cefea
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  ![GitHub](https://img.shields.io/github/license/zviaz/regxlib.svg?color=blue)
5
5
 
6
6
  ##### Code Climate
7
- [![Maintainability](https://api.codeclimate.com/v1/badges/a4b7d56b3f4f356ea170/maintainability)](https://codeclimate.com/github/zviaz/regxlib/maintainability)
7
+ [![Maintainability](https://api.codeclimate.com/v1/badges/c2281cdff2fc6af44463/maintainability)](https://codeclimate.com/github/zviaz/regxlib/maintainability)
8
8
  ![Code Climate maintainability (percentage)](https://img.shields.io/codeclimate/maintainability-percentage/zviaz/regxlib.svg)
9
9
  ![Code Climate technical debt](https://img.shields.io/codeclimate/tech-debt/zviaz/regxlib.svg)
10
10
  ![Code Climate issues](https://img.shields.io/codeclimate/issues/zviaz/regxlib.svg)
@@ -24,5 +24,10 @@ The gem is available as open source under the terms of the [MIT License](https:/
24
24
  * [Regxlib::Email.standard](/docs/regex_library/email/regxlib_email_standard.md)
25
25
  * [Regxlib::Email.org](/docs/regex_library/email/regxlib_email_org.md)
26
26
  * [Regxlib::Email.edu](/docs/regex_library/email/regxlib_email_edu.md)
27
+ * [Regxlib::Email.co_uk_com](/docs/regex_library/email/regxlib_email_co_uk_com.md)
27
28
  * [Regxlib::Email.com](/docs/regex_library/email/regxlib_email_com.md)
28
- * [Regxlib::Email.co_uk](/docs/regex_library/email/regxlib_email_co_uk.md)
29
+ * [Regxlib::Email.co_uk](/docs/regex_library/email/regxlib_email_co_uk.md)
30
+
31
+ ### String
32
+ * [Regxlib::String.char_nospace](/docs/regex_library/string/regxlib_string_char_nospace.md)
33
+ * [Regxlib::String.num_nospace](/docs/regex_library/string/regxlib_string_num_nospace.md)
@@ -0,0 +1,15 @@
1
+ ## Regxlib::Email.co_uk_com
2
+
3
+ Regular expression that checks the email ends with .co.uk or .com
4
+
5
+ Regex Pattern: /\A[\w+-.]+@[a-z\d\-.]+\.([c]+[o]+\.[u]+[k]|[c]+[o]+[m])+\z/i
6
+
7
+ | Example | Result |
8
+ |-|-|
9
+ | `User_name@email.co.uk` | Pass |
10
+ | `user.name@email.com` | Pass |
11
+ | `user@website-url.co.uk` | Pass |
12
+ | `user-name@email.com` | Pass |
13
+ | `name@!email.com` | Fail |
14
+ | `name@_email.co.uk` | Fail |
15
+ | `random^name@email.co.uk` | Fail |
@@ -0,0 +1,13 @@
1
+ ## Regxlib::String.char_nospace
2
+
3
+ Regular expression to check for a string of characters (a-z) with no spaces.
4
+
5
+ Regex Pattern: /\A[a-zA-Z]+\z/i
6
+
7
+ | Example | Result |
8
+ |-|-|
9
+ | example | Pass |
10
+ | Example | Pass |
11
+ | example two | Fail |
12
+ | example3 | Fail |
13
+ | example_ | Fail |
@@ -0,0 +1,12 @@
1
+ ## Regxlib::String.num_nospace
2
+
3
+ Regular expression to check for a string of numbers with no spaces.
4
+
5
+ Regex Pattern: /\A[0123456789]+\z/i
6
+
7
+ | Example | Result |
8
+ |-|-|
9
+ | 123 | Pass |
10
+ | 234 567 | Fail |
11
+ | example3 | Fail |
12
+ | 1122_33 | Fail |
data/lib/regxlib.rb CHANGED
@@ -48,6 +48,11 @@ module Regxlib
48
48
  /\A[\w+-.]+@[a-z\d\-.]+\.[e]+[d]+[u]+\z/i
49
49
  end
50
50
 
51
+ # Regxlib::Email.co_uk_com
52
+ def self.co_uk_com
53
+ /\A[\w+-.]+@[a-z\d\-.]+\.([c]+[o]+\.[u]+[k]|[c]+[o]+[m])+\z/i
54
+ end
55
+
51
56
  # Regxlib::Email.com
52
57
  def self.com
53
58
  /\A[\w+-.]+@[a-z\d\-.]+\.[c]+[o]+[m]+\z/i
@@ -61,4 +66,18 @@ module Regxlib
61
66
  end
62
67
  # [END] Regxlib::Email ##############
63
68
 
69
+ # [START] Regxlib::String ##############
70
+
71
+ # Regxlib::String.char_nospace
72
+ def self.char_nospace
73
+ /\A[a-zA-Z]+\z/i
74
+ end
75
+
76
+ # Regxlib::String.num_nospace
77
+ def self.num_nospace
78
+ /\A[0123456789]+\z/i
79
+ end
80
+
81
+ # [END] Regxlib::String ##############
82
+
64
83
  end
@@ -1,3 +1,3 @@
1
1
  module Regxlib
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: regxlib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Speight
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-04-08 00:00:00.000000000 Z
11
+ date: 2019-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -70,10 +70,13 @@ files:
70
70
  - bin/console
71
71
  - bin/setup
72
72
  - docs/regex_library/email/regxlib_email_co_uk.md
73
+ - docs/regex_library/email/regxlib_email_co_uk_com.md
73
74
  - docs/regex_library/email/regxlib_email_com.md
74
75
  - docs/regex_library/email/regxlib_email_edu.md
75
76
  - docs/regex_library/email/regxlib_email_org.md
76
77
  - docs/regex_library/email/regxlib_email_standard.md
78
+ - docs/regex_library/string/regxlib_string_char_nospace.md
79
+ - docs/regex_library/string/regxlib_string_num_nospace.md
77
80
  - docs/regex_library/username/regxlib_username_standard.md
78
81
  - docs/regex_library/username/regxlib_username_standard_nonum.md
79
82
  - docs/regex_library/username/regxlib_username_strict.md