randwordjp 0.0.21 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/README.md +4 -0
- data/lib/randwordjp/version.rb +1 -1
- data/lib/randwordjp.rb +8 -7
- data/spec/randwordjp_spec.rb +4 -0
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb1ca76f0f910e330d40515dee01806e0a03374f
|
4
|
+
data.tar.gz: ccecb3122bda7e03c3db8d276c0aff7be00b0fa5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1afd2dca9cac21e56741c458fb70e15cb3ca9824d55faaa120590748f60ff2501f04ba96c3e5a078780304cfc7edf20dea08a157347c3ba824d46dc908eca386
|
7
|
+
data.tar.gz: 556630b5eb3e669e4a9952629f87928afe6effd7ea27bea476f5941e897bfae9911cca99ab836b6d49f9e01c93588e7224f08c086a0479ee5b6a7a88f3cc7261
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.2.
|
1
|
+
2.2.1
|
data/README.md
CHANGED
@@ -4,10 +4,14 @@ randwordjp is a library for outputting the data of the Japanese at random .
|
|
4
4
|
|
5
5
|
randowrjp output the myoji, namae , Japanese postal code, Japanese state .
|
6
6
|
|
7
|
+
You use as faker during the creation of the test data.
|
8
|
+
|
7
9
|
randwordjpはランダムで日本語のデータを出力するためのライブラリです。
|
8
10
|
|
9
11
|
randowrjpは日本語の名前、苗字、日本の郵便番号、都道府県、などの出力を行うことができます。
|
10
12
|
|
13
|
+
テストデータの作成時にfakerのように利用してください。
|
14
|
+
|
11
15
|
## Installation
|
12
16
|
Randwordjp is require sqlite3 adapter and sequel.
|
13
17
|
|
data/lib/randwordjp/version.rb
CHANGED
data/lib/randwordjp.rb
CHANGED
@@ -118,13 +118,14 @@ module Randwordjp
|
|
118
118
|
end
|
119
119
|
|
120
120
|
# メールアドレス風の文字列を取得する。
|
121
|
-
# @param [
|
122
|
-
# @
|
123
|
-
# @
|
124
|
-
# @
|
125
|
-
|
126
|
-
|
127
|
-
|
121
|
+
# @param [Hash] opts オプション指定
|
122
|
+
# @option opts [Integer] :local_length ローカルパートの文字列長
|
123
|
+
# @option opts [Integer] :domain_length ドメインパートの文字列長
|
124
|
+
# @option opts [String] :randword トップレベルドメインの文字列を指定する。
|
125
|
+
# @return [String] メールアドレスを取得する
|
126
|
+
def self.mail_address(opts ={domain: 'rand', local_length: 10, domain_length: 10})
|
127
|
+
local_part = alphanumeric_plus(rand(opts[:local_length]) + 1)
|
128
|
+
domain_part = alphanumeric(rand(opts[:domain_length]) + 1) + '.' + opts[:domain]
|
128
129
|
local_part + '@' + domain_part
|
129
130
|
end
|
130
131
|
|
data/spec/randwordjp_spec.rb
CHANGED
@@ -18,6 +18,10 @@ describe Randwordjp do
|
|
18
18
|
expect(Randwordjp.numeric(10)).not_to eq(Randwordjp.numeric(10))
|
19
19
|
end
|
20
20
|
|
21
|
+
it 'mail_address is not nil' do
|
22
|
+
expect(Randwordjp.mail_address).not_to be nil
|
23
|
+
end
|
24
|
+
|
21
25
|
describe 'zenkaku_katakana' do
|
22
26
|
it 'zenkaku_katakana length is should have set length' do
|
23
27
|
expect(Randwordjp.zenkaku_katakana(15).length).to be 15
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: randwordjp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- inpwjp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sequel
|
@@ -116,4 +116,3 @@ summary: get Japanese random string.
|
|
116
116
|
test_files:
|
117
117
|
- spec/randwordjp_spec.rb
|
118
118
|
- spec/spec_helper.rb
|
119
|
-
has_rdoc:
|