Sha256: dda8f23984ba14ad18dfd1a8b662593caa6e6335c042ca6e80c807d2ff3bb2e6

Contents?: true

Size: 392 Bytes

Versions: 32

Compression:

Stored size: 392 Bytes

Contents

class String

  def char_length
    self.split(//u).size
  end

  def char_length_with_t_co
    Tw::Conf.update_twitter_config
    len = self.char_length
    self.scan(Regexp.new "https?://[^\s]+").each do |url|
      len += (url =~ /^https/ ? Tw::Conf['twitter_config']['short_url_length_https'] : Tw::Conf['twitter_config']['short_url_length']) - url.char_length
    end
    len
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
tw-0.4.9 lib/tw/client/helper.rb
tw-0.4.8 lib/tw/client/helper.rb
tw-0.4.7 lib/tw/client/helper.rb
tw-0.4.6 lib/tw/client/helper.rb
tw-0.4.5 lib/tw/client/helper.rb
tw-0.4.4 lib/tw/client/helper.rb
tw-0.4.3 lib/tw/client/helper.rb
tw-0.4.2 lib/tw/client/helper.rb
tw-0.4.1 lib/tw/client/helper.rb
tw-0.4.0 lib/tw/client/helper.rb
tw-0.3.9 lib/tw/client/helper.rb
tw-0.3.8 lib/tw/client/helper.rb