name-generator 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: add84d13b97444b7509f20b6226f4c4d85aad5b6
4
+ data.tar.gz: 7df14eed9ffcf522e9b1e744d7ad8f7647158aee
5
+ SHA512:
6
+ metadata.gz: a57bab440a0a6ca7d9450f3f611142754382a573258d80d83c7f33ff787b4c212fb12c478a5883de0c2e5150139c84d8118fbb5b3d4f65b36c1e031be2087e62
7
+ data.tar.gz: 09239e06df8785c65aadf580bf55fe0e0b457e8bd776abac2484f6b6125fd5807f8e9a51bf60a03cf8dd90f7833fb8c3554d79fe32d2ae09ab8e07801bdcedf1
@@ -1,2 +1,2 @@
1
- require File.join(File.dirname(__FILE__), 'name-generator/main')
2
- require File.join(File.dirname(__FILE__), 'name-generator/version')
1
+ require 'name-generator/main'
2
+ require 'name-generator/version'
@@ -1,6 +1,3 @@
1
- require 'active_support/core_ext/array/random_access'
2
- require 'active_support/core_ext/string/inflections'
3
-
4
1
  # This is a ruby-rewrite of "namegen.py" by Laust Rud Jacobsen (2010).
5
2
 
6
3
  # From the original source-file (http://www.ailis.de/~k/archives/28-Name-Generator.html)
@@ -9,7 +6,6 @@ require 'active_support/core_ext/string/inflections'
9
6
  # the classic game Elite. The algorithm used in this class comes from
10
7
  # the Mote project (http://mote.sourceforge.net/)
11
8
 
12
-
13
9
  module NameGenerator
14
10
  class Main
15
11
 
@@ -18,10 +14,16 @@ module NameGenerator
18
14
  until sensible_name?(name)
19
15
  name = generate_name(syllables)
20
16
  end
21
- name.titlecase
17
+ titlecase(name)
22
18
  end
23
19
 
24
20
  private
21
+
22
+ def titlecase name
23
+ name[0] = name[0].upcase
24
+ name
25
+ end
26
+
25
27
  def generate_name syllables
26
28
  name = (1...syllables).collect do
27
29
  digraphs.sample
@@ -2,7 +2,7 @@ module NameGenerator
2
2
  module VERSION
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- TINY = 2
5
+ TINY = 3
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/spec/spec_helper.rb CHANGED
@@ -1 +1,4 @@
1
- require 'lib/name-generator'
1
+ require 'bundler'
2
+ Bundler.setup
3
+
4
+ require 'name-generator'
metadata CHANGED
@@ -1,83 +1,62 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: name-generator
3
- version: !ruby/object:Gem::Version
4
- hash: 27
5
- prerelease: false
6
- segments:
7
- - 0
8
- - 0
9
- - 2
10
- version: 0.0.2
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Laust Rud Jacobsen
14
8
  autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2010-10-14 00:00:00 +02:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
22
- name: activesupport
11
+ date: 2015-06-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rspec
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
23
21
  prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ~>
28
- - !ruby/object:Gem::Version
29
- hash: 5
30
- segments:
31
- - 3
32
- version: "3"
33
- type: :runtime
34
- version_requirements: *id001
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
35
27
  description:
36
- email: rud@personal-it.dk
28
+ email: laust@object.io
37
29
  executables: []
38
-
39
30
  extensions: []
40
-
41
31
  extra_rdoc_files: []
42
-
43
- files:
32
+ files:
33
+ - lib/name-generator.rb
44
34
  - lib/name-generator/main.rb
45
35
  - lib/name-generator/version.rb
46
- - lib/name-generator.rb
47
36
  - spec/spec_helper.rb
48
- has_rdoc: true
49
37
  homepage:
50
- licenses: []
51
-
38
+ licenses:
39
+ - MIT
40
+ metadata: {}
52
41
  post_install_message:
53
42
  rdoc_options: []
54
-
55
- require_paths:
43
+ require_paths:
56
44
  - lib
57
- required_ruby_version: !ruby/object:Gem::Requirement
58
- none: false
59
- requirements:
45
+ required_ruby_version: !ruby/object:Gem::Requirement
46
+ requirements:
60
47
  - - ">="
61
- - !ruby/object:Gem::Version
62
- hash: 3
63
- segments:
64
- - 0
65
- version: "0"
66
- required_rubygems_version: !ruby/object:Gem::Requirement
67
- none: false
68
- requirements:
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ required_rubygems_version: !ruby/object:Gem::Requirement
51
+ requirements:
69
52
  - - ">="
70
- - !ruby/object:Gem::Version
71
- hash: 3
72
- segments:
73
- - 0
74
- version: "0"
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
75
55
  requirements: []
76
-
77
56
  rubyforge_project:
78
- rubygems_version: 1.3.7
57
+ rubygems_version: 2.4.5
79
58
  signing_key:
80
- specification_version: 3
59
+ specification_version: 4
81
60
  summary: Easily generate game-compatible names
82
- test_files:
61
+ test_files:
83
62
  - spec/spec_helper.rb