more_core_extensions 3.4.0 → 3.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +6 -1
- data/README.md +1 -0
- data/lib/more_core_extensions/core_ext/string/formats.rb +6 -0
- data/lib/more_core_extensions/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9fbc683524ab095292135f1e72a3821081619dacd00c22f288cb0be196805fcf
|
4
|
+
data.tar.gz: d3ecf6bf8139048d076dcdde8cbb0131de4e32b16a0639546e8ed6c973f05b69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d52dd55d311849be201414a061eb3950c7976ca69118d941238680c3e5162e9a8aaf8a292ddc17dd5d2681fd0ae5fc8e575485c5f91e2f8ae0527683d79524d
|
7
|
+
data.tar.gz: 175c56d081ec129ada8b131d135a880b680301eb50f96fde6f3b804e52587bc42219ba607cc1b1ffd963f7a88c22aa38b7def00aee8fa1e207c1761bb029be5d
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
4
4
|
|
5
5
|
## [Unreleased]
|
6
6
|
|
7
|
+
## [3.5.0] - 2017-12-29
|
8
|
+
### Added
|
9
|
+
- Added String#hostname? [[#58](https://github.com/ManageIQ/more_core_extensions/pull/58)]
|
10
|
+
|
7
11
|
## [3.4.0] - 2017-08-11
|
8
12
|
### Added
|
9
13
|
- Added Module#cache_with_timeout [[#51](https://github.com/ManageIQ/more_core_extensions/pull/51)]
|
@@ -53,7 +57,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
53
57
|
- Upgraded to RSpec 3 [[#16](https://github.com/ManageIQ/more_core_extensions/pull/16)]
|
54
58
|
- Added the Change Log!
|
55
59
|
|
56
|
-
[Unreleased]: https://github.com/ManageIQ/more_core_extensions/compare/v3.
|
60
|
+
[Unreleased]: https://github.com/ManageIQ/more_core_extensions/compare/v3.5.0...HEAD
|
61
|
+
[3.5.0]: https://github.com/ManageIQ/more_core_extensions/compare/v3.4.0...v3.5.0
|
57
62
|
[3.4.0]: https://github.com/ManageIQ/more_core_extensions/compare/v3.3.0...v3.4.0
|
58
63
|
[3.3.0]: https://github.com/ManageIQ/more_core_extensions/compare/v3.2.0...v3.3.0
|
59
64
|
[3.2.0]: https://github.com/ManageIQ/more_core_extensions/compare/v3.1.1...v3.2.0
|
data/README.md
CHANGED
@@ -92,6 +92,7 @@ MoreCoreExtensions are a set of core extensions beyond those provided by ActiveS
|
|
92
92
|
* core_ext/string/formats.rb
|
93
93
|
* `#email?` - Returns whether or not the String is an= valid email
|
94
94
|
* `#domain_name?` - Returns whether or not the String is a valid domain name
|
95
|
+
* `#hostname?` - Returns whether or not the String is a valid hostname
|
95
96
|
* `#ipv4?` - Returns whether or not the String is an IPv4 address
|
96
97
|
* `#ipv6?` - Returns whether or not the String is an IPv6 address
|
97
98
|
* `#ipaddress?` - Returns whether or not the String is an IPv4 or IPv6 address
|
@@ -13,6 +13,12 @@ module MoreCoreExtensions
|
|
13
13
|
!!(self =~ RE_DOMAINNAME)
|
14
14
|
end
|
15
15
|
|
16
|
+
# Based on RFC 1034
|
17
|
+
RE_HOSTNAME = %r{^((?![0-9]*$)+(?![0-9]*\.))(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])$}i
|
18
|
+
def hostname?
|
19
|
+
!!(self =~ RE_HOSTNAME)
|
20
|
+
end
|
21
|
+
|
16
22
|
# From: Regular Expression Cookbook: 7.16 Matching IPv4 Addresses
|
17
23
|
RE_IPV4 = %r{^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$}
|
18
24
|
def ipv4?
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: more_core_extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Frey
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-12-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -188,7 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
188
188
|
version: '0'
|
189
189
|
requirements: []
|
190
190
|
rubyforge_project:
|
191
|
-
rubygems_version: 2.
|
191
|
+
rubygems_version: 2.7.2
|
192
192
|
signing_key:
|
193
193
|
specification_version: 4
|
194
194
|
summary: MoreCoreExtensions are a set of core extensions beyond those provided by
|