Sha256: 5755bca0532fb3421925096e09f85ad279aca5f7ed947259947a22c42d406f0c

Contents?: true

Size: 321 Bytes

Versions: 11

Compression:

Stored size: 321 Bytes

Contents

require 'openssl'
require 'base64'
require 'cgi'
module OAuth
  module Helper
    extend self

    def escape(value)
      CGI.escape(value.to_s).gsub("%7E", '~').gsub("+", "%20")
    end
    
    def generate_key(size=32)
      Base64.encode64(OpenSSL::Random.random_bytes(size)).gsub(/\W/,'')
    end    
    
  end
end

Version data entries

11 entries across 11 versions & 4 rubygems

Version Path
monkeyhelper-oauth-0.3.1 lib/oauth/helper.rb
pelle-oauth-0.3.0 lib/oauth/helper.rb
pelle-oauth-0.3.1 lib/oauth/helper.rb
proletarian-oauth-0.3.2 lib/oauth/helper.rb
proletarian-oauth-0.3.3 lib/oauth/helper.rb
proletarian-oauth-0.3.4 lib/oauth/helper.rb
proletarian-oauth-0.3.5 lib/oauth/helper.rb
proletarian-oauth-0.3.6 lib/oauth/helper.rb
proletarian-oauth-0.3.7 lib/oauth/helper.rb
oauth-0.3.1 lib/oauth/helper.rb
oauth-0.3.0 lib/oauth/helper.rb