Skip to content

Parsing for names ending with roman numeral suffix. (e.g "Jon Rod II)

Notifications You must be signed in to change notification settings

mikeLspohn/ruby-name-numeral-suffix-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Problem?

So, in rails if you have a name, say name = Jon Rod II, and do name.titleize you get back "Jon Rod Ii". Whatttt?? Ok, so you can't really expect ActiveSupport to take care of everything for you. This script was made specifically to solve this one problem (but may be expanded on!).

Usage

  • git clone https://github.com/mikeLspohn/ruby-name-numeral-suffix-parser
require 'parse_name_numeral_suffix'

def SomeClass
  include ParseNameNumeralSuffix

  def full_name(name)
    # in my use case it comes through as name.titleize so "Jon Rod Ii"
    capitalize_name_with_numeral_suffix(name)
  end
end

Todo:

  • Shit, this is poorly named
  • Test for numerals NOT at end of string (e.g. "The numeral vi stands for something" probably already capitalized though)

Contributions:

Jon Gabriel Rodriguez II for lending his name

About

Parsing for names ending with roman numeral suffix. (e.g "Jon Rod II)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages