reredos 0.1.2 → 0.1.3

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
  SHA256:
3
- metadata.gz: 3547add122783213f2b2d21781effdcdbccf443b46faefcbbc8040896b3604e9
4
- data.tar.gz: 92f229dfe56e23bd74a0b722f8cd200f5e8631abf37821d749cc56a55f7c97e9
3
+ metadata.gz: 898f18a20f81383845d12f4ff7d9997c52ac5e16ca2719fa8b2494cac434149f
4
+ data.tar.gz: 479584a5c5726ad12dd821f19d9534945e3a5ec961ba4998d387f4fe15664934
5
5
  SHA512:
6
- metadata.gz: 899fe67f6ea0adfcc74e257313f09f383accff312b8c701fded469fa8bd81f28d0a95ac1bc42626580666f7234a1edfc2e58c213237e47a8dcf93071152e2d91
7
- data.tar.gz: fc9c2e4c6a6ea49b129cb85c52c3f595b197554c0b4b1282441333997d9fb8a76978e2f6d6112c7457bf231b1929bbf3c37ac2912665b9b0cac4930f7e6a344b
6
+ metadata.gz: e1cc5e9f7ec3cc449b3e7d3dc25737b526f79a0c304b346831077435ce9ab90a61dae1f91d7a475b24d68cef172379a2d4acd5223218ac2f926e641e00d8c260
7
+ data.tar.gz: a7f4d9b9b1e83bc911d0ddc8c7d0d965fa462e6aa182c884d104ab873df2422f482a13455ddcfae32c06f9a5583bf886ea12e1174d9cb935f1c2f755bdf00676
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- reredos (0.1.2)
4
+ reredos (0.1.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -48,6 +48,12 @@ The gem is available as open source under the terms of the [MIT License](https:/
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
49
 
50
50
  ## Release Notes
51
+ ### 0.1.3 - August 4, 2019
52
+ * Fixed bugs below:
53
+ * it accepted consecutive dots
54
+ * it accepted dots as first or last character of domain
55
+ * The limit for the number of characters of email address changes from 256 to 254
56
+
51
57
  ### 0.1.2 - July 29, 2019
52
58
  * Fixed a bug, that it accepted dots as first or last character of username
53
59
 
@@ -2,8 +2,8 @@ require "reredos/version"
2
2
 
3
3
  module Reredos
4
4
  class Error < StandardError; end
5
- EMAIL_MAX_LENGTH = 256 # メールアドレスの最大長
6
- DOMAIN_MAX_LENGTH = 255 # ドメインの最大長
5
+ EMAIL_MAX_LENGTH = 254 # メールアドレスの最大長
6
+ DOMAIN_MAX_LENGTH = 253 # ドメインの最大長
7
7
  DOMAIN_LABEL_MAX_LENGTH = 63 # ドメインラベルの最大長
8
8
  USERNAME_MAX_LENGTH = 64 # ユーザネームの最大長
9
9
 
@@ -20,14 +20,14 @@ module Reredos
20
20
 
21
21
  def valid_domain?(str)
22
22
  return false if str.length > DOMAIN_MAX_LENGTH
23
- return false unless str.split('.').all? { |l| valid_label?(l) }
23
+ return false unless str.split('.', -1).all? { |l| valid_label?(l) }
24
24
 
25
25
  true
26
26
  end
27
27
 
28
28
  def valid_username?(str)
29
29
  return false if str.length > USERNAME_MAX_LENGTH
30
- return false if str[0] == '.' || str[-1] == '.'
30
+ return false if str.split('.', -1).any?(&:empty?)
31
31
  /\A[0-9a-zA-Z\.\+\-\_]+\z/ === str # 既定の文字のみで構成されている
32
32
  end
33
33
 
@@ -1,3 +1,3 @@
1
1
  module Reredos
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  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.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - expajp
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-07-29 00:00:00.000000000 Z
11
+ date: 2019-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler