reredos 0.1.0 → 0.1.1
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/README.md +8 -1
- data/lib/reredos/version.rb +1 -1
- data/lib/reredos.rb +4 -4
- 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: 8adfc52f2ddfb55c386adf71cfbc23e4e1401c5674b8dff8b157bd64fa30ce21
|
4
|
+
data.tar.gz: 2737d510279f2251ca065f82ba3e7caba691e8df37d08c405321197f11cbc78c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a6dbf7e9c48264672e305fddf747de7c50ec793cb383880ce51f8a1b06a0be57538a3845a7cf35790d8c93a1b75680ea644723ed07e5de7c59e7d22ecf1e88d
|
7
|
+
data.tar.gz: 4750b12690c7094542bf0a471eb94972aa6973144c9626e0b247bad8cd8471d2c8952a0283ac49eb391fad2e3873b6741c8410206ead0f1238ca472c8dac1e30
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -37,7 +37,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
37
37
|
|
38
38
|
## Contributing
|
39
39
|
|
40
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
40
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/expajp/reredos. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
41
41
|
|
42
42
|
## License
|
43
43
|
|
@@ -46,3 +46,10 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
46
46
|
## Code of Conduct
|
47
47
|
|
48
48
|
Everyone interacting in the Reredos project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/reredos/blob/master/CODE_OF_CONDUCT.md).
|
49
|
+
|
50
|
+
## Release Notes
|
51
|
+
### 0.1.1 - April 26, 2019
|
52
|
+
* Fixed a bug, that it accepted strings including new line
|
53
|
+
|
54
|
+
### 0.1.0 - April 24, 2019
|
55
|
+
* First Version
|
data/lib/reredos/version.rb
CHANGED
data/lib/reredos.rb
CHANGED
@@ -6,14 +6,14 @@ module Reredos
|
|
6
6
|
DOMAIN_MAX_LENGTH = 255 # ドメインの最大長
|
7
7
|
DOMAIN_LABEL_MAX_LENGTH = 63 # ドメインラベルの最大長
|
8
8
|
USERNAME_MAX_LENGTH = 64 # ユーザネームの最大長
|
9
|
-
|
9
|
+
|
10
10
|
class << self
|
11
11
|
def valid_email?(str)
|
12
12
|
return false if str.length > EMAIL_MAX_LENGTH
|
13
13
|
return false if str.count('@') != 1 # @は一度だけ
|
14
14
|
|
15
15
|
username, domain = str.split('@')
|
16
|
-
valid_username?(username) && valid_domain?(domain)
|
16
|
+
valid_username?(username) && valid_domain?(domain)
|
17
17
|
end
|
18
18
|
|
19
19
|
private
|
@@ -24,14 +24,14 @@ module Reredos
|
|
24
24
|
|
25
25
|
labels = str.split('.')
|
26
26
|
return false if labels.map(&:length).any?{ |_| _ > DOMAIN_LABEL_MAX_LENGTH }
|
27
|
-
return false unless labels.map{ |_|
|
27
|
+
return false unless labels.map{ |_| /\A[0-9a-zA-Z\-]+\z/ === _ }.all? # ラベルに含まれる文字が1文字以上の英数字orハイフン
|
28
28
|
|
29
29
|
true
|
30
30
|
end
|
31
31
|
|
32
32
|
def valid_username?(str)
|
33
33
|
return false if str.length > USERNAME_MAX_LENGTH
|
34
|
-
|
34
|
+
/\A[0-9a-zA-Z\.\+\-\_]+\z/ === str # 既定の文字のみで構成されている
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reredos
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- expajp
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-04-
|
11
|
+
date: 2019-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|