# HG changeset patch # User HackBot # Date 1385154897 0 # Node ID d6402189a29b40361dfc07ff6a04b8d39a7f3dd4 # Parent d3ca31a6703657284af265bd4c2398e0d696c58d mv raw.php* bin/ello diff -r d3ca31a67036 -r d6402189a29b bin/ello --- a/bin/ello Fri Nov 22 21:14:41 2013 +0000 +++ b/bin/ello Fri Nov 22 21:14:57 2013 +0000 @@ -1,6 +1,7 @@ #!/usr/bin/env node +// Generated by CoffeeScript 1.6.2 (function() { - var consonant_then_o, ends_with_consonant, ends_with_e, name, starts_with_o; + var consonant_then_o, ell_manglable, ends_with_consonant, ends_with_consonant_then_vowel, name, starts_with_o; name = process.argv[2]; @@ -9,17 +10,21 @@ process.exit(); } - ends_with_e = /(.*)(e)$/i; - consonant_then_o = /(.*)([bcdfghjklmnpqrstvwxz])([o0].*)/i; ends_with_consonant = /[bcdfghjklmnpqrstvwxz]$/i; + ends_with_consonant_then_vowel = /(.*[bcdfghjklmnpqrstvwxz])[aeiouy]+$/i; + starts_with_o = /[o0]/i; + ell_manglable = /(.*)(el+[aeiouy]+)(.*)/i; + console.log(consonant_then_o.test(name) ? name.replace(consonant_then_o, function(match, before, consonant, rest) { return before + consonant + 'ell' + rest; - }) : starts_with_o.test(name) ? 'hell' + name : ends_with_e.test(name) ? name.replace(ends_with_e, function(match, before) { + }) : ell_manglable.test(name) ? name.replace(ell_manglable, function(match, before, middle, rest) { + return before + 'ello' + rest; + }) : starts_with_o.test(name) ? 'hell' + name : ends_with_consonant_then_vowel.test(name) ? name.replace(ends_with_consonant_then_vowel, function(match, before) { return before + 'ello'; }) : ends_with_consonant.test(name) ? name + 'ello' : "Hello, " + name + "!"); diff -r d3ca31a67036 -r d6402189a29b raw.php?i=t6pkHTik --- a/raw.php?i=t6pkHTik Fri Nov 22 21:14:41 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -#!/usr/bin/env node -// Generated by CoffeeScript 1.6.2 -(function() { - var consonant_then_o, ell_manglable, ends_with_consonant, ends_with_consonant_then_vowel, name, starts_with_o; - - name = process.argv[2]; - - if (!(name != null ? name.length : void 0)) { - console.log('Usage: ello '); - process.exit(); - } - - consonant_then_o = /(.*)([bcdfghjklmnpqrstvwxz])([o0].*)/i; - - ends_with_consonant = /[bcdfghjklmnpqrstvwxz]$/i; - - ends_with_consonant_then_vowel = /(.*[bcdfghjklmnpqrstvwxz])[aeiouy]+$/i; - - starts_with_o = /[o0]/i; - - ell_manglable = /(.*)(el+[aeiouy]+)(.*)/i; - - console.log(consonant_then_o.test(name) ? name.replace(consonant_then_o, function(match, before, consonant, rest) { - return before + consonant + 'ell' + rest; - }) : ell_manglable.test(name) ? name.replace(ell_manglable, function(match, before, middle, rest) { - return before + 'ello' + rest; - }) : starts_with_o.test(name) ? 'hell' + name : ends_with_consonant_then_vowel.test(name) ? name.replace(ends_with_consonant_then_vowel, function(match, before) { - return before + 'ello'; - }) : ends_with_consonant.test(name) ? name + 'ello' : "Hello, " + name + "!"); - -}).call(this); \ No newline at end of file