nameable 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ source :rubygems
2
+
3
+ group :development do
4
+ gem "bundler"
5
+ gem "jeweler"
6
+ end
7
+
8
+ group :test do
9
+ gem "rspec"
10
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,30 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ diff-lcs (1.1.3)
5
+ git (1.2.5)
6
+ jeweler (1.8.4)
7
+ bundler (~> 1.0)
8
+ git (>= 1.2.5)
9
+ rake
10
+ rdoc
11
+ json (1.7.4)
12
+ rake (0.9.2.2)
13
+ rdoc (3.12)
14
+ json (~> 1.4)
15
+ rspec (2.11.0)
16
+ rspec-core (~> 2.11.0)
17
+ rspec-expectations (~> 2.11.0)
18
+ rspec-mocks (~> 2.11.0)
19
+ rspec-core (2.11.1)
20
+ rspec-expectations (2.11.2)
21
+ diff-lcs (~> 1.1.3)
22
+ rspec-mocks (2.11.1)
23
+
24
+ PLATFORMS
25
+ ruby
26
+
27
+ DEPENDENCIES
28
+ bundler
29
+ jeweler
30
+ rspec
data/History.txt ADDED
@@ -0,0 +1,11 @@
1
+ 0.4.2:
2
+ Allow for multiple commas/spaces for the last name, first name format.
3
+
4
+ 0.4.1:
5
+ A period after Jr. or Sr. as a generational title is no longer necessary.
6
+
7
+ 0.4.0:
8
+
9
+ Fixed a bug for these patterns:
10
+ HORN, CHRIS K
11
+ HORN, CHRIS K.
data/LICENSE CHANGED
File without changes
data/README.rdoc CHANGED
File without changes
data/Rakefile CHANGED
@@ -1,57 +1,39 @@
1
- require 'rubygems'
2
- require 'rake/gempackagetask'
3
- require 'rubygems/specification'
4
- require 'date'
5
- require 'spec/rake/spectask'
6
-
7
- GEM = "nameable"
8
- GEM_VERSION = "0.5.0"
9
- AUTHOR = "Chris Horn"
10
- EMAIL = "chorn@chorn.com"
11
- HOMEPAGE = "http://github.com/chorn/nameable"
12
- SUMMARY = "A ruby library to parse people names into parts and reformat them."
13
-
14
- spec = Gem::Specification.new do |s|
15
- s.name = GEM
16
- s.version = GEM_VERSION
17
- s.platform = Gem::Platform::RUBY
18
- s.has_rdoc = true
19
- s.extra_rdoc_files = ["README", "LICENSE", 'TODO']
20
- s.summary = SUMMARY
21
- s.description = s.summary
22
- s.author = AUTHOR
23
- s.email = EMAIL
24
- s.homepage = HOMEPAGE
1
+ # encoding: utf-8
25
2
 
26
- # Uncomment this to add a dependency
27
- # s.add_dependency "foo"
28
-
29
- s.require_path = 'lib'
30
- s.autorequire = GEM
31
- s.files = %w(LICENSE README Rakefile TODO) + Dir.glob("{lib,spec}/**/*")
3
+ require 'rubygems'
4
+ require 'bundler'
5
+ begin
6
+ Bundler.setup(:default, :development)
7
+ rescue Bundler::BundlerError => e
8
+ $stderr.puts e.message
9
+ $stderr.puts "Run `bundle install` to install missing gems"
10
+ exit e.status_code
32
11
  end
33
-
34
- task :default => :spec
35
-
36
- desc "Run specs"
37
- Spec::Rake::SpecTask.new do |t|
38
- t.spec_files = FileList['spec/**/*_spec.rb']
39
- t.spec_opts = %w(-fs --color)
12
+ require 'rake'
13
+
14
+ require 'jeweler'
15
+ Jeweler::Tasks.new do |gem|
16
+ gem.name = "nameable"
17
+ gem.homepage = "https://github.com/chorn/nameable"
18
+ gem.license = "MIT"
19
+ gem.summary = %Q{Provides parsing and output of person names.}
20
+ gem.description = %Q{A gem that provides parsing and output of person names.}
21
+ gem.email = "chorn@chorn.com"
22
+ gem.authors = ["Chris Horn"]
23
+ gem.files = FileList['lib/**/*.rb', 'Gemfile*', '[A-Z]*', 'Rakefile', 'spec/*', 'examples/*'].to_a
40
24
  end
25
+ Jeweler::RubygemsDotOrgTasks.new
41
26
 
42
-
43
- Rake::GemPackageTask.new(spec) do |pkg|
44
- pkg.gem_spec = spec
27
+ require 'rspec/core'
28
+ require 'rspec/core/rake_task'
29
+ RSpec::Core::RakeTask.new(:spec) do |spec|
30
+ spec.pattern = FileList['spec/**/*_spec.rb']
45
31
  end
46
32
 
47
- desc "install the gem locally"
48
- task :install => [:package] do
49
- sh %{sudo gem install pkg/#{GEM}-#{GEM_VERSION}}
33
+ RSpec::Core::RakeTask.new(:rcov) do |spec|
34
+ spec.pattern = 'spec/**/*_spec.rb'
35
+ spec.rcov = true
50
36
  end
51
37
 
52
- desc "create a gemspec file"
53
- task :make_spec do
54
- File.open("#{GEM}.gemspec", "w") do |file|
55
- file.puts spec.to_ruby
56
- end
57
- end
38
+ task :default => :spec
39
+
data/TODO CHANGED
File without changes
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.5.1
data/lib/nameable.rb CHANGED
@@ -32,10 +32,10 @@ module Nameable
32
32
  "Ph.D." => /^\(*(phd\.?)\)*$/i
33
33
  }
34
34
 
35
- SUFFIX_GENERATIONAL_ROMAN = /^\(*[IVX\.]+\)*$/i
35
+ SUFFIX_GENERATIONAL_ROMAN = /^\(*[IVX.]+\)*$/i
36
36
  SUFFIX_ACADEMIC = /^(APR|RPh|MD|MA|DMD|DDS|PharmD|EngD|DPhil|JD|DD|DO|BA|BS|BSc|BE|BFA|MA|MS|MSc|MFA|MLA|MBA)$/i
37
37
  SUFFIX_PROFESSIONAL = /^(PE|CSA|CPA|CPL|CME|CEng|OFM|CSV|Douchebag)$/i
38
- SUFFIX_ABBREVIATION = /^[A-Z\.]+[A-Z\.]+$/ # It should be at least 2 letters
38
+ SUFFIX_ABBREVIATION = /^[A-Z.]+[A-Z.]+$/ # It should be at least 2 letters
39
39
 
40
40
  LAST_NAME_PRE_DANGLERS = /^(mc|vere|von|van|da|de|del|della|di|da|pietro|vanden|du|st|la|ter|ten)$/i
41
41
  O_LAST_NAME_PRE_CONCATS = /^(o'|o`)$/i
@@ -3,19 +3,19 @@ require File.dirname(__FILE__) + '/spec_helper'
3
3
  describe Nameable::Latin do
4
4
  describe "with 'Mr. Chris Horn PhD" do
5
5
  subject { Nameable::Latin.new.parse("Mr. Chris Horn PhD") }
6
-
6
+
7
7
  it("should extract prefix") { subject.prefix.should == "Mr." }
8
8
  it("should extract first name") { subject.first.should == "Chris" }
9
9
  it("should extract last name") { subject.last.should == "Horn" }
10
10
  it("should extract and normalize suffix") { subject.suffix.should == "Ph.D." }
11
11
  end
12
-
12
+
13
13
  describe "with 'Chris Old Biscuit Barrel Horn'" do
14
14
  subject { Nameable::Latin.new.parse("Chris Old Biscuit Barrel Horn") }
15
-
15
+
16
16
  it("should extract first name") { subject.first.should == "Chris" }
17
17
  it("should extract middle name") { subject.middle.should == "Old Biscuit Barrel" }
18
18
  it("should extract last name") { subject.last.should == "Horn" }
19
19
  end
20
-
20
+
21
21
  end
data/spec/spec.opts ADDED
@@ -0,0 +1,5 @@
1
+ --colour
2
+ --format nested
3
+ --loadby mtime
4
+ --reverse
5
+ --backtrace
data/spec/spec_helper.rb CHANGED
@@ -2,7 +2,6 @@ $LOAD_PATH.push File.join(File.dirname(__FILE__), '..', 'lib')
2
2
 
3
3
  require "rubygems"
4
4
  require "spec"
5
- require "active_support"
6
5
  require "nameable"
7
6
 
8
7
  Spec::Runner.configure do |config|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nameable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,28 +9,66 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-06 00:00:00.000000000 Z
13
- dependencies: []
12
+ date: 2012-08-10 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: bundler
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: jeweler
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'
14
46
  description: A gem that provides parsing and output of person names.
15
47
  email: chorn@chorn.com
16
48
  executables: []
17
49
  extensions: []
18
- extra_rdoc_files: []
50
+ extra_rdoc_files:
51
+ - LICENSE
52
+ - README.rdoc
53
+ - TODO
19
54
  files:
55
+ - Gemfile
56
+ - Gemfile.lock
57
+ - History.txt
20
58
  - LICENSE
21
59
  - README.rdoc
22
60
  - Rakefile
23
61
  - TODO
24
- - nameable.gemspec
62
+ - VERSION
63
+ - examples/nameable_web_service.rb
64
+ - examples/test.rb
25
65
  - lib/nameable.rb
26
- - script/destroy
27
- - script/generate
28
66
  - spec/nameable_spec.rb
67
+ - spec/spec.opts
29
68
  - spec/spec_helper.rb
30
- - examples/test.rb
31
- - examples/nameable_web_service.rb
32
- homepage: http://github.com/chorn/nameable
33
- licenses: []
69
+ homepage: https://github.com/chorn/nameable
70
+ licenses:
71
+ - MIT
34
72
  post_install_message:
35
73
  rdoc_options: []
36
74
  require_paths:
@@ -41,6 +79,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
41
79
  - - ! '>='
42
80
  - !ruby/object:Gem::Version
43
81
  version: '0'
82
+ segments:
83
+ - 0
84
+ hash: -172521366074820921
44
85
  required_rubygems_version: !ruby/object:Gem::Requirement
45
86
  none: false
46
87
  requirements:
@@ -54,4 +95,3 @@ signing_key:
54
95
  specification_version: 3
55
96
  summary: Provides parsing and output of person names.
56
97
  test_files: []
57
- has_rdoc: true
data/nameable.gemspec DELETED
@@ -1,26 +0,0 @@
1
- Gem::Specification.new do |s|
2
- s.name = "nameable"
3
- s.version = "0.5.0"
4
- s.date = "2012-06-06"
5
- s.summary = "Provides parsing and output of person names."
6
- s.email = "chorn@chorn.com"
7
- s.homepage = "http://github.com/chorn/nameable"
8
- s.description = "A gem that provides parsing and output of person names."
9
- s.has_rdoc = true
10
- s.authors = ["Chris Horn"]
11
- s.files = [ "LICENSE",
12
- "README.rdoc",
13
- "Rakefile",
14
- "TODO",
15
- "nameable.gemspec",
16
- "lib/nameable.rb",
17
- "script/destroy",
18
- "script/generate",
19
- "spec/nameable_spec.rb",
20
- "spec/spec_helper.rb",
21
- "examples/test.rb",
22
- "examples/nameable_web_service.rb"
23
- ]
24
- s.test_files = []
25
- s.rdoc_options = []
26
- end
data/script/destroy DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
3
-
4
- begin
5
- require 'rubigen'
6
- rescue LoadError
7
- require 'rubygems'
8
- require 'rubigen'
9
- end
10
- require 'rubigen/scripts/destroy'
11
-
12
- ARGV.shift if ['--help', '-h'].include?(ARGV[0])
13
- RubiGen::Base.use_component_sources! [:newgem_simple, :test_unit]
14
- RubiGen::Scripts::Destroy.new.run(ARGV)
data/script/generate DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
3
-
4
- begin
5
- require 'rubigen'
6
- rescue LoadError
7
- require 'rubygems'
8
- require 'rubigen'
9
- end
10
- require 'rubigen/scripts/generate'
11
-
12
- ARGV.shift if ['--help', '-h'].include?(ARGV[0])
13
- RubiGen::Base.use_component_sources! [:newgem_simple, :test_unit]
14
- RubiGen::Scripts::Generate.new.run(ARGV)