faker-medical 0.1.3 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
data/CHANGELOG ADDED
@@ -0,0 +1,8 @@
1
+ # 8/14/2011
2
+ * Fixed issue with working with 0.9.5
3
+ * Fixed Random Birth Date
4
+ * UP Version
5
+
6
+ # TODO
7
+ * Refactor to more standardized gem
8
+ * Add Documentation
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source :rubygems
2
+
3
+ gem 'jeweler'
4
+ gem 'faker'
5
+
6
+ gem 'rspec'
data/Gemfile.lock ADDED
@@ -0,0 +1,29 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ diff-lcs (1.1.2)
5
+ faker (0.9.5)
6
+ i18n (~> 0.4)
7
+ git (1.2.5)
8
+ i18n (0.6.0)
9
+ jeweler (1.6.4)
10
+ bundler (~> 1.0)
11
+ git (>= 1.2.5)
12
+ rake
13
+ rake (0.9.2)
14
+ rspec (2.6.0)
15
+ rspec-core (~> 2.6.0)
16
+ rspec-expectations (~> 2.6.0)
17
+ rspec-mocks (~> 2.6.0)
18
+ rspec-core (2.6.4)
19
+ rspec-expectations (2.6.0)
20
+ diff-lcs (~> 1.1.2)
21
+ rspec-mocks (2.6.0)
22
+
23
+ PLATFORMS
24
+ ruby
25
+
26
+ DEPENDENCIES
27
+ faker
28
+ jeweler
29
+ rspec
@@ -1,67 +1,68 @@
1
1
  # Generated by jeweler
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{faker-medical}
8
- s.version = "0.1.3"
8
+ s.version = "0.4.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Tom & Russell"]
12
- s.date = %q{2010-04-12}
12
+ s.date = %q{2011-08-14}
13
13
  s.description = %q{This gem is an extension of the Faker Gem to generate SSN, DEA, and NPI Numbers}
14
14
  s.email = %q{thing2@jackhq.com}
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE",
17
- "README.rdoc"
17
+ "README.rdoc"
18
18
  ]
19
19
  s.files = [
20
20
  ".document",
21
- ".gitignore",
22
- "LICENSE",
23
- "README.rdoc",
24
- "Rakefile",
25
- "faker-medical.gemspec",
26
- "lib/faker_dea.rb",
27
- "lib/faker_npi.rb",
28
- "lib/faker_patient.rb",
29
- "lib/faker_ssn.rb",
30
- "spec/lib/faker_dea_spec.rb",
31
- "spec/lib/faker_npi_spec.rb",
32
- "spec/lib/faker_patient_spec.rb",
33
- "spec/lib/faker_ssn_spec.rb",
34
- "spec/spec.opts",
35
- "spec/spec_helper.rb",
36
- "test/helper.rb",
37
- "test/test_faker-medical.rb",
38
- "version.yml"
21
+ ".rspec",
22
+ "CHANGELOG",
23
+ "Gemfile",
24
+ "Gemfile.lock",
25
+ "LICENSE",
26
+ "README.rdoc",
27
+ "Rakefile",
28
+ "faker-medical.gemspec",
29
+ "lib/faker_dea.rb",
30
+ "lib/faker_npi.rb",
31
+ "lib/faker_patient.rb",
32
+ "lib/faker_ssn.rb",
33
+ "spec/lib/faker_dea_spec.rb",
34
+ "spec/lib/faker_npi_spec.rb",
35
+ "spec/lib/faker_patient_spec.rb",
36
+ "spec/lib/faker_ssn_spec.rb",
37
+ "spec/spec.opts",
38
+ "spec/spec_helper.rb",
39
+ "test/helper.rb",
40
+ "test/test_faker-medical.rb",
41
+ "version.yml"
39
42
  ]
40
43
  s.homepage = %q{http://github.com/jackhq/faker-medical}
41
- s.rdoc_options = ["--charset=UTF-8"]
42
44
  s.require_paths = ["lib"]
43
- s.rubygems_version = %q{1.3.5}
45
+ s.rubygems_version = %q{1.6.2}
44
46
  s.summary = %q{Faker Extension for Medical Numbers}
45
- s.test_files = [
46
- "spec/lib/faker_dea_spec.rb",
47
- "spec/lib/faker_npi_spec.rb",
48
- "spec/lib/faker_patient_spec.rb",
49
- "spec/lib/faker_ssn_spec.rb",
50
- "spec/spec_helper.rb",
51
- "test/helper.rb",
52
- "test/test_faker-medical.rb"
53
- ]
54
47
 
55
48
  if s.respond_to? :specification_version then
56
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
57
49
  s.specification_version = 3
58
50
 
59
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
51
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
52
+ s.add_runtime_dependency(%q<jeweler>, [">= 0"])
53
+ s.add_runtime_dependency(%q<faker>, [">= 0"])
54
+ s.add_runtime_dependency(%q<rspec>, [">= 0"])
60
55
  s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
61
56
  else
57
+ s.add_dependency(%q<jeweler>, [">= 0"])
58
+ s.add_dependency(%q<faker>, [">= 0"])
59
+ s.add_dependency(%q<rspec>, [">= 0"])
62
60
  s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
63
61
  end
64
62
  else
63
+ s.add_dependency(%q<jeweler>, [">= 0"])
64
+ s.add_dependency(%q<faker>, [">= 0"])
65
+ s.add_dependency(%q<rspec>, [">= 0"])
65
66
  s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
66
67
  end
67
68
  end
data/lib/faker_dea.rb CHANGED
@@ -3,7 +3,7 @@ module Faker
3
3
  class << self
4
4
  def dea(type="A",last_name="Smith")
5
5
  prefix = type + last_name.split("")[0]
6
- suffix = Faker.numerify('######')
6
+ suffix = Faker::Base.numerify('######')
7
7
  prefix + suffix + check_digit(suffix)
8
8
 
9
9
  end
data/lib/faker_patient.rb CHANGED
@@ -1,3 +1,23 @@
1
+ # mixin random time function from http://jroller.com/obie/entry/random_times_for_rails
2
+ class Time
3
+
4
+ def self.random(params={})
5
+ years_back = params[:year_range] || 5
6
+ year = (rand * (years_back)).ceil + (Time.now.year - years_back)
7
+ month = (rand * 12).ceil
8
+ day = (rand * 31).ceil
9
+ series = [date = Time.local(year, month, day)]
10
+ if params[:series]
11
+ params[:series].each do |some_time_after|
12
+ series << series.last + (rand * some_time_after).ceil
13
+ end
14
+ return series
15
+ end
16
+ date
17
+ end
18
+
19
+ end
20
+
1
21
  module Faker
2
22
  class Patient
3
23
  class << self
@@ -8,11 +28,12 @@ module Faker
8
28
  end
9
29
 
10
30
  def dob
11
- Date.parse("#{rand(12) + 1}/#{rand(28) + 1}/19#{format("%02d", rand(99))}" )
31
+ Time.random(:year_range => 80)
32
+ #Date.parse("#{rand(12) + 1}/#{rand(27) + 1}/19#{format("%02d", rand(99))}" )
12
33
  end
13
34
 
14
35
  def phone_number
15
- Faker.numerify("###-###-####")
36
+ Faker::Base.numerify("###-###-####")
16
37
  end
17
38
 
18
39
 
data/lib/faker_ssn.rb CHANGED
@@ -3,7 +3,7 @@ module Faker
3
3
  class << self
4
4
  # English social security number has the format xxx-xx-xxxx
5
5
  def en_ssn
6
- Faker.numerify('###-##-####')
6
+ Faker::Base.numerify('###-##-####')
7
7
  end
8
8
  end
9
9
 
data/spec/spec_helper.rb CHANGED
@@ -1,4 +1,3 @@
1
- require 'spec'
2
1
  require 'faker'
3
2
  require 'faker_dea'
4
3
  require 'faker_ssn'
data/version.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :major: 0
3
- :minor: 1
3
+ :minor: 4
4
4
  :build:
5
- :patch: 3
5
+ :patch: 0
metadata CHANGED
@@ -1,39 +1,75 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: faker-medical
3
- version: !ruby/object:Gem::Version
4
- version: 0.1.3
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.4.0
5
+ prerelease:
5
6
  platform: ruby
6
- authors:
7
+ authors:
7
8
  - Tom & Russell
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
-
12
- date: 2010-04-12 00:00:00 -04:00
12
+ date: 2011-08-14 00:00:00.000000000 -04:00
13
13
  default_executable:
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: jeweler
17
+ requirement: &2156129060 !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: '0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: *2156129060
26
+ - !ruby/object:Gem::Dependency
27
+ name: faker
28
+ requirement: &2156127800 !ruby/object:Gem::Requirement
29
+ none: false
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: *2156127800
37
+ - !ruby/object:Gem::Dependency
38
+ name: rspec
39
+ requirement: &2156126960 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ! '>='
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
45
+ type: :runtime
46
+ prerelease: false
47
+ version_requirements: *2156126960
48
+ - !ruby/object:Gem::Dependency
16
49
  name: thoughtbot-shoulda
50
+ requirement: &2156108620 !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
17
56
  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: This gem is an extension of the Faker Gem to generate SSN, DEA, and NPI Numbers
57
+ prerelease: false
58
+ version_requirements: *2156108620
59
+ description: This gem is an extension of the Faker Gem to generate SSN, DEA, and NPI
60
+ Numbers
26
61
  email: thing2@jackhq.com
27
62
  executables: []
28
-
29
63
  extensions: []
30
-
31
- extra_rdoc_files:
64
+ extra_rdoc_files:
32
65
  - LICENSE
33
66
  - README.rdoc
34
- files:
67
+ files:
35
68
  - .document
36
- - .gitignore
69
+ - .rspec
70
+ - CHANGELOG
71
+ - Gemfile
72
+ - Gemfile.lock
37
73
  - LICENSE
38
74
  - README.rdoc
39
75
  - Rakefile
@@ -54,36 +90,26 @@ files:
54
90
  has_rdoc: true
55
91
  homepage: http://github.com/jackhq/faker-medical
56
92
  licenses: []
57
-
58
93
  post_install_message:
59
- rdoc_options:
60
- - --charset=UTF-8
61
- require_paths:
94
+ rdoc_options: []
95
+ require_paths:
62
96
  - lib
63
- required_ruby_version: !ruby/object:Gem::Requirement
64
- requirements:
65
- - - ">="
66
- - !ruby/object:Gem::Version
67
- version: "0"
68
- version:
69
- required_rubygems_version: !ruby/object:Gem::Requirement
70
- requirements:
71
- - - ">="
72
- - !ruby/object:Gem::Version
73
- version: "0"
74
- version:
97
+ required_ruby_version: !ruby/object:Gem::Requirement
98
+ none: false
99
+ requirements:
100
+ - - ! '>='
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ required_rubygems_version: !ruby/object:Gem::Requirement
104
+ none: false
105
+ requirements:
106
+ - - ! '>='
107
+ - !ruby/object:Gem::Version
108
+ version: '0'
75
109
  requirements: []
76
-
77
110
  rubyforge_project:
78
- rubygems_version: 1.3.5
111
+ rubygems_version: 1.6.2
79
112
  signing_key:
80
113
  specification_version: 3
81
114
  summary: Faker Extension for Medical Numbers
82
- test_files:
83
- - spec/lib/faker_dea_spec.rb
84
- - spec/lib/faker_npi_spec.rb
85
- - spec/lib/faker_patient_spec.rb
86
- - spec/lib/faker_ssn_spec.rb
87
- - spec/spec_helper.rb
88
- - test/helper.rb
89
- - test/test_faker-medical.rb
115
+ test_files: []
data/.gitignore DELETED
@@ -1,21 +0,0 @@
1
- ## MAC OS
2
- .DS_Store
3
-
4
- ## TEXTMATE
5
- *.tmproj
6
- tmtags
7
-
8
- ## EMACS
9
- *~
10
- \#*
11
- .\#*
12
-
13
- ## VIM
14
- *.swp
15
-
16
- ## PROJECT::GENERAL
17
- coverage
18
- rdoc
19
- pkg
20
-
21
- ## PROJECT::SPECIFIC