random_name_generator 1.0.0 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: ef97eac73bd01cde0aacdd9342b7514ffa29788d
4
- data.tar.gz: 97dd28a80b0d73b84f8f00e2dc6103930fab19c2
2
+ SHA256:
3
+ metadata.gz: 4336d97396f09574b9fb352227c6216c0de30c9838366fb314146424debc9021
4
+ data.tar.gz: fec2c1e6ef12c3e123f6da425c599eb42ed6f674970019ca3625513bf7bd3a9b
5
5
  SHA512:
6
- metadata.gz: 40bb462a879adb4a844ed64b9443d5ded04f7c2f26a96355398501dbfb724b1e336d8e781391163ae3a33a9716fe6d2721af11c2993ee38958e3a2efa775f5b9
7
- data.tar.gz: 46a06d12ab64b94ace324d895c4fd08a75acacbb02f35ee5ab1e7f14f603a87628a1e5d086c8c1aebd63b25e87a7810bd2d5c8e27606181688ab67812fc3fec2
6
+ metadata.gz: 179315795584dae924501b324b29689910ba7ad0fdecbd7e73eee8e7685807c5606f660680bc35af2f287120de712c1d92ce9ce51ea251408416258c9357dff9
7
+ data.tar.gz: c1909c25079cc1b942b940f6e2cd0ba3d722773dc9a246ef9de7e9723d66f8ced7f5cae0bbef7bd60d14011727fc72056e7d197e8048799604f5b6659ab1b8bd
@@ -0,0 +1,31 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Ruby
9
+
10
+ on: push
11
+
12
+ jobs:
13
+ test:
14
+
15
+ runs-on: ubuntu-latest
16
+ strategy:
17
+ matrix:
18
+ ruby-version: ['2.6', '2.7', '3.0']
19
+
20
+ steps:
21
+ - uses: actions/checkout@v2
22
+ - name: Set up Ruby
23
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
24
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
25
+ uses: ruby/setup-ruby@v1
26
+ # uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
27
+ with:
28
+ ruby-version: ${{ matrix.ruby-version }}
29
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
30
+ - name: Run tests
31
+ run: bundle exec rake
data/.gitignore CHANGED
@@ -23,7 +23,7 @@ build/
23
23
 
24
24
  ## Environment normalization:
25
25
  /.bundle/
26
- /vendor/bundle
26
+ /vendor/
27
27
  /lib/bundler/man/
28
28
 
29
29
  # for a library or gem, you might want to ignore these files since the code is
@@ -35,4 +35,5 @@ build/
35
35
  # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
36
36
  .rvmrc
37
37
 
38
- /.idea/
38
+ /.idea/
39
+ test/random_name_generator/coverage/
data/.rubocop.yml CHANGED
@@ -2,6 +2,9 @@ Metrics/AbcSize:
2
2
  Enabled: true
3
3
  Max: 22
4
4
 
5
+ Metrics/BlockLength:
6
+ Max: 30
7
+
5
8
  Metrics/ClassLength:
6
9
  Description: 'Avoid classes longer than 100 lines of code.'
7
10
  Enabled: false
@@ -11,6 +14,9 @@ Metrics/LineLength:
11
14
  StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
12
15
  Enabled: false
13
16
 
17
+ Metrics/MethodLength:
18
+ Max: 12
19
+
14
20
  Style/Documentation:
15
21
  Description: 'Document classes and non-namespace modules.'
16
22
  Enabled: false
data/Gemfile CHANGED
@@ -2,18 +2,19 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- gem 'pry', '~> 0.10.3'
6
- # gem 'slop', '~> 4.2', '>= 4.2.1'
5
+ gem 'pry'
6
+ gem 'rest-client', '>= 1.8.0'
7
+ gem 'slop', '~> 4.2'
7
8
 
8
9
  group :development do
10
+ gem 'guard'
11
+ gem 'guard-minitest'
9
12
  gem 'minitest'
10
13
  gem 'minitest-reporters'
11
14
  gem 'mocha'
12
- gem 'guard'
13
- gem 'guard-minitest'
14
15
  gem 'reek'
15
16
  gem 'rubocop'
16
17
  end
17
18
 
18
- gem 'codeclimate-test-reporter', group: :test, require: nil
19
- gem 'coveralls', require: false
19
+ gem 'coveralls', '>= 0.8.23', require: false
20
+ gem 'simplecov', require: false, group: :test
data/Gemfile.lock CHANGED
@@ -1,116 +1,137 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- random_name_generator (1.0.0)
4
+ random_name_generator (1.2.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
9
  ansi (1.5.0)
10
- ast (2.2.0)
11
- axiom-types (0.1.1)
12
- descendants_tracker (~> 0.0.4)
13
- ice_nine (~> 0.11.0)
14
- thread_safe (~> 0.3, >= 0.3.1)
15
- builder (3.2.2)
16
- codeclimate-engine-rb (0.3.1)
17
- virtus (~> 1.0)
18
- codeclimate-test-reporter (0.5.0)
19
- simplecov (>= 0.7.1, < 1.0.0)
20
- coderay (1.1.1)
21
- coercible (1.0.0)
22
- descendants_tracker (~> 0.0.1)
23
- coveralls (0.8.13)
24
- json (~> 1.8)
25
- simplecov (~> 0.11.0)
10
+ ast (2.4.2)
11
+ builder (3.2.4)
12
+ coderay (1.1.3)
13
+ coveralls (0.8.23)
14
+ json (>= 1.8, < 3)
15
+ simplecov (~> 0.16.1)
26
16
  term-ansicolor (~> 1.3)
27
- thor (~> 0.19.1)
28
- tins (~> 1.6.0)
29
- descendants_tracker (0.0.4)
30
- thread_safe (~> 0.3, >= 0.3.1)
31
- docile (1.1.5)
32
- equalizer (0.0.11)
33
- ffi (1.9.10)
34
- guard (1.4.0)
35
- listen (>= 0.4.2)
36
- thor (>= 0.14.6)
17
+ thor (>= 0.19.4, < 2.0)
18
+ tins (~> 1.6)
19
+ docile (1.3.5)
20
+ domain_name (0.5.20190701)
21
+ unf (>= 0.0.5, < 1.0.0)
22
+ ffi (1.15.0)
23
+ formatador (0.2.5)
24
+ guard (2.16.2)
25
+ formatador (>= 0.2.4)
26
+ listen (>= 2.7, < 4.0)
27
+ lumberjack (>= 1.0.12, < 2.0)
28
+ nenv (~> 0.1)
29
+ notiffany (~> 0.0)
30
+ pry (>= 0.9.12)
31
+ shellany (~> 0.0)
32
+ thor (>= 0.18.1)
37
33
  guard-compat (1.2.1)
38
- guard-minitest (2.4.4)
34
+ guard-minitest (2.4.6)
39
35
  guard-compat (~> 1.2)
40
36
  minitest (>= 3.0)
41
- ice_nine (0.11.2)
42
- json (1.8.3)
43
- listen (3.0.6)
44
- rb-fsevent (>= 0.9.3)
45
- rb-inotify (>= 0.9.7)
46
- metaclass (0.0.4)
47
- method_source (0.8.2)
48
- minitest (5.8.4)
49
- minitest-reporters (1.1.8)
37
+ http-accept (1.7.0)
38
+ http-cookie (1.0.3)
39
+ domain_name (~> 0.5)
40
+ json (2.5.1)
41
+ kwalify (0.7.2)
42
+ listen (3.4.1)
43
+ rb-fsevent (~> 0.10, >= 0.10.3)
44
+ rb-inotify (~> 0.9, >= 0.9.10)
45
+ lumberjack (1.2.8)
46
+ method_source (1.0.0)
47
+ mime-types (3.3.1)
48
+ mime-types-data (~> 3.2015)
49
+ mime-types-data (3.2021.0225)
50
+ minitest (5.14.4)
51
+ minitest-reporters (1.4.3)
50
52
  ansi
51
53
  builder
52
54
  minitest (>= 5.0)
53
55
  ruby-progressbar
54
- mocha (1.1.0)
55
- metaclass (~> 0.0.1)
56
- parser (2.3.0.6)
57
- ast (~> 2.2)
58
- powerpack (0.1.1)
59
- pry (0.10.3)
60
- coderay (~> 1.1.0)
61
- method_source (~> 0.8.1)
62
- slop (~> 3.4)
63
- rainbow (2.1.0)
64
- rake (10.5.0)
65
- rb-fsevent (0.9.7)
66
- rb-inotify (0.9.7)
67
- ffi (>= 0.5.0)
68
- reek (4.0.0)
69
- codeclimate-engine-rb (~> 0.3.1)
70
- parser (~> 2.3, >= 2.3.0.6)
71
- rainbow (~> 2.0)
72
- rubocop (0.38.0)
73
- parser (>= 2.3.0.6, < 3.0)
74
- powerpack (~> 0.1)
75
- rainbow (>= 1.99.1, < 3.0)
56
+ mocha (1.12.0)
57
+ nenv (0.3.0)
58
+ netrc (0.11.0)
59
+ notiffany (0.1.3)
60
+ nenv (~> 0.1)
61
+ shellany (~> 0.0)
62
+ parallel (1.20.1)
63
+ parser (3.0.0.0)
64
+ ast (~> 2.4.1)
65
+ pry (0.14.0)
66
+ coderay (~> 1.1)
67
+ method_source (~> 1.0)
68
+ psych (3.3.1)
69
+ rainbow (3.0.0)
70
+ rake (13.0.3)
71
+ rb-fsevent (0.10.4)
72
+ rb-inotify (0.10.1)
73
+ ffi (~> 1.0)
74
+ reek (6.0.3)
75
+ kwalify (~> 0.7.0)
76
+ parser (~> 3.0.0)
77
+ psych (~> 3.1)
78
+ rainbow (>= 2.0, < 4.0)
79
+ regexp_parser (2.1.1)
80
+ rest-client (2.1.0)
81
+ http-accept (>= 1.7.0, < 2.0)
82
+ http-cookie (>= 1.0.2, < 2.0)
83
+ mime-types (>= 1.16, < 4.0)
84
+ netrc (~> 0.8)
85
+ rexml (3.2.4)
86
+ rubocop (1.11.0)
87
+ parallel (~> 1.10)
88
+ parser (>= 3.0.0.0)
89
+ rainbow (>= 2.2.2, < 4.0)
90
+ regexp_parser (>= 1.8, < 3.0)
91
+ rexml
92
+ rubocop-ast (>= 1.2.0, < 2.0)
76
93
  ruby-progressbar (~> 1.7)
77
- unicode-display_width (~> 1.0, >= 1.0.1)
78
- ruby-progressbar (1.7.5)
79
- simplecov (0.11.2)
80
- docile (~> 1.1.0)
81
- json (~> 1.8)
94
+ unicode-display_width (>= 1.4.0, < 3.0)
95
+ rubocop-ast (1.4.1)
96
+ parser (>= 2.7.1.5)
97
+ ruby-progressbar (1.11.0)
98
+ shellany (0.0.1)
99
+ simplecov (0.16.1)
100
+ docile (~> 1.1)
101
+ json (>= 1.8, < 3)
82
102
  simplecov-html (~> 0.10.0)
83
- simplecov-html (0.10.0)
84
- slop (3.6.0)
85
- term-ansicolor (1.3.2)
103
+ simplecov-html (0.10.2)
104
+ slop (4.8.2)
105
+ sync (0.5.0)
106
+ term-ansicolor (1.7.1)
86
107
  tins (~> 1.0)
87
- thor (0.19.1)
88
- thread_safe (0.3.5)
89
- tins (1.6.0)
90
- unicode-display_width (1.0.2)
91
- virtus (1.0.5)
92
- axiom-types (~> 0.1)
93
- coercible (~> 1.0)
94
- descendants_tracker (~> 0.0, >= 0.0.3)
95
- equalizer (~> 0.0, >= 0.0.9)
108
+ thor (1.1.0)
109
+ tins (1.28.0)
110
+ sync
111
+ unf (0.1.4)
112
+ unf_ext
113
+ unf_ext (0.0.7.7)
114
+ unicode-display_width (2.0.0)
96
115
 
97
116
  PLATFORMS
98
117
  ruby
99
118
 
100
119
  DEPENDENCIES
101
- bundler (~> 1.11)
102
- codeclimate-test-reporter
103
- coveralls
120
+ bundler
121
+ coveralls (>= 0.8.23)
104
122
  guard
105
123
  guard-minitest
106
124
  minitest
107
125
  minitest-reporters
108
126
  mocha
109
- pry (~> 0.10.3)
110
- rake (~> 10.0)
127
+ pry
128
+ rake
111
129
  random_name_generator!
112
130
  reek
131
+ rest-client (>= 1.8.0)
113
132
  rubocop
133
+ simplecov
134
+ slop (~> 4.2)
114
135
 
115
136
  BUNDLED WITH
116
- 1.11.2
137
+ 2.1.4
data/README.md CHANGED
@@ -3,11 +3,10 @@
3
3
  [![Gem Version](https://badge.fury.io/rb/random_name_generator.svg)](https://badge.fury.io/rb/random_name_generator)
4
4
  [![Build Status](https://travis-ci.org/folkengine/random_name_generator.svg?branch=master)](https://travis-ci.org/folkengine/random_name_generator)
5
5
  [![Code Climate](https://codeclimate.com/github/folkengine/random_name_generator/badges/gpa.svg)](https://codeclimate.com/github/folkengine/random_name_generator)
6
- [![Dependency Status](https://gemnasium.com/folkengine/random_name_generator.svg)](https://gemnasium.com/folkengine/random_name_generator)
7
6
  [![Coverage Status](https://coveralls.io/repos/github/folkengine/random_name_generator/badge.svg?branch=master)](https://coveralls.io/github/folkengine/random_name_generator?branch=master)
8
7
  [![Inline docs](http://inch-ci.org/github/folkengine/random_name_generator.svg?branch=master)](http://inch-ci.org/github/folkengine/random_name_generator)
9
8
 
10
- Ruby port of [java-random-name-generator](https://github.com/folkengine/java-random-name-generator).
9
+ Ruby port of [java-random-name-generator](https://github.com/folkengine/java-random-name-generator), which in turn is a gradle enabled version of [Sinipull's GPL'd post on codecall.net](http://forum.codecall.net/topic/49665-java-random-name-generator/).
11
10
 
12
11
  The big difference between this random name generator and others is that it allows you to create names in various
13
12
  custom styles such as Elven, and Roman. If you're looking for a quick name for a Goblin NPC, RandomNameGenerator is
data/Rakefile CHANGED
@@ -16,3 +16,11 @@ Rake::TestTask.new do |t|
16
16
  t.test_files = FileList['test/**/test*.rb']
17
17
  t.verbose = true
18
18
  end
19
+
20
+ task :boom do
21
+ Rake::Task['test'].execute
22
+ puts 'Running Reek...'
23
+ Rake::Task['reek'].execute
24
+ puts
25
+ Rake::Task['rubocop'].execute
26
+ end
@@ -10,15 +10,27 @@ opts = Slop.parse do |o|
10
10
  o.bool '-g', '--goblin', 'Use Goblin eyllable file'
11
11
  o.bool '-r', '--roman', 'Use Roman eyllable file'
12
12
  o.bool '-f', '--flipmode', 'Flip mode in effect'
13
+ o.bool '-c', '--cyrillic', 'Use Cyrillic mode'
13
14
  o.bool '-?', '--help', 'How to'
14
15
  end
15
16
 
16
- lang = RandomNameGenerator::ELVEN if opts.elven?
17
- lang = RandomNameGenerator::GOBLIN if opts.goblin?
18
- lang = RandomNameGenerator::ROMAN if opts.roman?
17
+ if opts.cyrillic?
18
+ lang = RandomNameGenerator::FANTASY_RU
19
+ lang = RandomNameGenerator::ELVEN_RU if opts.elven?
20
+ lang = RandomNameGenerator::GOBLIN_RU if opts.goblin?
21
+ lang = RandomNameGenerator::ROMAN_RU if opts.roman?
22
+ else
23
+ lang = RandomNameGenerator::ELVEN if opts.elven?
24
+ lang = RandomNameGenerator::GOBLIN if opts.goblin?
25
+ lang = RandomNameGenerator::ROMAN if opts.roman?
26
+ end
19
27
 
20
28
  if opts.flipmode?
21
- puts "#{RandomNameGenerator.flip_mode.compose} #{RandomNameGenerator.flip_mode.compose}"
29
+ if opts.cyrillic?
30
+ puts "#{RandomNameGenerator.flip_mode_cyrillic.compose} #{RandomNameGenerator.flip_mode_cyrillic.compose}"
31
+ else
32
+ puts "#{RandomNameGenerator.flip_mode.compose} #{RandomNameGenerator.flip_mode.compose}"
33
+ end
22
34
  elsif opts.help?
23
35
  puts opts
24
36
  else
@@ -1,3 +1,4 @@
1
+ -a +c
1
2
  -æ +c
2
3
  -aa +c
3
4
  -ab
@@ -20,6 +21,8 @@
20
21
  -ang
21
22
  -anti
22
23
  -ap
24
+ -ar
25
+ -as
23
26
  -hab
24
27
  -mai
25
28
  -mal
@@ -40,6 +43,7 @@ ia -c +c
40
43
  it -c -v
41
44
  loc +v
42
45
  ma +c
46
+ mo -c +c
43
47
  oc
44
48
  olly -c +v
45
49
  or
@@ -47,12 +51,20 @@ ra +c
47
51
  rat
48
52
  rax +v
49
53
  real
54
+ roma -c +c
50
55
  sh
51
56
  thi +c
57
+ una -c +c
52
58
 
53
59
  +al
60
+ +akku -c
54
61
  +as
62
+ +b'el -c
55
63
  +bou -v
64
+ +chon
65
+ +christ -v
66
+ +dai
67
+ +deus
56
68
  +er -c
57
69
  +es -c
58
70
  +ias -c
@@ -60,34 +72,30 @@ thi +c
60
72
  +ka
61
73
  +lat
62
74
  +lech
75
+ +lius
63
76
  +ma
64
77
  +man
65
78
  +mon
66
79
  +nah
67
80
  +nyu
68
81
  +on -c
82
+ +phus -c
69
83
  +rept -v
70
84
  +res
85
+ +ros
71
86
  +s -v
87
+ +sag
88
+ +sakku -v
89
+ +sura
72
90
  +van
73
91
  +xas -v
74
92
  +y -c
75
93
  +ym
76
94
  +zou
95
+ +xu
77
96
 
78
97
  # https://en.wikipedia.org/wiki/The_infernal_names
79
98
 
80
- Andrealphus (Christian demonology)
81
- Andromalius (Christian demonology)
82
- Antichrist (Christian demonology)
83
- Anzu (Sumerian mythology)
84
- Armaros (Jewish demonology)
85
- Archon (Gnosticism)
86
- Arunasura [Hindu mythology]
87
- Asag (Sumerian demonology)
88
- Asakku (Babylonian mythology)
89
- Asb'el (Jewish mythology)
90
- Asmodai/Asmodeus (Jewish folklore and Christian demonology)
91
99
  Astaroth (Christian demonology)
92
100
  Asura (Hindu mythology)
93
101
  Azazel / Azaz'el (Jewish demonology)
@@ -0,0 +1,84 @@
1
+ -Аэль
2
+ -Аэр
3
+ -аф
4
+
5
+ -ам
6
+ -ама
7
+ -ан
8
+ -анг +v
9
+ -анср +v
10
+ -каэль
11
+ -даэ +c
12
+ -до
13
+ -ейр
14
+ -фи
15
+ -фир
16
+ -ла
17
+ -се
18
+ -сел
19
+ -ев
20
+ -фис
21
+ -ху
22
+ -ха
23
+ -гфр
24
+ -гил
25
+ -ка
26
+ -кан
27
+
28
+ -за
29
+ -зи
30
+ -мара
31
+ -маи +c
32
+ -луэ +c
33
+ -ни
34
+ -ше
35
+ -сум
36
+ -сил
37
+ аэ +c -c
38
+ аэл -c
39
+ дар
40
+ дэт +v
41
+ дре -v
42
+ дрим -v
43
+ дул
44
+ эан -c
45
+ эл
46
+ эмар
47
+ хал
48
+ иат -c
49
+ ма
50
+ тэн
51
+ куэ -v +c
52
+ риа
53
+ риал
54
+ тэр
55
+ тус
56
+ ти
57
+ сан
58
+ +аэль -c
59
+ +дар
60
+ +дэт
61
+ +дре
62
+ +дрим
63
+ +дул
64
+ +эан -c
65
+ +эл
66
+ +эиар
67
+ +нэс
68
+ +нин
69
+ +от
70
+ +хал
71
+ +иат
72
+ +ма
73
+ +тэн
74
+ +тэр
75
+ +тус
76
+ +ти
77
+ +ран
78
+ +ат
79
+ +эсс
80
+ +сан
81
+ +ит
82
+ +лас
83
+ +лиан
84
+ +эвар
@@ -0,0 +1,356 @@
1
+ -а +c
2
+ -аб
3
+ -ак
4
+ -ац
5
+ -ад
6
+ -аф
7
+ -ам
8
+ -ан
9
+ -ап
10
+ -ар
11
+ -ас
12
+ -ат
13
+ -ав
14
+ -аз
15
+ -аэль
16
+ -аэл
17
+ -ао
18
+ -аэр
19
+ -аш
20
+ -арш +v
21
+ -ат
22
+ -арг +v
23
+ -арв +v
24
+ -арт +v
25
+ -арн +v
26
+ -аг
27
+ -анг +v
28
+ -антр +v
29
+ -ба +c
30
+ -бе +c
31
+ -би
32
+ -бо +c
33
+ -бу +c
34
+ -бео +c
35
+ -бра +c
36
+ -бре +c
37
+ -бей
38
+ -бро +c
39
+ -бру
40
+ -брео +c
41
+ -брао +c
42
+ -да +c
43
+ -де +c
44
+ -ди
45
+ -до +c
46
+ -ду +c
47
+ -дае +c
48
+ -даи
49
+ -дао +c
50
+ -дра +c
51
+ -дре +c
52
+ -дри
53
+ -дро +c
54
+ -даш
55
+ -деш
56
+ -дош
57
+ -дарр +v
58
+ -дар
59
+ -дерр +v
60
+ -дер
61
+ -дорр +v
62
+ -дор
63
+ -дурр +v
64
+ -дур
65
+ -дран
66
+ -дрен
67
+ -дрон
68
+ -друн
69
+ -драв
70
+ -древ
71
+ -дров
72
+ -дов
73
+ -дув
74
+ -дарв +v
75
+ -дорв +v
76
+ -дурв +v
77
+ -эо +c
78
+ -эи +c
79
+ -ед
80
+ -га +c
81
+ -го +c
82
+ -гу +c
83
+ -гра +c
84
+ -гро +c
85
+ -гру +c
86
+ -гарл
87
+ -горл
88
+ -ха +c
89
+ -хэ +c
90
+ -хе +c
91
+ -хи +c
92
+ -хо +c
93
+ -ху +c
94
+ -хан
95
+ -хун
96
+ -хон
97
+ -идр +v
98
+ -игр +v
99
+ -ирн +v
100
+ -игн +v
101
+ -ин
102
+ -инс
103
+ -интр +v
104
+ -ка +c
105
+ -ке +c
106
+ -ки
107
+ -ко +c
108
+ -ку +c
109
+ -ков
110
+ -корв +v
111
+ -кран
112
+ -крен
113
+ -крон
114
+ -крун
115
+ -карн
116
+ -керн
117
+ -корн
118
+ -курн
119
+ -лод +v
120
+ -лодд +v
121
+ -ла +c
122
+ -лад +v
123
+ -ладд +v
124
+ -лор
125
+ -лорн +v
126
+ -ллор
127
+ -ллорн +v
128
+ -ллорв +v
129
+ -орв +v
130
+ -орн +v
131
+ -оргл +v
132
+ -ра +c
133
+ -ру +c
134
+ -ро +c
135
+ -ра +c
136
+ -ре +c
137
+ -ру +c
138
+ -раб +v
139
+ -рак
140
+ -роб +v
141
+ -рок
142
+ -руб +v
143
+ -рук
144
+ -стра +c
145
+ -стре +c
146
+ -сто +c
147
+ -сар
148
+ -сор
149
+ -сер
150
+ -ту +c
151
+ -тук
152
+ -тув +v
153
+ -ун
154
+ -унн +v
155
+ -унд
156
+ -уд
157
+ -ук
158
+ -ва
159
+ -ваа +c
160
+ -ве +c
161
+ -во +c
162
+ -ву +c
163
+ -вал
164
+ -вел
165
+ -вол
166
+ -вул
167
+ -враал
168
+ -врал
169
+ -врул
170
+ -враат +v
171
+ -вроот +v
172
+ -врод +v
173
+ -врок +v
174
+ -ворк +v
175
+ -ворт +v
176
+ -за +c
177
+ -заа +c
178
+ -звр
179
+ -зон
180
+ -золл +v
181
+ аб -c
182
+ ац -c
183
+ ад -c
184
+ аф -c
185
+ ак -c
186
+ ам -c
187
+ ан -c
188
+ ап -c
189
+ ар -c
190
+ ас -c
191
+ ат -c
192
+ ав -c
193
+ аз -c
194
+ аэл -c
195
+ аэль c
196
+ ао -c
197
+ аэр -c
198
+ ба
199
+ бе
200
+ би
201
+ бо
202
+ бу
203
+ бео
204
+ бра
205
+ бре
206
+ бей
207
+ бро
208
+ бру
209
+ брео
210
+ брао
211
+ да
212
+ де
213
+ ди
214
+ до
215
+ ду
216
+ даэ
217
+ даи
218
+ дао
219
+ дра
220
+ дре
221
+ дри
222
+ дро
223
+ даш
224
+ деш
225
+ дош
226
+ дарр
227
+ дар
228
+ дерр
229
+ дер
230
+ дорр
231
+ дор
232
+ дурр
233
+ дур
234
+ дран
235
+ дрен
236
+ дрон
237
+ друн
238
+ драв
239
+ древ
240
+ дров
241
+ дов
242
+ дув
243
+ дарв
244
+ дорв
245
+ дурв
246
+ эо -c +c
247
+ эи -c
248
+ ео -c +c
249
+ еи -c
250
+ эд -c
251
+ ед -c
252
+ га -v +c
253
+ го -v +c
254
+ гу -v +c
255
+ гра -v
256
+ гро -v
257
+ гру -v +c
258
+ гарл -v
259
+ горл -v
260
+ ха -v +c
261
+ хэ -v +c
262
+ хи -v
263
+ хо -v +c
264
+ ху -v +c
265
+ хан -v
266
+ хун -v
267
+ хон -v
268
+ идр -c +v
269
+ игр -c +v
270
+ ирн -c +v
271
+ игн -c +v
272
+ ин
273
+ инс
274
+ интр -c
275
+ ка -v +c
276
+ ке -v +c
277
+ ки -v
278
+ ко -v +c
279
+ ку -v +c
280
+ ков -v +v
281
+ корв -v +v
282
+ кран -v +v
283
+ крен -v +v
284
+ крон -v +v
285
+ крун -v +v
286
+ карн -v +v
287
+ курн -v +v
288
+ корн -v +v
289
+ курн -v +v
290
+ лод -v
291
+ лодд -v
292
+ ла -v +c
293
+ лад -v
294
+ ладд -v +v
295
+ лор -v
296
+ лорн -v +v
297
+ орв -c +v
298
+ орн -c +v
299
+ оргл -c +v
300
+ па -v +c
301
+ пу -v +c
302
+ по -v +c
303
+ ра -v +c
304
+ ре -v +c
305
+ рэ -v +c
306
+ ру -v +c
307
+ раб -v +c
308
+ рак -v +c
309
+ роб -v +c
310
+ рок -v
311
+ руб -v +c
312
+ рук -v
313
+ стра -v +c
314
+ стре -v +c
315
+ сто -v +c
316
+ сар -v
317
+ сор -v
318
+ серр -v +c
319
+ ту -v +c
320
+ тук -v
321
+ тув -v +c
322
+ ун -c
323
+ унн -c +v
324
+ унд -c +v
325
+ уд -c +v
326
+ ук -c
327
+ ва -v +c
328
+ ваа -v +c
329
+ ве -v +c
330
+ во -v +c
331
+ ву -v +c
332
+ вал -v
333
+ вел -v
334
+ вол -v
335
+ вул -v
336
+ врал -v +v
337
+ врул -v +v
338
+ +ал -c
339
+ +ол -c
340
+ +ул -c
341
+ +ат -c
342
+ +от -c
343
+ +ан -c
344
+ +ун -c
345
+ +ен -c
346
+ +эн -c
347
+ +иэл -c
348
+ +иол -c
349
+ +иул -c
350
+ +ат -c
351
+ +ут -c
352
+ +лл -v
353
+ +д -v
354
+ +ст -v
355
+ +сс -v
356
+
@@ -0,0 +1,48 @@
1
+ -ваа +c
2
+ -боо +c
3
+ -гар
4
+ -бар
5
+ -дар
6
+ -жар
7
+ -вар
8
+ -кра
9
+ -гра
10
+ -дра
11
+ -зра
12
+ -гоб
13
+ -доб
14
+ -роб
15
+ -фоб
16
+ -зоб
17
+ -раг
18
+ -наг
19
+ -даг
20
+ бра
21
+ га
22
+ да
23
+ до
24
+ го
25
+ зе
26
+ ша
27
+ наз
28
+ зуб
29
+ зу
30
+ на
31
+ гор
32
+ бу +c
33
+ +быр
34
+ +гыр
35
+ +дыр
36
+ +выр
37
+ +зыр
38
+ +ыр -c
39
+ +зог
40
+ +рог
41
+ +гог
42
+ +ог -c
43
+ +гул
44
+ +дул
45
+ +бул
46
+ +рул
47
+ +ул -c
48
+ +ргх -v
@@ -0,0 +1,35 @@
1
+
2
+ -ал
3
+ -ау +c
4
+ -ан
5
+ -ба
6
+ -бе
7
+ -би
8
+ -бр +v
9
+ -да
10
+ -ди
11
+ -до
12
+ -ду
13
+
14
+ -эу +c
15
+ -фа
16
+ би
17
+ бе
18
+ бо
19
+ бу
20
+ нул +v
21
+ гу
22
+ да
23
+ ау +c -c
24
+ фри
25
+ гус
26
+ +тус
27
+ +лус
28
+ +лиус
29
+ +нус
30
+ +эс
31
+ +иус -c
32
+ +кус
33
+ +тор
34
+ +цио
35
+ +тин
@@ -12,6 +12,8 @@ require_relative 'rng_syllable'
12
12
  # rng = RandomNameGenerator.new
13
13
  # puts rng.compose
14
14
  #
15
+ # :reek:TooManyInstanceVariables
16
+ # :reek:TooManyStatements
15
17
  class RandomNameGenerator
16
18
  dirname = File.dirname(__FILE__)
17
19
 
@@ -20,10 +22,17 @@ class RandomNameGenerator
20
22
  GOBLIN = File.new("#{dirname}/languages/goblin.txt")
21
23
  ROMAN = File.new("#{dirname}/languages/roman.txt")
22
24
 
25
+ ELVEN_RU = File.new("#{dirname}/languages/elven-ru.txt")
26
+ FANTASY_RU = File.new("#{dirname}/languages/fantasy-ru.txt")
27
+ GOBLIN_RU = File.new("#{dirname}/languages/goblin-ru.txt")
28
+ ROMAN_RU = File.new("#{dirname}/languages/roman-ru.txt")
29
+
23
30
  attr_reader :pre, :pre_syllables, :sur_syllables, :mid_syllables
24
31
 
25
- def initialize(filename = RandomNameGenerator::FANTASY)
32
+ def initialize(filename = RandomNameGenerator::FANTASY, random: Random.new)
33
+ @pre = nil
26
34
  @file = File.new(filename)
35
+ @rnd = random
27
36
  @pre_syllables = []
28
37
  @sur_syllables = []
29
38
  @mid_syllables = []
@@ -40,6 +49,14 @@ class RandomNameGenerator
40
49
  new(langs.sample)
41
50
  end
42
51
 
52
+ def self.flip_mode_cyrillic
53
+ langs = [RandomNameGenerator::FANTASY_RU,
54
+ RandomNameGenerator::ELVEN_RU,
55
+ RandomNameGenerator::GOBLIN_RU,
56
+ RandomNameGenerator::ROMAN_RU]
57
+ new(langs.sample)
58
+ end
59
+
43
60
  def compose(count = RandomNameGenerator.pick_number_of_syllables)
44
61
  @pre = pre_syllables.sample
45
62
  return @pre.to_s.capitalize if count < 2
@@ -54,7 +71,7 @@ class RandomNameGenerator
54
71
  end
55
72
 
56
73
  def to_s
57
- "NameGenerator (#{@file.path})"
74
+ "RandomNameGenerator (#{@file.path})"
58
75
  end
59
76
 
60
77
  private
@@ -70,6 +87,7 @@ class RandomNameGenerator
70
87
  def determine_next_syllables(count, pre, syllables)
71
88
  name = Array(pre)
72
89
  return name if count < 1
90
+
73
91
  next_syllable = pre
74
92
  count.times do
75
93
  next_syllable = determine_next_syllable(next_syllable, syllables)
@@ -81,7 +99,7 @@ class RandomNameGenerator
81
99
  def determine_next_syllable(this_syllable, sampler)
82
100
  next_syllable = ''
83
101
  loop do
84
- next_syllable = sampler.sample
102
+ next_syllable = sampler.sample(random: @rnd)
85
103
  break unless this_syllable.incompatible?(next_syllable)
86
104
  end
87
105
  next_syllable
@@ -29,18 +29,22 @@
29
29
  # syllable and SEPARATE WITH WHITESPACE. (example: "aad +v -c"). The order of rules is not important.
30
30
  #
31
31
  # RULES:
32
- # 1) +v means that next syllable must definitely start with a vocal.
32
+ # 1) +v means that next syllable must definitely start with a vowel.
33
33
  # 2) +c means that next syllable must definitely start with a consonant.
34
- # 3) -v means that this syllable can only be added to another syllable, that ends with a vocal.
34
+ # 3) -v means that this syllable can only be added to another syllable, that ends with a vowel.
35
35
  # 4) -c means that this syllable can only be added to another syllable, that ends with a consonant.
36
+ #
37
+ # :reek:TooManyMethods
38
+ # :reek:TooManyInstanceVariables
36
39
  class RNGSyllable
37
40
  attr_reader :raw, :syllable, :next_syllable_requirement, :previous_syllable_requirement
38
41
 
39
- VOWELS = %w(i y ɨ ʉ ɯ u ɪ ʏ ʊ ɯ ʊ e ø ɘ ɵ ɤ o ø ə ɵ ɤ o ɛ œ ɜ ɞ ʌ ɔ æ ɐ ɞ a ɶ ä ɒ ɑ).freeze
40
- CONSONANTS = %w(b ɓ ʙ β c d ɗ ɖ ð f g h j k l ł m ɱ n ɳ p q r s t v w x y z).freeze
42
+ VOWELS ||= %w[i y ɨ ʉ ɯ u ɪ ʏ ʊ ɯ ʊ e ø ɘ ɵ ɤ o ø ə ɵ ɤ o ɛ œ ɜ ɞ ʌ ɔ æ ɐ ɞ a ɶ ä ɒ ɑ].freeze
43
+ CONSONANTS ||= %w[b ɓ ʙ β c d ɗ ɖ ð f g h j k l ł m ɱ n ɳ p q r s t v w x y z].freeze
41
44
 
42
45
  def initialize(args)
43
46
  @raw = args
47
+ @syllable = ''
44
48
  @is_prefix = false
45
49
  @is_suffix = false
46
50
  @next_syllable_requirement = :letter
@@ -119,8 +123,9 @@ class RNGSyllable
119
123
 
120
124
  private
121
125
 
126
+ # :reek:FeatureEnvy
122
127
  def parse_args(args)
123
- args = raw.to_s.strip.downcase.split(' ')
128
+ args = args.to_s.strip.downcase.split(' ')
124
129
  parse_syllable(args[0])
125
130
  parse_flags(args[1..-1])
126
131
  end
@@ -1,16 +1,15 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
1
+ lib = File.expand_path('lib', __dir__)
3
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
3
 
5
4
  Gem::Specification.new do |spec|
6
5
  spec.name = 'random_name_generator'
7
- spec.version = '1.0.0'
6
+ spec.version = '1.2.2'
8
7
  spec.authors = ['folkengine']
9
8
  spec.email = ['gaoler@electronicpanopticon.com']
10
9
  spec.licenses = ['GPL-3.0']
11
10
 
12
11
  spec.summary = 'Random Name Generator'
13
- spec.description = 'Generates random names based upon custom collections of syllables. Styles include Elvish, Fantasy, Goblin, and Roman'
12
+ spec.description = 'Generates random names based upon custom collections of syllables. Styles include Elvish, Fantasy, Goblin, and Roman. Has Englich(default) and Cyrillic modes.'
14
13
  spec.homepage = 'https://github.com/folkengine/random_name_generator'
15
14
 
16
15
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
@@ -18,7 +17,7 @@ Gem::Specification.new do |spec|
18
17
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
18
  spec.require_paths = ['lib']
20
19
 
21
- spec.required_ruby_version = '>= 2.1.5'
22
- spec.add_development_dependency 'bundler', '~> 1.11'
23
- spec.add_development_dependency 'rake', '~> 10.0'
20
+ spec.required_ruby_version = '>= 2.5'
21
+ spec.add_development_dependency 'bundler'
22
+ spec.add_development_dependency 'rake'
24
23
  end
metadata CHANGED
@@ -1,45 +1,45 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: random_name_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - folkengine
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-03-22 00:00:00.000000000 Z
11
+ date: 2021-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.11'
19
+ version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.11'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '0'
41
41
  description: Generates random names based upon custom collections of syllables. Styles
42
- include Elvish, Fantasy, Goblin, and Roman
42
+ include Elvish, Fantasy, Goblin, and Roman. Has Englich(default) and Cyrillic modes.
43
43
  email:
44
44
  - gaoler@electronicpanopticon.com
45
45
  executables: []
@@ -48,10 +48,10 @@ extra_rdoc_files: []
48
48
  files:
49
49
  - ".codeclimate.yml"
50
50
  - ".coveralls.yml"
51
+ - ".github/workflows/ruby.yml"
51
52
  - ".gitignore"
52
53
  - ".overcommit.yml"
53
54
  - ".rubocop.yml"
54
- - ".travis.yml"
55
55
  - Gemfile
56
56
  - Gemfile.lock
57
57
  - LICENSE
@@ -63,9 +63,13 @@ files:
63
63
  - config.reek
64
64
  - lib/random_name_generator.rb
65
65
  - lib/random_name_generator/languages/demonic.txt
66
+ - lib/random_name_generator/languages/elven-ru.txt
66
67
  - lib/random_name_generator/languages/elven.txt
68
+ - lib/random_name_generator/languages/fantasy-ru.txt
67
69
  - lib/random_name_generator/languages/fantasy.txt
70
+ - lib/random_name_generator/languages/goblin-ru.txt
68
71
  - lib/random_name_generator/languages/goblin.txt
72
+ - lib/random_name_generator/languages/roman-ru.txt
69
73
  - lib/random_name_generator/languages/roman.txt
70
74
  - lib/random_name_generator/random_name_generator.rb
71
75
  - lib/random_name_generator/rng_syllable.rb
@@ -74,7 +78,7 @@ homepage: https://github.com/folkengine/random_name_generator
74
78
  licenses:
75
79
  - GPL-3.0
76
80
  metadata: {}
77
- post_install_message:
81
+ post_install_message:
78
82
  rdoc_options: []
79
83
  require_paths:
80
84
  - lib
@@ -82,16 +86,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
82
86
  requirements:
83
87
  - - ">="
84
88
  - !ruby/object:Gem::Version
85
- version: 2.1.5
89
+ version: '2.5'
86
90
  required_rubygems_version: !ruby/object:Gem::Requirement
87
91
  requirements:
88
92
  - - ">="
89
93
  - !ruby/object:Gem::Version
90
94
  version: '0'
91
95
  requirements: []
92
- rubyforge_project:
93
- rubygems_version: 2.5.1
94
- signing_key:
96
+ rubygems_version: 3.2.3
97
+ signing_key:
95
98
  specification_version: 4
96
99
  summary: Random Name Generator
97
100
  test_files: []
data/.travis.yml DELETED
@@ -1,5 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - "2.1.5"
4
- - "2.2.0"
5
- - "2.3.0"