data_maker 2.4.2 → 2.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/data_maker.gemspec +5 -2
- data/lib/data_maker/cn/employment.rb +13 -0
- data/lib/data_maker/data/cn/employment/job_titles +62 -0
- data/lib/data_maker/locales/zh.employment.yml +66 -0
- data/lib/data_maker/locales/{zh.yml → zh.regions.yml} +0 -0
- data/lib/data_maker/version.rb +1 -1
- data/spec/lib/data_maker/cn/employment_spec.rb +11 -0
- data/spec/lib/data_maker/data_maker_spec.rb +1 -1
- metadata +8 -4
- data/lib/data_maker/validators/chinese_phone_number.rb +0 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8b98ff04a1cd761ddc0344a7a81681a158256f0
|
4
|
+
data.tar.gz: 1913251c4b0d1ea5cb59ed7d49d05a1e097e88da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7753b14e40a7ace79bbefbfdb3aafa586483f71df7fa6b643752a9094bf260665af24e978df255e94fdd3b78e8d0e6a56a0318e1941128690b0f515564c2397b
|
7
|
+
data.tar.gz: 9ad8077a3991dd772ab3be460d0cd0a769732e4d3b6706d3324288a5ade9c7464c50853a9001a8c7f253d69e7396621d8a9ab75fd5335e7efb4999e20869cd79
|
data/data_maker.gemspec
CHANGED
@@ -51,6 +51,7 @@ Gem::Specification.new do |gem|
|
|
51
51
|
data_maker.gemspec
|
52
52
|
lib/data_maker.rb
|
53
53
|
lib/data_maker/cn/address.rb
|
54
|
+
lib/data_maker/cn/employment.rb
|
54
55
|
lib/data_maker/cn/name.rb
|
55
56
|
lib/data_maker/cn/nin.rb
|
56
57
|
lib/data_maker/cn/phone_number.rb
|
@@ -442,20 +443,22 @@ Gem::Specification.new do |gem|
|
|
442
443
|
lib/data_maker/data/cn/address/zunyi_districts
|
443
444
|
lib/data_maker/data/cn/cities_chinese
|
444
445
|
lib/data_maker/data/cn/districts_chinese
|
446
|
+
lib/data_maker/data/cn/employment/job_titles
|
445
447
|
lib/data_maker/data/cn/name/first_names
|
446
448
|
lib/data_maker/data/cn/name/last_names
|
447
449
|
lib/data_maker/data/cn/phone_number/landline_phone_prefixes
|
448
450
|
lib/data_maker/data/cn/phone_number/mobile_phone_prefixes
|
449
451
|
lib/data_maker/data/cn/provinces_chinese
|
450
|
-
lib/data_maker/locales/zh.yml
|
452
|
+
lib/data_maker/locales/zh.employment.yml
|
453
|
+
lib/data_maker/locales/zh.regions.yml
|
451
454
|
lib/data_maker/modulator.rb
|
452
455
|
lib/data_maker/utilities/array_utilities.rb
|
453
456
|
lib/data_maker/utilities/module_utilities.rb
|
454
457
|
lib/data_maker/validators/chinese_characters.rb
|
455
458
|
lib/data_maker/validators/chinese_nin_validator.rb
|
456
|
-
lib/data_maker/validators/chinese_phone_number.rb
|
457
459
|
lib/data_maker/version.rb
|
458
460
|
spec/lib/data_maker/cn/address_spec.rb
|
461
|
+
spec/lib/data_maker/cn/employment_spec.rb
|
459
462
|
spec/lib/data_maker/cn/name_spec.rb
|
460
463
|
spec/lib/data_maker/cn/nin_spec.rb
|
461
464
|
spec/lib/data_maker/cn/phone_number_spec.rb
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module DataMaker
|
2
|
+
module CN
|
3
|
+
module Employment
|
4
|
+
extend ModuleUtilities
|
5
|
+
|
6
|
+
def self.job_title
|
7
|
+
job_title = JOB_TITLES.sample.downcase.split(" ").join("_")
|
8
|
+
DataMaker::Config.locale = :zh
|
9
|
+
DataMaker.translate(['data_maker', 'employment', 'job_titles', job_title].join("."))
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
Accounting Manager
|
2
|
+
Administrative Director
|
3
|
+
After Sales Engineer
|
4
|
+
Assistant to President
|
5
|
+
Chairman
|
6
|
+
Chief Application Architect
|
7
|
+
Chief Design Officer
|
8
|
+
Chief Executive Officer
|
9
|
+
Chief Executive Officer
|
10
|
+
Chief Human Resources Officer
|
11
|
+
Chief Technology Officer
|
12
|
+
Co Chairman
|
13
|
+
Consultant
|
14
|
+
Consulting Manager
|
15
|
+
Customer Manager
|
16
|
+
Event Coordinator
|
17
|
+
Execution Engineer
|
18
|
+
General Manager
|
19
|
+
General Manager Southern Region
|
20
|
+
General Manager Branch
|
21
|
+
General Manager Department
|
22
|
+
General Project Manager
|
23
|
+
Human Resources Manager
|
24
|
+
Implementation Consultant
|
25
|
+
Investment Affairs Director
|
26
|
+
Marketing Director
|
27
|
+
Marketing Director
|
28
|
+
Media Manager
|
29
|
+
Personnel Manager
|
30
|
+
Pre Sales Consultant
|
31
|
+
Pre Sales Engineer
|
32
|
+
Quality Engineer
|
33
|
+
Quality Manager
|
34
|
+
Recruitment Manager
|
35
|
+
Recruitment Supervisor
|
36
|
+
Regional Director
|
37
|
+
Sales Assistant
|
38
|
+
Sales Engineer
|
39
|
+
Sales Manager
|
40
|
+
Sales Manager
|
41
|
+
Sales Supervisor
|
42
|
+
Secretary to President
|
43
|
+
Secretary General
|
44
|
+
Securities Services Representative
|
45
|
+
Senior Adminstrative Manager
|
46
|
+
Senior Consultant
|
47
|
+
Senior Consultant
|
48
|
+
Senior Graphic Designer
|
49
|
+
Senior Software Architect
|
50
|
+
Senior Software Development Engineer
|
51
|
+
Senior Software Engineer
|
52
|
+
Senior Specialist
|
53
|
+
Software Engineer
|
54
|
+
System Integration Engineer
|
55
|
+
Technical Consultant
|
56
|
+
Technical Engineer
|
57
|
+
Technical Manager
|
58
|
+
Technical Support Engineer
|
59
|
+
Training Manager
|
60
|
+
Vice General Manager
|
61
|
+
Vice President
|
62
|
+
honorary
|
@@ -0,0 +1,66 @@
|
|
1
|
+
zh:
|
2
|
+
data_maker:
|
3
|
+
employment:
|
4
|
+
job_titles:
|
5
|
+
accounting_manager: 会计经理
|
6
|
+
administrative_director: 行政总监
|
7
|
+
after_sales_engineer: 售后工程师
|
8
|
+
assistant_to_president: 总裁助理
|
9
|
+
chairman: 董事长
|
10
|
+
chief_application_architect: 首席应用架构师
|
11
|
+
chief_design_officer: 设计总监
|
12
|
+
chief_executive_officer: 总裁
|
13
|
+
chief_executive_officer: 行政总裁
|
14
|
+
chief_human_resources_officer: 人力资源总监
|
15
|
+
chief_technology_officer: 技术主管
|
16
|
+
co_chairman: 联席董事长
|
17
|
+
consultant: 咨询顾问
|
18
|
+
consulting_manager: 咨询经理
|
19
|
+
customer_manager: 客户经理
|
20
|
+
event_coordinator: 会务经理
|
21
|
+
execution_engineer: 实施工程师
|
22
|
+
general_manager: 总经理
|
23
|
+
general_manager_branch: 某某办事处总经理
|
24
|
+
general_manager_department: 某某部总经理
|
25
|
+
general_manager_southern_region: 南方区域总经理
|
26
|
+
general_project_manager: 项目总经理
|
27
|
+
honorary: 名誉
|
28
|
+
human_resources_manager: 南方区域hr经理
|
29
|
+
implementation_consultant: 实施顾问
|
30
|
+
investment_affairs_director: 投资经理
|
31
|
+
marketing_director: 市场总监
|
32
|
+
marketing_director: 营销总监
|
33
|
+
media_manager: 媒体经理
|
34
|
+
personnel_manager: 人事经理
|
35
|
+
pre_sales_consultant: 售前顾问
|
36
|
+
pre_sales_engineer: 售前工程师
|
37
|
+
quality_engineer: 质量工程师
|
38
|
+
quality_manager: 质量经理
|
39
|
+
recruitment_manager: 招聘经理
|
40
|
+
recruitment_supervisor: 招聘主管
|
41
|
+
regional_director: 区域总监
|
42
|
+
sales_assistant: 销售助理
|
43
|
+
sales_engineer: 销售工程师
|
44
|
+
sales_manager: 市场经理
|
45
|
+
sales_manager: 销售经理
|
46
|
+
sales_supervisor: 销售主管
|
47
|
+
secretary_general: 秘书长
|
48
|
+
secretary_to_president: 总裁秘书
|
49
|
+
securities_services_representative: 证券事务代表
|
50
|
+
senior_adminstrative_manager: 高级行政经理
|
51
|
+
senior_consultant: 资深顾问
|
52
|
+
senior_consultant: 高级咨询顾问
|
53
|
+
senior_graphic_designer: 资深平面设计师
|
54
|
+
senior_software_architect: 高级软件架构师
|
55
|
+
senior_software_development_engineer: 资深开发工程师
|
56
|
+
senior_software_engineer: 高级软件工程师
|
57
|
+
senior_specialist: 资深专家
|
58
|
+
software_engineer: 软件工程师
|
59
|
+
system_integration_engineer: 系统集成工程师
|
60
|
+
technical_consultant: 技术顾问
|
61
|
+
technical_engineer: 技术工程师
|
62
|
+
technical_manager: 技术经理
|
63
|
+
technical_support_engineer: 技术支持工程师
|
64
|
+
training_manager: 培训经理
|
65
|
+
vice_general_manager: 华北区域副总经理
|
66
|
+
vice_president: 副总裁
|
File without changes
|
data/lib/data_maker/version.rb
CHANGED
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe DataMaker::CN::Employment do
|
4
|
+
describe "#self.job_title" do
|
5
|
+
it "generates a job title in chinese" do
|
6
|
+
job_title = described_class.job_title
|
7
|
+
validate = DataMaker::Validators::ChineseCharacters.new(job_title)
|
8
|
+
expect(validate.valid?).to be_truthy
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -5,7 +5,7 @@ RSpec.describe DataMaker do
|
|
5
5
|
|
6
6
|
describe "#VERSION" do
|
7
7
|
# For each iteration of a version this would always get changed.
|
8
|
-
let(:current_version) { "2.
|
8
|
+
let(:current_version) { "2.5.2" }
|
9
9
|
|
10
10
|
it { expect(described_class).to be_const_defined(:VERSION) }
|
11
11
|
it { expect(described_class::VERSION).to eq(current_version) }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: data_maker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kareem Gan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simplecov
|
@@ -180,6 +180,7 @@ files:
|
|
180
180
|
- data_maker.gemspec
|
181
181
|
- lib/data_maker.rb
|
182
182
|
- lib/data_maker/cn/address.rb
|
183
|
+
- lib/data_maker/cn/employment.rb
|
183
184
|
- lib/data_maker/cn/name.rb
|
184
185
|
- lib/data_maker/cn/nin.rb
|
185
186
|
- lib/data_maker/cn/phone_number.rb
|
@@ -571,20 +572,22 @@ files:
|
|
571
572
|
- lib/data_maker/data/cn/address/zunyi_districts
|
572
573
|
- lib/data_maker/data/cn/cities_chinese
|
573
574
|
- lib/data_maker/data/cn/districts_chinese
|
575
|
+
- lib/data_maker/data/cn/employment/job_titles
|
574
576
|
- lib/data_maker/data/cn/name/first_names
|
575
577
|
- lib/data_maker/data/cn/name/last_names
|
576
578
|
- lib/data_maker/data/cn/phone_number/landline_phone_prefixes
|
577
579
|
- lib/data_maker/data/cn/phone_number/mobile_phone_prefixes
|
578
580
|
- lib/data_maker/data/cn/provinces_chinese
|
579
|
-
- lib/data_maker/locales/zh.yml
|
581
|
+
- lib/data_maker/locales/zh.employment.yml
|
582
|
+
- lib/data_maker/locales/zh.regions.yml
|
580
583
|
- lib/data_maker/modulator.rb
|
581
584
|
- lib/data_maker/utilities/array_utilities.rb
|
582
585
|
- lib/data_maker/utilities/module_utilities.rb
|
583
586
|
- lib/data_maker/validators/chinese_characters.rb
|
584
587
|
- lib/data_maker/validators/chinese_nin_validator.rb
|
585
|
-
- lib/data_maker/validators/chinese_phone_number.rb
|
586
588
|
- lib/data_maker/version.rb
|
587
589
|
- spec/lib/data_maker/cn/address_spec.rb
|
590
|
+
- spec/lib/data_maker/cn/employment_spec.rb
|
588
591
|
- spec/lib/data_maker/cn/name_spec.rb
|
589
592
|
- spec/lib/data_maker/cn/nin_spec.rb
|
590
593
|
- spec/lib/data_maker/cn/phone_number_spec.rb
|
@@ -618,6 +621,7 @@ specification_version: 4
|
|
618
621
|
summary: Data generator gem for aiding in development and testing for applications.
|
619
622
|
test_files:
|
620
623
|
- spec/lib/data_maker/cn/address_spec.rb
|
624
|
+
- spec/lib/data_maker/cn/employment_spec.rb
|
621
625
|
- spec/lib/data_maker/cn/name_spec.rb
|
622
626
|
- spec/lib/data_maker/cn/nin_spec.rb
|
623
627
|
- spec/lib/data_maker/cn/phone_number_spec.rb
|
@@ -1,28 +0,0 @@
|
|
1
|
-
module DataMaker
|
2
|
-
module Validators
|
3
|
-
class ChinesePhoneNumber
|
4
|
-
def initialize(number)
|
5
|
-
@number = number
|
6
|
-
end
|
7
|
-
|
8
|
-
def mobile?
|
9
|
-
mobile_regex = /^1[34578]\d(\D?)\d{4}(\D?)\d{4}$/
|
10
|
-
!(mobile_regex.match(@number.to_s).nil?)
|
11
|
-
end
|
12
|
-
|
13
|
-
def landline?
|
14
|
-
twodigit = /^0?((10)|(2[0-57-9])|(3[157])|(4[17])|(5[1,3,5])|(7[1579])|(8[357])|(9[379]))\d{8,9}$/
|
15
|
-
threedigit = /^0?(((335|349|39[1-6]|398))|((42[179]|43[1-9]|44[08]|45[1-9]|46[4789]|48[23]))|((52[37]|54[36]|56[1-6]|580|59[1-9]))|((63[1-5]|66[0238]|69[12]))|((701|72[248]|73[014-9]|74[3-6]|76[023689]))|((81[23678]|82[5-7]|88[136-8]|89[1-8]))|((90[123689]|91[1-9]|94[13]|95[1-5])))\d{7,}$/
|
16
|
-
fourdigit = /^0?((8029|806[03578]|807[01])\d{6,})$/
|
17
|
-
|
18
|
-
!(twodigit.match(@number.to_s).nil?) ||
|
19
|
-
!(threedigit.match(@number.to_s).nil?) ||
|
20
|
-
!(fourdigit.match(@number.to_s).nil?)
|
21
|
-
end
|
22
|
-
|
23
|
-
def valid?
|
24
|
-
mobile? || landline?
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|