Sha256: 68a2ba4093ff437265881b9a6ed991c23594278496f0a2358766614ce89cc0c0

Contents?: true

Size: 453 Bytes

Versions: 2

Compression:

Stored size: 453 Bytes

Contents

require 'xmlsimple'
module SharedTool
  class RegularExpression
    def has_string(data, regex)
      if first_occurence data, regex != ""
        return true
      end
      return false
    end
    def first_occurrence(data, regex)
      if data =~ regex
        return $1
      end 
      return ""
    end
  end
end
class String
  def remove_non_ascii(replacement="") 
    self.force_encoding('ASCII-8BIT').gsub(/[\x80-\xff]/,replacement)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
beta_tools-0.0.5 lib/it_tools/shared.rb
beta_tools-0.0.4 lib/it_tools/shared.rb