roman-name-generator 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +2 -0
- data/lib/{generator.rb → roman_name_generator.rb} +11 -5
- data/lib/tasks/console.rb +4 -0
- data/lib/version.rb +1 -1
- data/roman-name-generator.gemspec +1 -1
- data/test/lib/{generator_test.rb → roman_name_generator_test.rb} +1 -1
- data/test/lib/version_test.rb +8 -0
- data/test/minitest_helper.rb +3 -1
- metadata +20 -17
data/Rakefile
CHANGED
@@ -5,6 +5,11 @@ $:.unshift(File.dirname(__FILE__)+'/lib')
|
|
5
5
|
|
6
6
|
module RomanNameGenerator
|
7
7
|
class Generator
|
8
|
+
|
9
|
+
def self.version
|
10
|
+
"0.1.0"
|
11
|
+
end
|
12
|
+
|
8
13
|
attr_accessor :name_data, :gender, :result, :type
|
9
14
|
|
10
15
|
def initialize(gender)
|
@@ -14,12 +19,12 @@ module RomanNameGenerator
|
|
14
19
|
|
15
20
|
private
|
16
21
|
|
17
|
-
def random_name
|
22
|
+
def random_name # :nodoc:
|
18
23
|
load_name_data if self.name_data.nil?
|
19
24
|
[random_first_name, random_middle_name, random_last_name].join(" ")
|
20
25
|
end
|
21
26
|
|
22
|
-
def random_first_name
|
27
|
+
def random_first_name # :nodoc:
|
23
28
|
case self.gender
|
24
29
|
when "male"
|
25
30
|
data = self.name_data['praenomens']
|
@@ -30,7 +35,7 @@ module RomanNameGenerator
|
|
30
35
|
end
|
31
36
|
end
|
32
37
|
|
33
|
-
def random_middle_name
|
38
|
+
def random_middle_name # :nodoc:
|
34
39
|
case self.gender
|
35
40
|
when "male"
|
36
41
|
data = self.name_data['nomens']['male']
|
@@ -40,7 +45,7 @@ module RomanNameGenerator
|
|
40
45
|
end
|
41
46
|
end
|
42
47
|
|
43
|
-
def random_last_name
|
48
|
+
def random_last_name # :nodoc:
|
44
49
|
case self.gender
|
45
50
|
when "male"
|
46
51
|
data = self.name_data['cognomens']['male']
|
@@ -51,7 +56,7 @@ module RomanNameGenerator
|
|
51
56
|
end
|
52
57
|
end
|
53
58
|
|
54
|
-
def load_name_data
|
59
|
+
def load_name_data # :nodoc:
|
55
60
|
self.name_data = JSON(
|
56
61
|
File.open(
|
57
62
|
File.expand_path("../data/names.json", __FILE__)
|
@@ -59,4 +64,5 @@ module RomanNameGenerator
|
|
59
64
|
)
|
60
65
|
end
|
61
66
|
end
|
67
|
+
|
62
68
|
end
|
data/lib/version.rb
CHANGED
@@ -15,8 +15,8 @@ Gem::Specification.new do |gem|
|
|
15
15
|
gem.require_paths = ["lib"]
|
16
16
|
gem.version = RomanNameGenerator::VERSION
|
17
17
|
|
18
|
-
gem.add_development_dependency('rake')
|
19
18
|
gem.add_development_dependency('minitest')
|
20
19
|
gem.add_development_dependency('mocha')
|
21
20
|
gem.add_development_dependency('turn')
|
21
|
+
gem.add_development_dependency('simplecov')
|
22
22
|
end
|
data/test/minitest_helper.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
gem 'minitest'
|
2
|
+
|
1
3
|
require 'minitest/spec'
|
2
4
|
require 'minitest/autorun'
|
3
5
|
require 'mocha'
|
@@ -8,7 +10,7 @@ SimpleCov.start
|
|
8
10
|
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
9
11
|
$:.unshift File.join(File.dirname(__FILE__), '..', 'test')
|
10
12
|
|
11
|
-
require '
|
13
|
+
require 'roman_name_generator'
|
12
14
|
|
13
15
|
MiniTest::Spec.class_eval do
|
14
16
|
def self.shared_examples
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roman-name-generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-03-16 00:00:00.
|
12
|
+
date: 2012-03-16 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
16
|
-
requirement: &
|
15
|
+
name: minitest
|
16
|
+
requirement: &2156763280 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2156763280
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
|
-
name:
|
27
|
-
requirement: &
|
26
|
+
name: mocha
|
27
|
+
requirement: &2164612840 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2164612840
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
|
-
name:
|
38
|
-
requirement: &
|
37
|
+
name: turn
|
38
|
+
requirement: &2164612420 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2164612420
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
|
-
name:
|
49
|
-
requirement: &
|
48
|
+
name: simplecov
|
49
|
+
requirement: &2164612000 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *2164612000
|
58
58
|
description: A fun generator to generate ancient roman names
|
59
59
|
email:
|
60
60
|
- james@rubyloves.me
|
@@ -68,11 +68,13 @@ files:
|
|
68
68
|
- README.md
|
69
69
|
- Rakefile
|
70
70
|
- lib/data/names.json
|
71
|
-
- lib/
|
71
|
+
- lib/roman_name_generator.rb
|
72
|
+
- lib/tasks/console.rb
|
72
73
|
- lib/version.rb
|
73
74
|
- roman-name-generator.gemspec
|
74
75
|
- test/_shared_examples/male_roman_name_test.rb
|
75
|
-
- test/lib/
|
76
|
+
- test/lib/roman_name_generator_test.rb
|
77
|
+
- test/lib/version_test.rb
|
76
78
|
- test/minitest_helper.rb
|
77
79
|
homepage: ''
|
78
80
|
licenses: []
|
@@ -100,5 +102,6 @@ specification_version: 3
|
|
100
102
|
summary: A fun generator to generate ancient roman names
|
101
103
|
test_files:
|
102
104
|
- test/_shared_examples/male_roman_name_test.rb
|
103
|
-
- test/lib/
|
105
|
+
- test/lib/roman_name_generator_test.rb
|
106
|
+
- test/lib/version_test.rb
|
104
107
|
- test/minitest_helper.rb
|