Sha256: 3a4a2126a3ef9a17d8e3329199c936925ee743a4e23e6bbc1302b529ae23d2a8
Contents?: true
Size: 652 Bytes
Versions: 77
Compression:
Stored size: 652 Bytes
Contents
#!/usr/bin/env ruby require 'tins/go' include Tins::GO require 'tins/xt/string' $opts = go 'bdts' string = ARGV.shift or fail "need a class/filepath/filename" def underscore(string) string = string.sub(/.*::/, '') if $opts['b'] string = string.underscore $opts['s'] and string << '.rb' print string end def camelize(string) string = File.basename(string) if $opts['b'] string = string.gsub(/#{Regexp.quote(File.extname(string))}\Z/, '') print string.camelize end case when $opts['t'] if string[0, 1] =~ /[A-Z]/ underscore string else camelize string end when $opts['d'] underscore string else camelize string end
Version data entries
77 entries across 77 versions & 1 rubygems