Sha256: 73ff549600e00e43b0e2bb3e444b8a4cd6b9c8409a5c78122fae2f15dcac650d

Contents?: true

Size: 482 Bytes

Versions: 7

Compression:

Stored size: 482 Bytes

Contents

#!/usr/bin/env ruby
# -*- coding: utf-8 -*-

module Helpers
  def link_to(name, location, alternative = false)
    if alternative and alternative[:condition]
      "<a href=#{alternative[:location]}>#{alternative[:name]}</a>"
    else
      "<a href=#{location}>#{name}</a>"
    end
  end
  
  def multibyte?(text)
    result = false
    text.strip.split(//).each do |chr|
      unless /([!-~]|\s)/ =~ chr
        result = true; break
      end
    end
    return result
  end  
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rsyntaxtree-0.6.92 helpers/helpers.rb
rsyntaxtree-0.6.91 helpers/helpers.rb
rsyntaxtree-0.6.7 helpers/helpers.rb
rsyntaxtree-0.6.6 helpers/helpers.rb
rsyntaxtree-0.6.5 helpers/helpers.rb
rsyntaxtree-0.5.1 helpers/helpers.rb
rsyntaxtree-0.5.0 helpers/helpers.rb