namae 0.8.4 → 0.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 24ebdab9dcba1587795fd5a50f17f76024e7260e
4
- data.tar.gz: e9782ac717a00aa60aa4d752413fa1aecfbd9c49
3
+ metadata.gz: 091478a71aa1c686227337ed7578442a2ae1c47c
4
+ data.tar.gz: e57f8cbee8a2916b1efafa0df6916ef10611dcf2
5
5
  SHA512:
6
- metadata.gz: 10711cdb7d8a966ef4ee07d048ff8243947942ca8b7c9e7d763ab6d6a8fcd5580f25b89b3ec0275d2387a36664d13028779afd83630c571d91bf35f54338a3cf
7
- data.tar.gz: e9723eaf26f61219868c8f28ea155d8f036fb68fb017cf0d454e69af82dba96a99d3886365f6b342f67133263415451bafcdd555051514e43353b0f8fb860592
6
+ metadata.gz: 2421ff5c6070b9b4dca07018891eda40ef8df80eb0689753cdbbecca0cf1fc2212d785ef8221df7b350ff488fc0613076596f055f960fceda4d52da03f29aae9
7
+ data.tar.gz: 7463f48ce4c356cd93a19cbcc744b6724b799ecd35442282ef770fc44601928e9e3c61118ecf5624fcf172261e2ece723a3eeae9398123ca76d7540f7f94b4c0
data/.travis.yml CHANGED
@@ -2,11 +2,12 @@ language: ruby
2
2
  bundler_args: --without debug osx optional
3
3
  script: bundle exec rake test_with_coveralls
4
4
  rvm:
5
+ - ruby-head
5
6
  - 2.1.0
6
7
  - 2.0.0
7
8
  - 1.9.3
8
9
  - jruby
9
- - rbx
10
+ - rbx-2
10
11
  notifications:
11
12
  email: false
12
13
  matrix:
data/lib/namae/name.rb CHANGED
@@ -7,12 +7,12 @@ module Namae
7
7
 
8
8
  # @return [String] the name in sort order
9
9
  def sort_order(delimiter = ', ')
10
- [family_part, given_part].reject(&:empty?).join(delimiter)
10
+ [family_part, suffix, given_part].compact.reject(&:empty?).join(delimiter)
11
11
  end
12
12
 
13
13
  # @return [String] the name in display order
14
14
  def display_order
15
- [given_part, family_part].reject(&:empty?).join(' ')
15
+ [given_part, family_part, suffix].compact.reject(&:empty?).join(' ')
16
16
  end
17
17
 
18
18
  # @param options [Hash] the options to create the initials
data/lib/namae/version.rb CHANGED
@@ -2,7 +2,7 @@ module Namae
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 8
5
- PATCH = 4
5
+ PATCH = 5
6
6
  BUILD = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.').freeze
data/namae.gemspec CHANGED
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: namae 0.8.4 ruby lib
5
+ # stub: namae 0.8.5 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "namae"
9
- s.version = "0.8.4"
9
+ s.version = "0.8.5"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Sylvester Keil", "Dan Collis-Puro"]
14
- s.date = "2014-03-17"
14
+ s.date = "2014-05-12"
15
15
  s.description = " Namae (\u{540d}\u{524d}) is a parser for human names. It recognizes personal names of various cultural backgrounds and tries to split them into their component parts (e.g., given and family names, honorifics etc.). "
16
16
  s.email = ["sylvester@keil.or.at", "dan@collispuro.com"]
17
17
  s.extra_rdoc_files = [
@@ -88,6 +88,11 @@ module Namae
88
88
  it 'returns only the family if there is no given name' do
89
89
  Name.new(:family => 'Suzuki').sort_order.should == 'Suzuki'
90
90
  end
91
+
92
+ it 'includes the suffix' do
93
+ Name.new(:family => 'Griffey', :suffix => 'Jr.').sort_order.should == 'Griffey, Jr.'
94
+ Name.new(:family => 'Griffey', :given => 'Ken', :suffix => 'Jr.').sort_order.should == 'Griffey, Jr., Ken'
95
+ end
91
96
  end
92
97
 
93
98
  describe '#display_order' do
@@ -106,7 +111,12 @@ module Namae
106
111
  it 'returns only the family if there is no given name' do
107
112
  Name.new(:family => 'Suzuki').display_order.should == 'Suzuki'
108
113
  end
114
+
115
+ it 'includes the suffix' do
116
+ Name.new(:family => 'Griffey', :suffix => 'Jr.').display_order.should == 'Griffey Jr.'
117
+ Name.new(:family => 'Griffey', :given => 'Ken', :suffix => 'Jr.').display_order.should == 'Ken Griffey Jr.'
118
+ end
109
119
  end
110
120
 
111
121
  end
112
- end
122
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: namae
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.4
4
+ version: 0.8.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvester Keil
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-03-17 00:00:00.000000000 Z
12
+ date: 2014-05-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: simplecov