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 CHANGED
@@ -12,3 +12,5 @@ Rake::TestTask.new do |t|
12
12
  t.test_files = FileList['test/**/*_test.rb']
13
13
  t.verbose = true
14
14
  end
15
+
16
+ task :default => :test
@@ -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
@@ -0,0 +1,4 @@
1
+ desc "Open an irb session preloaded with this library"
2
+ task :console do
3
+ sh "irb -rubygems -I lib -r ad_gladium.rb"
4
+ end
@@ -1,3 +1,3 @@
1
1
  module RomanNameGenerator
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -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
@@ -1,6 +1,6 @@
1
1
  require 'minitest_helper'
2
2
 
3
- describe RomanNameGenerator::Generator do
3
+ describe RomanNameGenerator do
4
4
 
5
5
  it_must_behave_like 'a male roman name'
6
6
 
@@ -0,0 +1,8 @@
1
+ shared_examples_for "a rubygem" do
2
+ describe "RomanNameGenerator" do
3
+ it "must have a version" do
4
+ @subject = RomanNameGenerator
5
+ @subject.version.wont_equal nil
6
+ end
7
+ end
8
+ end
@@ -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 'generator'
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.0
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.000000000 Z
12
+ date: 2012-03-16 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: rake
16
- requirement: &2160960260 !ruby/object:Gem::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: *2160960260
24
+ version_requirements: *2156763280
25
25
  - !ruby/object:Gem::Dependency
26
- name: minitest
27
- requirement: &2160959840 !ruby/object:Gem::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: *2160959840
35
+ version_requirements: *2164612840
36
36
  - !ruby/object:Gem::Dependency
37
- name: mocha
38
- requirement: &2160959380 !ruby/object:Gem::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: *2160959380
46
+ version_requirements: *2164612420
47
47
  - !ruby/object:Gem::Dependency
48
- name: turn
49
- requirement: &2160958940 !ruby/object:Gem::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: *2160958940
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/generator.rb
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/generator_test.rb
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/generator_test.rb
105
+ - test/lib/roman_name_generator_test.rb
106
+ - test/lib/version_test.rb
104
107
  - test/minitest_helper.rb