Sha256: 6c607747c0106716d246ccd70d3820dd2d72a2a6715865d4eba35ecdc246ec4e
Contents?: true
Size: 985 Bytes
Versions: 4
Compression:
Stored size: 985 Bytes
Contents
module TwitterOAuth class Client private def consumer @consumer ||= OAuth::Consumer.new( @consumer_key, @consumer_secret, { :site => 'https://api.twitter.com', :proxy => @proxy } ) end end end class String def c(*codes) codes = codes.flatten.map { |code| case code when String, Symbol Earthquake.config[:color][code.to_sym] rescue nil else code end }.compact.unshift(0) "\e[#{codes.join(';')}m#{self}\e[0m" end def u gsub(/&(lt|gt|amp|quot|apos);/) do |s| case s when '&' then '&' when '<' then '<' when '>' then '>' when ''' then "'" when '"' then '"' end end end def e gsub(/[&<>'"]/) do |s| case s when '&' then '&' when '<' then '<' when '>' then '>' when "'" then ''' when '"' then '"' end end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
earthquake-0.6.3 | lib/earthquake/ext.rb |
earthquake-0.6.2 | lib/earthquake/ext.rb |
earthquake-0.6.1 | lib/earthquake/ext.rb |
earthquake-0.6.0 | lib/earthquake/ext.rb |