Sha256: 30bf9a57b3d44f3d6da05cd037956f2ef3dc900b0385a542a3cbb343a7da2288
Contents?: true
Size: 501 Bytes
Versions: 48
Compression:
Stored size: 501 Bytes
Contents
#!/usr/bin/env ruby # frozen_string_literal: true require 'optparse' opts = {} OptionParser.new do |options| options.banner = "USAGE: #{File.basename($PROGRAM_NAME)} [opts] " options.on('-pSTRING', '--payload=STRING', '<Required - String to Encode>') do |p| opts[:payload] = p end end.parse! if opts.empty? puts `#{File.basename($PROGRAM_NAME)} --help` exit 1 end payload = opts[:payload].to_s.scrub puts payload.unpack('U*').map { |i| "\\u#{i.to_s(16).rjust(4, '0')}" }.join
Version data entries
48 entries across 48 versions & 1 rubygems