random_name_generator 1.0.2 → 1.0.3

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: d48e578b1565cbd10d88e50d2104ffbaddd577a3
4
- data.tar.gz: 2e20c6a40dda27afd86325c798594f67dba24684
2
+ SHA256:
3
+ metadata.gz: 9e082f32e06f8e4a503dbb656a81e0042190056989561fc854df10a07ae6e4d4
4
+ data.tar.gz: 67bc5df8476f6f5f88ba4f8f8727e6b1ac47ee5a96987d02cfb36dfe5df663aa
5
5
  SHA512:
6
- metadata.gz: d38347354b91c0ba18e4fd85c5193937cd1c99dae4f3195c43cade5eeadd6aae28b3a7e6556637de552a8cef07e9c0bedca7ee340e03194209a632712cddbb3e
7
- data.tar.gz: b24acfdb4562a50894e411528dc4abe4ae4e2a492bf8dfedaa43f7346f23b5b2dc6c96147044f4e9245d7321ec31c4b55ec3dce1b63330229f8675467ed84c35
6
+ metadata.gz: 8705296f0712ade19e48e7960447f7e3fd01419a8d3f1bc813f1bc485276788d0025dd6d707eb1422c0f9f467d6dc29326d52833d10965c4561bd830b47b3c56
7
+ data.tar.gz: ca7e284eb7b8c806cfb7a5b43f95e09ed1a9bd845af5047fbfc6e52130fd3b39f3e7bfede0b58db69698b53cc2d8cf27a6e1b7c30e64c80cf80dd6727c804dce
@@ -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
@@ -1,5 +1,4 @@
1
1
  language: ruby
2
2
  rvm:
3
- - "2.1.5"
4
- - "2.2.0"
5
- - "2.3.0"
3
+ - "2.3.1"
4
+ - "2.5.1"
data/Gemfile CHANGED
@@ -6,14 +6,14 @@ gem 'pry', '~> 0.10.3'
6
6
  # gem 'slop', '~> 4.2', '>= 4.2.1'
7
7
 
8
8
  group :development do
9
+ gem 'guard'
10
+ gem 'guard-minitest'
9
11
  gem 'minitest'
10
12
  gem 'minitest-reporters'
11
13
  gem 'mocha'
12
- gem 'guard'
13
- gem 'guard-minitest'
14
14
  gem 'reek'
15
15
  gem 'rubocop'
16
16
  end
17
17
 
18
- gem 'codeclimate-test-reporter', group: :test, require: nil
19
18
  gem 'coveralls', require: false
19
+ gem 'simplecov', require: false, group: :test
@@ -1,93 +1,114 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- random_name_generator (1.0.2)
4
+ random_name_generator (1.0.3)
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)
10
+ ast (2.4.0)
11
11
  axiom-types (0.1.1)
12
12
  descendants_tracker (~> 0.0.4)
13
13
  ice_nine (~> 0.11.0)
14
14
  thread_safe (~> 0.3, >= 0.3.1)
15
- builder (3.2.2)
16
- codeclimate-engine-rb (0.3.1)
15
+ builder (3.2.3)
16
+ codeclimate-engine-rb (0.4.1)
17
17
  virtus (~> 1.0)
18
- codeclimate-test-reporter (0.5.0)
19
- simplecov (>= 0.7.1, < 1.0.0)
20
- coderay (1.1.1)
18
+ coderay (1.1.2)
21
19
  coercible (1.0.0)
22
20
  descendants_tracker (~> 0.0.1)
23
- coveralls (0.8.13)
24
- json (~> 1.8)
25
- simplecov (~> 0.11.0)
21
+ coveralls (0.8.19)
22
+ json (>= 1.8, < 3)
23
+ simplecov (~> 0.12.0)
26
24
  term-ansicolor (~> 1.3)
27
25
  thor (~> 0.19.1)
28
- tins (~> 1.6.0)
26
+ tins (~> 1.6)
29
27
  descendants_tracker (0.0.4)
30
28
  thread_safe (~> 0.3, >= 0.3.1)
31
29
  docile (1.1.5)
32
30
  equalizer (0.0.11)
33
- ffi (1.9.10)
34
- guard (1.4.0)
35
- listen (>= 0.4.2)
36
- thor (>= 0.14.6)
31
+ ffi (1.10.0)
32
+ formatador (0.2.5)
33
+ guard (2.15.0)
34
+ formatador (>= 0.2.4)
35
+ listen (>= 2.7, < 4.0)
36
+ lumberjack (>= 1.0.12, < 2.0)
37
+ nenv (~> 0.1)
38
+ notiffany (~> 0.0)
39
+ pry (>= 0.9.12)
40
+ shellany (~> 0.0)
41
+ thor (>= 0.18.1)
37
42
  guard-compat (1.2.1)
38
- guard-minitest (2.4.4)
43
+ guard-minitest (2.4.6)
39
44
  guard-compat (~> 1.2)
40
45
  minitest (>= 3.0)
41
46
  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)
47
+ jaro_winkler (1.5.2)
48
+ json (2.1.0)
49
+ kwalify (0.7.2)
50
+ listen (3.1.5)
51
+ rb-fsevent (~> 0.9, >= 0.9.4)
52
+ rb-inotify (~> 0.9, >= 0.9.7)
53
+ ruby_dep (~> 1.2)
54
+ lumberjack (1.0.13)
46
55
  metaclass (0.0.4)
47
56
  method_source (0.8.2)
48
- minitest (5.8.4)
49
- minitest-reporters (1.1.8)
57
+ minitest (5.11.3)
58
+ minitest-reporters (1.3.6)
50
59
  ansi
51
60
  builder
52
61
  minitest (>= 5.0)
53
62
  ruby-progressbar
54
- mocha (1.1.0)
63
+ mocha (1.8.0)
55
64
  metaclass (~> 0.0.1)
56
- parser (2.3.0.6)
57
- ast (~> 2.2)
58
- powerpack (0.1.1)
59
- pry (0.10.3)
65
+ nenv (0.3.0)
66
+ notiffany (0.1.1)
67
+ nenv (~> 0.1)
68
+ shellany (~> 0.0)
69
+ parallel (1.13.0)
70
+ parser (2.5.3.0)
71
+ ast (~> 2.4.0)
72
+ powerpack (0.1.2)
73
+ pry (0.10.4)
60
74
  coderay (~> 1.1.0)
61
75
  method_source (~> 0.8.1)
62
76
  slop (~> 3.4)
63
- rainbow (2.1.0)
77
+ psych (3.1.0)
78
+ rainbow (3.0.0)
64
79
  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)
80
+ rb-fsevent (0.10.3)
81
+ rb-inotify (0.10.0)
82
+ ffi (~> 1.0)
83
+ reek (5.3.0)
84
+ codeclimate-engine-rb (~> 0.4.0)
85
+ kwalify (~> 0.7.0)
86
+ parser (>= 2.5.0.0, < 2.6, != 2.5.1.1)
87
+ psych (~> 3.1.0)
88
+ rainbow (>= 2.0, < 4.0)
89
+ rubocop (0.63.0)
90
+ jaro_winkler (~> 1.5.1)
91
+ parallel (~> 1.10)
92
+ parser (>= 2.5, != 2.5.1.1)
74
93
  powerpack (~> 0.1)
75
- rainbow (>= 1.99.1, < 3.0)
94
+ rainbow (>= 2.2.2, < 4.0)
76
95
  ruby-progressbar (~> 1.7)
77
- unicode-display_width (~> 1.0, >= 1.0.1)
78
- ruby-progressbar (1.7.5)
79
- simplecov (0.11.2)
96
+ unicode-display_width (~> 1.4.0)
97
+ ruby-progressbar (1.10.0)
98
+ ruby_dep (1.5.0)
99
+ shellany (0.0.1)
100
+ simplecov (0.12.0)
80
101
  docile (~> 1.1.0)
81
- json (~> 1.8)
102
+ json (>= 1.8, < 3)
82
103
  simplecov-html (~> 0.10.0)
83
- simplecov-html (0.10.0)
104
+ simplecov-html (0.10.2)
84
105
  slop (3.6.0)
85
- term-ansicolor (1.3.2)
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)
108
+ thor (0.19.4)
109
+ thread_safe (0.3.6)
110
+ tins (1.20.2)
111
+ unicode-display_width (1.4.1)
91
112
  virtus (1.0.5)
92
113
  axiom-types (~> 0.1)
93
114
  coercible (~> 1.0)
@@ -99,7 +120,6 @@ PLATFORMS
99
120
 
100
121
  DEPENDENCIES
101
122
  bundler (~> 1.11)
102
- codeclimate-test-reporter
103
123
  coveralls
104
124
  guard
105
125
  guard-minitest
@@ -111,6 +131,7 @@ DEPENDENCIES
111
131
  random_name_generator!
112
132
  reek
113
133
  rubocop
134
+ simplecov
114
135
 
115
136
  BUNDLED WITH
116
- 1.11.2
137
+ 1.16.5
data/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  [![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
8
  [![Inline docs](http://inch-ci.org/github/folkengine/random_name_generator.svg?branch=master)](http://inch-ci.org/github/folkengine/random_name_generator)
9
9
 
10
- Ruby port of [java-random-name-generator](https://github.com/folkengine/java-random-name-generator).
10
+ 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
11
 
12
12
  The big difference between this random name generator and others is that it allows you to create names in various
13
13
  custom styles such as Elven, and Roman. If you're looking for a quick name for a Goblin NPC, RandomNameGenerator is
@@ -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
 
@@ -23,6 +25,7 @@ class RandomNameGenerator
23
25
  attr_reader :pre, :pre_syllables, :sur_syllables, :mid_syllables
24
26
 
25
27
  def initialize(filename = RandomNameGenerator::FANTASY, random: Random.new)
28
+ @pre = nil
26
29
  @file = File.new(filename)
27
30
  @rnd = random
28
31
  @pre_syllables = []
@@ -71,6 +74,7 @@ class RandomNameGenerator
71
74
  def determine_next_syllables(count, pre, syllables)
72
75
  name = Array(pre)
73
76
  return name if count < 1
77
+
74
78
  next_syllable = pre
75
79
  count.times do
76
80
  next_syllable = determine_next_syllable(next_syllable, syllables)
@@ -33,14 +33,18 @@
33
33
  # 2) +c means that next syllable must definitely start with a consonant.
34
34
  # 3) -v means that this syllable can only be added to another syllable, that ends with a vocal.
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,10 +1,9 @@
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.2'
6
+ spec.version = '1.0.3'
8
7
  spec.authors = ['folkengine']
9
8
  spec.email = ['gaoler@electronicpanopticon.com']
10
9
  spec.licenses = ['GPL-3.0']
@@ -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'
20
+ spec.required_ruby_version = '>= 2.2'
22
21
  spec.add_development_dependency 'bundler', '~> 1.11'
23
22
  spec.add_development_dependency 'rake', '~> 10.0'
24
23
  end
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.2
4
+ version: 1.0.3
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-27 00:00:00.000000000 Z
11
+ date: 2019-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -82,7 +82,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
82
82
  requirements:
83
83
  - - ">="
84
84
  - !ruby/object:Gem::Version
85
- version: 2.1.5
85
+ version: '2.2'
86
86
  required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  requirements:
88
88
  - - ">="
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
90
  version: '0'
91
91
  requirements: []
92
92
  rubyforge_project:
93
- rubygems_version: 2.5.1
93
+ rubygems_version: 2.7.7
94
94
  signing_key:
95
95
  specification_version: 4
96
96
  summary: Random Name Generator