#!/usr/bin/env ruby # encoding: UTF-8 lib = File.expand_path(File.dirname(__FILE__) + '/../lib') $LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib) require 'turkish_id' print "Enter your 11 digit id number to validate: " begin identity_number = TurkishId.new(gets.chomp) valid = identity_number.is_valid? rescue puts "Your identification number is invalid." end puts "Your identification number is valid." if valid