szm-chinese-name 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/chinese_name.rb +4 -2
  2. metadata +1 -1
@@ -1,10 +1,12 @@
1
1
  # encoding: utf-8
2
2
  module ChineseName
3
3
  class << self
4
- def generate(num=1000)
4
+ def generate(num=1000,last_name='',first_name='')
5
5
  names = []
6
6
  1.upto(num) do |i|
7
- names << [rand_string(last_names)+rand_string(first_names),rand_string(genders),rand_string(birth_years)]
7
+ lname = '' != last_name ? last_name : rand_string(last_names)
8
+ fname = '' != first_name ? first_name : rand_string(first_names)
9
+ names << [lname + fname,rand_string(genders),rand_string(birth_years)]
8
10
  end
9
11
  names
10
12
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: szm-chinese-name
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: