reredos 0.1.0 → 0.1.1

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: 36a9057cede04ed3614748f4da85211fd307f2cbf91ece188cd53bf81a4ba995
4
- data.tar.gz: 3ea5b517e25547831aa86ab090c31ac6c196209a90ef62e1f6a166701b820311
3
+ metadata.gz: 8adfc52f2ddfb55c386adf71cfbc23e4e1401c5674b8dff8b157bd64fa30ce21
4
+ data.tar.gz: 2737d510279f2251ca065f82ba3e7caba691e8df37d08c405321197f11cbc78c
5
5
  SHA512:
6
- metadata.gz: d41226288b39bb6dc500f12ff77a6ff7b203908b67b54f3fd6140dd2c988c5d7693d68828201dc75c7ce7dbde1344c4f4ee08448c4f310e6b225e4a9a4ebc1a8
7
- data.tar.gz: 434fdca640a9a237807601998d45ce0f73bc622c6520bfc40db6cbe955c12822823c182f62ba28a806329a03ec9644523af348a337dee17dd9f4d8e1ce8f98ea
6
+ metadata.gz: 5a6dbf7e9c48264672e305fddf747de7c50ec793cb383880ce51f8a1b06a0be57538a3845a7cf35790d8c93a1b75680ea644723ed07e5de7c59e7d22ecf1e88d
7
+ data.tar.gz: 4750b12690c7094542bf0a471eb94972aa6973144c9626e0b247bad8cd8471d2c8952a0283ac49eb391fad2e3873b6741c8410206ead0f1238ca472c8dac1e30
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- reredos (0.1.0)
4
+ reredos (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
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/[USERNAME]/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.
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
@@ -1,3 +1,3 @@
1
1
  module Reredos
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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{ |_| /^[0-9a-zA-Z\-]+$/ === _ }.all? # ラベルに含まれる文字が1文字以上の英数字orハイフン
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
- /^[0-9a-zA-Z\.\+\-\_]+$/ === str # 既定の文字のみで構成されている
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.0
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-24 00:00:00.000000000 Z
11
+ date: 2019-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler