random_data 1.5.1 → 1.5.2

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,7 +1,11 @@
1
- == 1.5.1 2010-01-18
2
- * 1 minor enhancement:
3
- * Moved project over to Github and Jeweler so it's easier to accept patches and release new versions
4
-
1
+ == 1.5.2 2010-11-16
2
+
3
+ * Enhancements:
4
+ * added first_name, last_name, full_name methods (Cyril David)
5
+
6
+ * Fixes:
7
+ * added utf-8 magic comment for ruby 1.9 compatibility (Tom Harris)
8
+
5
9
  == 1.5.0 2008-11-06
6
10
  * 2 major enhancement:
7
11
  * Totally cleaned up and reconfigured hoe using newgem 1.0's conventions
data/License.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010 Mike Subelsky, subelsky.com
1
+ Copyright (c) 2008 Mike Subelsky, subelsky.com
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/PostInstall.txt ADDED
File without changes
data/Rakefile CHANGED
@@ -1,16 +1,6 @@
1
- begin
2
- require 'jeweler'
3
- Jeweler::Tasks.new do |gemspec|
4
- gemspec.name = "random_data"
5
- gemspec.summary = gemspec.description = "Provides a Random class with a series of methods for generating random test data including names, mailing addresses, dates, phone numbers, e-mail addresses, and text."
6
- gemspec.email = "mike@subelsky.com"
7
- gemspec.homepage = "http://github.com/otherinbox/random_data"
8
- gemspec.authors = ["Mike Subelsky"]
9
- gemspec.add_development_dependency "mocha"
10
- gemspec.test_files = %w(test/test_random_data.rb)
11
- end
1
+ require 'rake'
2
+ require 'rake/testtask'
3
+ require 'rake/rdoctask'
12
4
 
13
- Jeweler::GemcutterTasks.new
14
- rescue LoadError
15
- puts "Jeweler not available. Install it with: sudo gem install jeweler"
16
- end
5
+ # TODO - want other tests/tasks run by default? Add them to the list
6
+ # task :default => [:spec, :features]
@@ -1,3 +1,5 @@
1
+ # coding:utf-8
2
+
1
3
  module RandomData
2
4
 
3
5
  # Defines methods to return random location data.
@@ -24,6 +24,7 @@ module RandomData
24
24
  def lastname
25
25
  @@lastnames.rand.capitalize
26
26
  end
27
+ alias last_name lastname
27
28
 
28
29
  @@male_first_names = %w(ADAM ANTHONY ARTHUR BRIAN CHARLES CHRISTOPHER DANIEL DAVID DONALD EDGAR EDWARD EDWIN
29
30
  GEORGE HAROLD HERBERT HUGH JAMES JASON JOHN JOSEPH KENNETH KEVIN MARCUS MARK MATTHEW
@@ -46,6 +47,7 @@ module RandomData
46
47
  def firstname
47
48
  @@first_names.rand.capitalize
48
49
  end
50
+ alias first_name firstname
49
51
 
50
52
 
51
53
  # Returns a random male firstname
@@ -57,6 +59,7 @@ module RandomData
57
59
  def firstname_male
58
60
  @@male_first_names.rand.capitalize
59
61
  end
62
+ alias first_name_male firstname_male
60
63
 
61
64
 
62
65
  # Returns a random female firstname
@@ -68,6 +71,11 @@ module RandomData
68
71
  def firstname_female
69
72
  @@female_first_names.rand.capitalize
70
73
  end
71
-
74
+ alias first_name_female firstname_female
75
+
76
+ # Returns a random full name
77
+ def full_name(options = { :initial => false, :gender => nil })
78
+ "#{first_name} #{last_name}"
79
+ end
72
80
  end
73
81
  end
@@ -1,3 +1,3 @@
1
1
  module RandomData #:nodoc:
2
- VERSION = '1.5.0' #:nodoc:
2
+ VERSION = '1.5.2' #:nodoc:
3
3
  end
@@ -0,0 +1,22 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
3
+ require "random_data/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "random_data"
7
+ s.version = RandomData::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Mike Subelsky", "Tom Harris"]
10
+ s.email = "thomas.e.harris@gmail.com"
11
+ s.homepage = "http://github.com/tomharris/random_data"
12
+ s.summary = "A Ruby gem that provides a Random class with a series of methods for generating random test data including names, mailing addresses, dates, phone numbers, e-mail addresses, and text."
13
+ s.description = "Random data generator"
14
+
15
+ s.rubygems_version = "1.3.7"
16
+
17
+ s.files = `git ls-files`.split("\n")
18
+ s.test_files = `git ls-files -- test/*`.split("\n")
19
+ s.extra_rdoc_files = [ "README.rdoc" ]
20
+ s.rdoc_options = ["--charset=UTF-8"]
21
+ s.require_path = "lib"
22
+ end
@@ -65,14 +65,27 @@ class TestRandomData < Test::Unit::TestCase
65
65
  assert_equal "Donald", Random.firstname
66
66
  end
67
67
 
68
+ def test_should_return_random_first_name
69
+ assert_equal "Donald", Random.first_name
70
+ end
71
+
72
+
68
73
  def test_should_return_random_firstnamemale
69
74
  assert_equal "Donald", Random.firstname_male
70
75
  end
71
76
 
77
+ def test_should_return_random_first_name_male
78
+ assert_equal "Donald", Random.first_name_male
79
+ end
80
+
72
81
  def test_should_return_random_firstnamefemale
73
82
  assert_equal "Charlotte", Random.firstname_female
74
83
  end
75
84
 
85
+ def test_should_return_random_first_name_female
86
+ assert_equal "Charlotte", Random.first_name_female
87
+ end
88
+
76
89
  def test_should_return_random_initial
77
90
  assert_equal "I", Random.initial
78
91
  end
@@ -81,6 +94,14 @@ class TestRandomData < Test::Unit::TestCase
81
94
  assert_equal "Clarke", Random.lastname
82
95
  end
83
96
 
97
+ def test_should_return_random_last_name
98
+ assert_equal "Clarke", Random.last_name
99
+ end
100
+
101
+ def test_should_return_random_full_name
102
+ assert_equal "Donald Jones", Random.full_name
103
+ end
104
+
84
105
  def test_should_return_random_alphanumeric
85
106
  assert_equal "8O3dNFmAUqYr2YEY", Random.alphanumeric
86
107
  end
@@ -145,7 +166,7 @@ class TestRandomData < Test::Unit::TestCase
145
166
  end
146
167
 
147
168
  def test_should_return_random_grammatical_construct
148
- assert_equal "Bob bites Rover",
169
+ assert_equal "Bob bites Rex",
149
170
  Random::grammatical_construct({:story => [:man, " bites ", :dog],
150
171
  :man => { :bob => "Bob"},
151
172
  :dog => {:a =>"Rex", :b =>"Rover"}},
metadata CHANGED
@@ -1,29 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: random_data
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ hash: 7
5
+ prerelease: false
6
+ segments:
7
+ - 1
8
+ - 5
9
+ - 2
10
+ version: 1.5.2
5
11
  platform: ruby
6
12
  authors:
7
13
  - Mike Subelsky
14
+ - Tom Harris
8
15
  autorequire:
9
16
  bindir: bin
10
17
  cert_chain: []
11
18
 
12
- date: 2010-01-18 00:00:00 -05:00
19
+ date: 2010-11-16 00:00:00 -05:00
13
20
  default_executable:
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: mocha
17
- type: :development
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: "0"
24
- version:
25
- description: Provides a Random class with a series of methods for generating random test data including names, mailing addresses, dates, phone numbers, e-mail addresses, and text.
26
- email: mike@subelsky.com
21
+ dependencies: []
22
+
23
+ description: Random data generator
24
+ email: thomas.e.harris@gmail.com
27
25
  executables: []
28
26
 
29
27
  extensions: []
@@ -33,10 +31,9 @@ extra_rdoc_files:
33
31
  files:
34
32
  - History.txt
35
33
  - License.txt
36
- - Manifest.txt
34
+ - PostInstall.txt
37
35
  - README.rdoc
38
36
  - Rakefile
39
- - VERSION
40
37
  - config/website.yml
41
38
  - lib/random_data.rb
42
39
  - lib/random_data/array_randomizer.rb
@@ -50,6 +47,7 @@ files:
50
47
  - lib/random_data/numbers.rb
51
48
  - lib/random_data/text.rb
52
49
  - lib/random_data/version.rb
50
+ - random_data.gemspec
53
51
  - script/console
54
52
  - script/destroy
55
53
  - script/generate
@@ -58,7 +56,7 @@ files:
58
56
  - test/test_helper.rb
59
57
  - test/test_random_data.rb
60
58
  has_rdoc: true
61
- homepage: http://github.com/otherinbox/random_data
59
+ homepage: http://github.com/tomharris/random_data
62
60
  licenses: []
63
61
 
64
62
  post_install_message:
@@ -67,23 +65,31 @@ rdoc_options:
67
65
  require_paths:
68
66
  - lib
69
67
  required_ruby_version: !ruby/object:Gem::Requirement
68
+ none: false
70
69
  requirements:
71
70
  - - ">="
72
71
  - !ruby/object:Gem::Version
72
+ hash: 3
73
+ segments:
74
+ - 0
73
75
  version: "0"
74
- version:
75
76
  required_rubygems_version: !ruby/object:Gem::Requirement
77
+ none: false
76
78
  requirements:
77
79
  - - ">="
78
80
  - !ruby/object:Gem::Version
81
+ hash: 3
82
+ segments:
83
+ - 0
79
84
  version: "0"
80
- version:
81
85
  requirements: []
82
86
 
83
87
  rubyforge_project:
84
- rubygems_version: 1.3.5
88
+ rubygems_version: 1.3.7
85
89
  signing_key:
86
90
  specification_version: 3
87
- summary: Provides a Random class with a series of methods for generating random test data including names, mailing addresses, dates, phone numbers, e-mail addresses, and text.
91
+ summary: A Ruby gem that provides a Random class with a series of methods for generating random test data including names, mailing addresses, dates, phone numbers, e-mail addresses, and text.
88
92
  test_files:
93
+ - test/henry_v_prolog.txt
94
+ - test/test_helper.rb
89
95
  - test/test_random_data.rb
data/Manifest.txt DELETED
@@ -1,26 +0,0 @@
1
- History.txt
2
- License.txt
3
- Manifest.txt
4
- PostInstall.txt
5
- README.rdoc
6
- Rakefile
7
- config/website.yml
8
- lib/random_data.rb
9
- lib/random_data/array_randomizer.rb
10
- lib/random_data/booleans.rb
11
- lib/random_data/contact_info.rb
12
- lib/random_data/dates.rb
13
- lib/random_data/grammar.rb
14
- lib/random_data/locations.rb
15
- lib/random_data/markov.rb
16
- lib/random_data/names.rb
17
- lib/random_data/numbers.rb
18
- lib/random_data/text.rb
19
- lib/random_data/version.rb
20
- script/console
21
- script/destroy
22
- script/generate
23
- script/txt2html
24
- test/henry_v_prolog.txt
25
- test/test_helper.rb
26
- test/test_random_data.rb
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 1.5.1