randwordjp 0.0.21 → 0.1.0

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
  SHA1:
3
- metadata.gz: 8591b4ec29aec7d2f89048f7c22b03e32c543fcc
4
- data.tar.gz: 1eed2c643f3ed499a63e2a278b5a6d6458eddeeb
3
+ metadata.gz: eb1ca76f0f910e330d40515dee01806e0a03374f
4
+ data.tar.gz: ccecb3122bda7e03c3db8d276c0aff7be00b0fa5
5
5
  SHA512:
6
- metadata.gz: b0a6065ccc060b900d7cc94a79da963d55f90be670d028ef276029fedd8de38e8e4cf8153cd99c185473c03a87fd1ff978ab19d280064deb8042e5b0cbb6fc89
7
- data.tar.gz: 91e54c0e89ff2c2debe2be8ba085b26640949706213c0ed552c52553dc341175d3d9b9b0e0ddaa16e1a000cef221b833f63ace259c5f9811e69c6ef3389b4cba
6
+ metadata.gz: 1afd2dca9cac21e56741c458fb70e15cb3ca9824d55faaa120590748f60ff2501f04ba96c3e5a078780304cfc7edf20dea08a157347c3ba824d46dc908eca386
7
+ data.tar.gz: 556630b5eb3e669e4a9952629f87928afe6effd7ea27bea476f5941e897bfae9911cca99ab836b6d49f9e01c93588e7224f08c086a0479ee5b6a7a88f3cc7261
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.2.0
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
 
@@ -2,5 +2,5 @@
2
2
  # ランダムで日本語文字列などを生成するライブラリとなります。
3
3
  # can get random words(sentence).
4
4
  module Randwordjp
5
- VERSION = '0.0.21'
5
+ VERSION = '0.1.0'
6
6
  end
data/lib/randwordjp.rb CHANGED
@@ -118,13 +118,14 @@ module Randwordjp
118
118
  end
119
119
 
120
120
  # メールアドレス風の文字列を取得する。
121
- # @param [String] randword トップレベルドメインの文字列を指定する。
122
- # @param [Integer] local_length ローカルパートの文字列長
123
- # @param [Integer] domain_length ドメインパートの文字列長
124
- # @return [String] lengthで指定した文字列長の文字列
125
- def self.mail_address(randword = 'rand', local_length = 10, domain_length = 10)
126
- local_part = alphanumeric_plus(rand(local_length) + 1)
127
- domain_part = alphanumeric(rand(domain_length) + 1) + '.' + randword
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
 
@@ -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.21
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-04-28 00:00:00.000000000 Z
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: