Sha256: b9ef189e922b58e9bbfc4a1c49a52a303b2c2328d3140d0ef7fb52cc335fbe60

Contents?: true

Size: 409 Bytes

Versions: 2

Compression:

Stored size: 409 Bytes

Contents

class Kumogata::Utils
  class << self
    def camelize(str)
      str.to_s.split(/[-_]/).map {|i|
        i[0, 1].upcase + i[1..-1].downcase
      }.join
    end

    def get_user_host
      user = `whoami`.strip rescue ''
      host = `hostname`.strip rescue ''
      user_host = [user, host].select {|i| not i.empty? }.join('-')
      user_host.empty? ? nil : user_host
    end
  end # of class methods
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
kumogata-0.3.0 lib/kumogata/utils.rb
kumogata-0.2.19 lib/kumogata/utils.rb