random_name_generator 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/Gemfile.lock +1 -1
- data/lib/random_name_generator/random_name_generator.rb +3 -2
- data/lib/random_name_generator/rng_syllable.rb +2 -2
- data/random_name_generator.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49d5b89e4edee43f69ef573a5d9af208f939a24f
|
4
|
+
data.tar.gz: 17ea272cbef1027fcb661e640d5b532468685237
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93a6e8c08ecee6b498a0481102cf6db6a88cb1c905a7232319fead7bb6a05a9d229188a7fd14135edcf1d30f0696335451bdc7afb3f7d83afe9d96d46df87e43
|
7
|
+
data.tar.gz: 5a146b07244347e6137f03b49c3075737cb88dba1439d3396f98e183359313a7f2eff6b99a74db30846643ba3820172ba5ef91d943a081fafa291203644e165e
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -22,8 +22,9 @@ class RandomNameGenerator
|
|
22
22
|
|
23
23
|
attr_reader :pre, :pre_syllables, :sur_syllables, :mid_syllables
|
24
24
|
|
25
|
-
def initialize(filename = RandomNameGenerator::FANTASY)
|
25
|
+
def initialize(filename = RandomNameGenerator::FANTASY, random: Random.new)
|
26
26
|
@file = File.new(filename)
|
27
|
+
@rnd = random
|
27
28
|
@pre_syllables = []
|
28
29
|
@sur_syllables = []
|
29
30
|
@mid_syllables = []
|
@@ -81,7 +82,7 @@ class RandomNameGenerator
|
|
81
82
|
def determine_next_syllable(this_syllable, sampler)
|
82
83
|
next_syllable = ''
|
83
84
|
loop do
|
84
|
-
next_syllable = sampler.sample
|
85
|
+
next_syllable = sampler.sample(random: @rnd)
|
85
86
|
break unless this_syllable.incompatible?(next_syllable)
|
86
87
|
end
|
87
88
|
next_syllable
|
@@ -36,8 +36,8 @@
|
|
36
36
|
class RNGSyllable
|
37
37
|
attr_reader :raw, :syllable, :next_syllable_requirement, :previous_syllable_requirement
|
38
38
|
|
39
|
-
VOWELS
|
40
|
-
CONSONANTS
|
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
|
41
41
|
|
42
42
|
def initialize(args)
|
43
43
|
@raw = args
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'random_name_generator'
|
7
|
-
spec.version = '1.0.
|
7
|
+
spec.version = '1.0.1'
|
8
8
|
spec.authors = ['folkengine']
|
9
9
|
spec.email = ['gaoler@electronicpanopticon.com']
|
10
10
|
spec.licenses = ['GPL-3.0']
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: random_name_generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- folkengine
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|