module Kuport::ClassExtensions

Public Class Methods

basename_noext(path) click to toggle source
# File lib/kuport/helper.rb, line 101
def self.basename_noext(path)
  File.basename(path, File.extname(path))
end

Public Instance Methods

blank?() click to toggle source
# File lib/kuport/helper.rb, line 67
def blank?
  true
end
br_to_return() click to toggle source
# File lib/kuport/helper.rb, line 95
def br_to_return
  self.search('br').each{|br| br.replace("\n")}
end
take_with_keys(*keys) click to toggle source
# File lib/kuport/helper.rb, line 87
def take_with_keys(*keys)
  ret = {}
  keys.each{|k| ret[k] = self.delete(k) if self.key?(k)}
  return ret.empty? ? nil : ret
end
to_half_str() click to toggle source
# File lib/kuport/helper.rb, line 73
def to_half_str
  NKF.nkf('-m0Z1 -w -W', self)
end
url?() click to toggle source
# File lib/kuport/helper.rb, line 77
def url?
  self =~ /\A#{URI::regexp}\z/
end