Sha256: b77682ae0fe04305a5025d5d77264f22a04cea13a4b7b7bcb814e54f9be67457
Contents?: true
Size: 520 Bytes
Versions: 6
Compression:
Stored size: 520 Bytes
Contents
#!/usr/bin/env ruby # I use this with OpenRefine: http://openrefine.org/ require 'rubygems' require 'json' require 'sinatra' require 'nameable' get '/*/*.*' do |raw_name, function, type| begin name = Nameable(raw_name) rescue Nameable::Latin::InvalidNameError '' end if type.to_sym == :json content_type 'application/json' name.to_hash.to_json else content_type 'text/plain' name.send("to_#{function}") if function =~ /^(fullname|nameable|firstname|lastname|middlename)$/ end end
Version data entries
6 entries across 6 versions & 2 rubygems