gender-inference 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
@@ -0,0 +1,30 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ gender-inference (0.0.1)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ diff-lcs (1.2.3)
10
+ multi_json (1.7.2)
11
+ rspec (2.13.0)
12
+ rspec-core (~> 2.13.0)
13
+ rspec-expectations (~> 2.13.0)
14
+ rspec-mocks (~> 2.13.0)
15
+ rspec-core (2.13.1)
16
+ rspec-expectations (2.13.0)
17
+ diff-lcs (>= 1.1.3, < 2.0)
18
+ rspec-mocks (2.13.1)
19
+ simplecov (0.7.1)
20
+ multi_json (~> 1.0)
21
+ simplecov-html (~> 0.7.1)
22
+ simplecov-html (0.7.1)
23
+
24
+ PLATFORMS
25
+ ruby
26
+
27
+ DEPENDENCIES
28
+ gender-inference!
29
+ rspec
30
+ simplecov
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 On The Beach Ltd
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,18 @@
1
+ # gender-inference
2
+
3
+ ## Infer a person's gender from their name
4
+
5
+ Have you been collecting your customers' names, but not their genders?
6
+ You're missing out in millionnnnnns of targeted ad revenue! But don't
7
+ despair; with `gender-inference` you can infer the gender of your customers
8
+ based on their names - getting you that targeted ad hit in > 90% of cases.
9
+
10
+ The API is dead simple. Add this to your gemfile:
11
+
12
+ gem 'gender-inference'
13
+
14
+ And simply call the infer method like this:
15
+
16
+ GenderInference.infer("Russell Dunphy")
17
+
18
+ Happy inferencing!
@@ -0,0 +1,17 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = 'gender-inference'
3
+ s.version = '0.0.1'
4
+ s.date = '2013-04-19'
5
+ s.summary = "Infer a person's gender from their name"
6
+ s.description = "Make your marketing super good and targeted"
7
+ s.authors = ["Russell Dunphy"]
8
+ s.email = ['russell@russelldunphy.com']
9
+ s.files = `git ls-files`.split($\)
10
+ s.test_files = s.files.grep(%r{^(test|spec|features)/})
11
+ s.require_paths = ["lib"]
12
+ s.homepage = 'http://github.com/rsslldnphy/gender-inference'
13
+
14
+ s.add_development_dependency "rspec"
15
+ s.add_development_dependency "simplecov"
16
+
17
+ end
@@ -0,0 +1,8 @@
1
+ module GenderInference
2
+ extend self
3
+
4
+ def infer(name)
5
+ "None of your business. Also, FFS, why does it matter?"
6
+ end
7
+
8
+ end
@@ -0,0 +1,3 @@
1
+ require_relative 'gender'
2
+ require_relative 'male'
3
+ require_relative 'female'
@@ -0,0 +1,16 @@
1
+ class Female
2
+ include Gender
3
+
4
+ def theta
5
+ 0
6
+ end
7
+
8
+ def gamma
9
+ 0
10
+ end
11
+
12
+ def delta
13
+ 7
14
+ end
15
+ end
16
+
@@ -0,0 +1,9 @@
1
+ module Gender
2
+ def quotient
3
+ theta * gamma / delta
4
+ end
5
+
6
+ def all
7
+ [Male, Female] # that is all
8
+ end
9
+ end
@@ -0,0 +1,15 @@
1
+ class Male
2
+ include Gender
3
+
4
+ def theta
5
+ 8.03323891
6
+ end
7
+
8
+ def gamma
9
+ 14
10
+ end
11
+
12
+ def delta
13
+ 0.0000000000000000000000001
14
+ end
15
+ end
@@ -0,0 +1,12 @@
1
+ require 'gender_inference'
2
+ require 'rspec'
3
+
4
+ describe GenderInference do
5
+ it 'infers male gender' do
6
+ GenderInference.infer("Bob").should eq "male"
7
+ end
8
+
9
+ it 'infers female gender' do
10
+ GenderInference.infer("Jo").should eq "female"
11
+ end
12
+ end
metadata ADDED
@@ -0,0 +1,91 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gender-inference
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Russell Dunphy
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-04-19 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rspec
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: simplecov
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ description: Make your marketing super good and targeted
47
+ email:
48
+ - russell@russelldunphy.com
49
+ executables: []
50
+ extensions: []
51
+ extra_rdoc_files: []
52
+ files:
53
+ - Gemfile
54
+ - Gemfile.lock
55
+ - LICENSE.md
56
+ - README.md
57
+ - gender-inference-0.0.1.gem
58
+ - gender-inference.gemspec
59
+ - lib/gender_inference.rb
60
+ - lib/gender_inference/all.rb
61
+ - lib/gender_inference/female.rb
62
+ - lib/gender_inference/gender.rb
63
+ - lib/gender_inference/male.rb
64
+ - spec/lib/gender_inference_spec.rb
65
+ homepage: http://github.com/rsslldnphy/gender-inference
66
+ licenses: []
67
+ post_install_message:
68
+ rdoc_options: []
69
+ require_paths:
70
+ - lib
71
+ required_ruby_version: !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ required_rubygems_version: !ruby/object:Gem::Requirement
78
+ none: false
79
+ requirements:
80
+ - - ! '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ requirements: []
84
+ rubyforge_project:
85
+ rubygems_version: 1.8.25
86
+ signing_key:
87
+ specification_version: 3
88
+ summary: Infer a person's gender from their name
89
+ test_files:
90
+ - spec/lib/gender_inference_spec.rb
91
+ has_rdoc: