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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ef97eac73bd01cde0aacdd9342b7514ffa29788d
4
- data.tar.gz: 97dd28a80b0d73b84f8f00e2dc6103930fab19c2
3
+ metadata.gz: 49d5b89e4edee43f69ef573a5d9af208f939a24f
4
+ data.tar.gz: 17ea272cbef1027fcb661e640d5b532468685237
5
5
  SHA512:
6
- metadata.gz: 40bb462a879adb4a844ed64b9443d5ded04f7c2f26a96355398501dbfb724b1e336d8e781391163ae3a33a9716fe6d2721af11c2993ee38958e3a2efa775f5b9
7
- data.tar.gz: 46a06d12ab64b94ace324d895c4fd08a75acacbb02f35ee5ab1e7f14f603a87628a1e5d086c8c1aebd63b25e87a7810bd2d5c8e27606181688ab67812fc3fec2
6
+ metadata.gz: 93a6e8c08ecee6b498a0481102cf6db6a88cb1c905a7232319fead7bb6a05a9d229188a7fd14135edcf1d30f0696335451bdc7afb3f7d83afe9d96d46df87e43
7
+ data.tar.gz: 5a146b07244347e6137f03b49c3075737cb88dba1439d3396f98e183359313a7f2eff6b99a74db30846643ba3820172ba5ef91d943a081fafa291203644e165e
data/.gitignore CHANGED
@@ -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/
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- random_name_generator (1.0.0)
4
+ random_name_generator (1.0.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -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 = %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
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.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.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-22 00:00:00.000000000 Z
11
+ date: 2016-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler