Skip to content

Commit

Permalink
Merge branch 'release/1.0.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
folkengine committed Jan 20, 2019
2 parents 0dbefc2 + 7e31408 commit 9eca2fc
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 65 deletions.
6 changes: 6 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ Metrics/AbcSize:
Enabled: true
Max: 22

Metrics/BlockLength:
Max: 30

Metrics/ClassLength:
Description: 'Avoid classes longer than 100 lines of code.'
Enabled: false
Expand All @@ -11,6 +14,9 @@ Metrics/LineLength:
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
Enabled: false

Metrics/MethodLength:
Max: 12

Style/Documentation:
Description: 'Document classes and non-namespace modules.'
Enabled: false
Expand Down
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
language: ruby
rvm:
- "2.1.5"
- "2.2.0"
- "2.3.0"
- "2.3.1"
- "2.5.1"
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ gem 'pry', '~> 0.10.3'
# gem 'slop', '~> 4.2', '>= 4.2.1'

group :development do
gem 'guard'
gem 'guard-minitest'
gem 'minitest'
gem 'minitest-reporters'
gem 'mocha'
gem 'guard'
gem 'guard-minitest'
gem 'reek'
gem 'rubocop'
end

gem 'codeclimate-test-reporter', group: :test, require: nil
gem 'coveralls', require: false
gem 'simplecov', require: false, group: :test
121 changes: 71 additions & 50 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,93 +1,114 @@
PATH
remote: .
specs:
random_name_generator (1.0.2)
random_name_generator (1.0.3)

GEM
remote: https://rubygems.org/
specs:
ansi (1.5.0)
ast (2.2.0)
ast (2.4.0)
axiom-types (0.1.1)
descendants_tracker (~> 0.0.4)
ice_nine (~> 0.11.0)
thread_safe (~> 0.3, >= 0.3.1)
builder (3.2.2)
codeclimate-engine-rb (0.3.1)
builder (3.2.3)
codeclimate-engine-rb (0.4.1)
virtus (~> 1.0)
codeclimate-test-reporter (0.5.0)
simplecov (>= 0.7.1, < 1.0.0)
coderay (1.1.1)
coderay (1.1.2)
coercible (1.0.0)
descendants_tracker (~> 0.0.1)
coveralls (0.8.13)
json (~> 1.8)
simplecov (~> 0.11.0)
coveralls (0.8.19)
json (>= 1.8, < 3)
simplecov (~> 0.12.0)
term-ansicolor (~> 1.3)
thor (~> 0.19.1)
tins (~> 1.6.0)
tins (~> 1.6)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
docile (1.1.5)
equalizer (0.0.11)
ffi (1.9.10)
guard (1.4.0)
listen (>= 0.4.2)
thor (>= 0.14.6)
ffi (1.10.0)
formatador (0.2.5)
guard (2.15.0)
formatador (>= 0.2.4)
listen (>= 2.7, < 4.0)
lumberjack (>= 1.0.12, < 2.0)
nenv (~> 0.1)
notiffany (~> 0.0)
pry (>= 0.9.12)
shellany (~> 0.0)
thor (>= 0.18.1)
guard-compat (1.2.1)
guard-minitest (2.4.4)
guard-minitest (2.4.6)
guard-compat (~> 1.2)
minitest (>= 3.0)
ice_nine (0.11.2)
json (1.8.3)
listen (3.0.6)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9.7)
jaro_winkler (1.5.2)
json (2.1.0)
kwalify (0.7.2)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
lumberjack (1.0.13)
metaclass (0.0.4)
method_source (0.8.2)
minitest (5.8.4)
minitest-reporters (1.1.8)
minitest (5.11.3)
minitest-reporters (1.3.6)
ansi
builder
minitest (>= 5.0)
ruby-progressbar
mocha (1.1.0)
mocha (1.8.0)
metaclass (~> 0.0.1)
parser (2.3.0.6)
ast (~> 2.2)
powerpack (0.1.1)
pry (0.10.3)
nenv (0.3.0)
notiffany (0.1.1)
nenv (~> 0.1)
shellany (~> 0.0)
parallel (1.13.0)
parser (2.5.3.0)
ast (~> 2.4.0)
powerpack (0.1.2)
pry (0.10.4)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
rainbow (2.1.0)
psych (3.1.0)
rainbow (3.0.0)
rake (10.5.0)
rb-fsevent (0.9.7)
rb-inotify (0.9.7)
ffi (>= 0.5.0)
reek (4.0.0)
codeclimate-engine-rb (~> 0.3.1)
parser (~> 2.3, >= 2.3.0.6)
rainbow (~> 2.0)
rubocop (0.38.0)
parser (>= 2.3.0.6, < 3.0)
rb-fsevent (0.10.3)
rb-inotify (0.10.0)
ffi (~> 1.0)
reek (5.3.0)
codeclimate-engine-rb (~> 0.4.0)
kwalify (~> 0.7.0)
parser (>= 2.5.0.0, < 2.6, != 2.5.1.1)
psych (~> 3.1.0)
rainbow (>= 2.0, < 4.0)
rubocop (0.63.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.5, != 2.5.1.1)
powerpack (~> 0.1)
rainbow (>= 1.99.1, < 3.0)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.7.5)
simplecov (0.11.2)
unicode-display_width (~> 1.4.0)
ruby-progressbar (1.10.0)
ruby_dep (1.5.0)
shellany (0.0.1)
simplecov (0.12.0)
docile (~> 1.1.0)
json (~> 1.8)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
simplecov-html (0.10.2)
slop (3.6.0)
term-ansicolor (1.3.2)
term-ansicolor (1.7.1)
tins (~> 1.0)
thor (0.19.1)
thread_safe (0.3.5)
tins (1.6.0)
unicode-display_width (1.0.2)
thor (0.19.4)
thread_safe (0.3.6)
tins (1.20.2)
unicode-display_width (1.4.1)
virtus (1.0.5)
axiom-types (~> 0.1)
coercible (~> 1.0)
Expand All @@ -99,7 +120,6 @@ PLATFORMS

DEPENDENCIES
bundler (~> 1.11)
codeclimate-test-reporter
coveralls
guard
guard-minitest
Expand All @@ -111,6 +131,7 @@ DEPENDENCIES
random_name_generator!
reek
rubocop
simplecov

BUNDLED WITH
1.11.2
1.16.5
4 changes: 4 additions & 0 deletions lib/random_name_generator/random_name_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# rng = RandomNameGenerator.new
# puts rng.compose
#
# :reek:TooManyInstanceVariables
# :reek:TooManyStatements
class RandomNameGenerator
dirname = File.dirname(__FILE__)

Expand All @@ -23,6 +25,7 @@ class RandomNameGenerator
attr_reader :pre, :pre_syllables, :sur_syllables, :mid_syllables

def initialize(filename = RandomNameGenerator::FANTASY, random: Random.new)
@pre = nil
@file = File.new(filename)
@rnd = random
@pre_syllables = []
Expand Down Expand Up @@ -71,6 +74,7 @@ def determine_last_syllable(next_to_last_syllable)
def determine_next_syllables(count, pre, syllables)
name = Array(pre)
return name if count < 1

next_syllable = pre
count.times do
next_syllable = determine_next_syllable(next_syllable, syllables)
Expand Down
11 changes: 8 additions & 3 deletions lib/random_name_generator/rng_syllable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,18 @@
# 2) +c means that next syllable must definitely start with a consonant.
# 3) -v means that this syllable can only be added to another syllable, that ends with a vocal.
# 4) -c means that this syllable can only be added to another syllable, that ends with a consonant.
#
# :reek:TooManyMethods
# :reek:TooManyInstanceVariables
class RNGSyllable
attr_reader :raw, :syllable, :next_syllable_requirement, :previous_syllable_requirement

VOWELS ||= %w(i y ɨ ʉ ɯ u ɪ ʏ ʊ ɯ ʊ e ø ɘ ɵ ɤ o ø ə ɵ ɤ o ɛ œ ɜ ɞ ʌ ɔ æ ɐ ɞ a ɶ ä ɒ ɑ).freeze
CONSONANTS ||= %w(b ɓ ʙ β c d ɗ ɖ ð f g h j k l ł m ɱ n ɳ p q r s t v w x y z).freeze
VOWELS ||= %w[i y ɨ ʉ ɯ u ɪ ʏ ʊ ɯ ʊ e ø ɘ ɵ ɤ o ø ə ɵ ɤ o ɛ œ ɜ ɞ ʌ ɔ æ ɐ ɞ a ɶ ä ɒ ɑ].freeze
CONSONANTS ||= %w[b ɓ ʙ β c d ɗ ɖ ð f g h j k l ł m ɱ n ɳ p q r s t v w x y z].freeze

def initialize(args)
@raw = args
@syllable = ''
@is_prefix = false
@is_suffix = false
@next_syllable_requirement = :letter
Expand Down Expand Up @@ -119,8 +123,9 @@ def to_str

private

# :reek:FeatureEnvy
def parse_args(args)
args = raw.to_s.strip.downcase.split(' ')
args = args.to_s.strip.downcase.split(' ')
parse_syllable(args[0])
parse_flags(args[1..-1])
end
Expand Down
7 changes: 3 additions & 4 deletions random_name_generator.gemspec
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)

Gem::Specification.new do |spec|
spec.name = 'random_name_generator'
spec.version = '1.0.2'
spec.version = '1.0.3'
spec.authors = ['folkengine']
spec.email = ['gaoler@electronicpanopticon.com']
spec.licenses = ['GPL-3.0']
Expand All @@ -18,7 +17,7 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ['lib']

spec.required_ruby_version = '>= 2.1.5'
spec.required_ruby_version = '>= 2.2'
spec.add_development_dependency 'bundler', '~> 1.11'
spec.add_development_dependency 'rake', '~> 10.0'
end
4 changes: 2 additions & 2 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'codeclimate-test-reporter'
CodeClimate::TestReporter.start
require 'simplecov'
SimpleCov.start

require 'minitest/autorun'
require 'minitest/reporters'
Expand Down

0 comments on commit 9eca2fc

Please sign in to comment.