Skip to content

Instantly share code, notes, and snippets.

@trueheart78
Created April 18, 2023 16:20
Show Gist options
  • Save trueheart78/638cb5d083f38e4756b28774c9f69162 to your computer and use it in GitHub Desktop.
Save trueheart78/638cb5d083f38e4756b28774c9f69162 to your computer and use it in GitHub Desktop.

Revisions

  1. trueheart78 created this gist Apr 18, 2023.
    20 changes: 20 additions & 0 deletions wow-name.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    #!/usr/bin/env ruby

    require "colorize"

    def wow_name(string)
    fits = string.size <= 12
    if fits
    "=> \"#{string.downcase.capitalize}\" fits and would make a great name! ✅".green
    else
    # cutoff = string[0...12]
    "=> \"#{string.downcase.capitalize}\" does not fit (#{string.size - 12} over). ❌".red
    end
    end

    if ARGV.none?
    puts "Error: Missing Branch Details".red
    exit 1
    end

    puts wow_name(ARGV.first)