Sha256: 484360aa8dc4ac170366443bda82ba16076a08ce2c7d0137dff68e25124f306f

Contents?: true

Size: 602 Bytes

Versions: 22

Compression:

Stored size: 602 Bytes

Contents

module JasonDB
  #jason_url here doesn't include the http[s]:// part, but does include the domain and a trailing '/'
  #( so it's "rest.jasondb.com/<domain>/" )
  def JasonDB::db_auth_url mode=:secure
    config = Rails.configuration.database_configuration[Rails.env]
    
    user = config["user"]
    topic = config["topic"]
    password = config["password"]
    if config["jason_host"]
      host = config["jason_host"]
    else
      host = "rest.jasondb.com"
    end
    protocol = "http"
    protocol << "s" if mode == :secure
    "#{protocol}://#{user}:#{password}@#{host}/#{topic}/"
  end

end

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
medea-0.3.5 lib/medea/jasondb.rb
medea-0.3.4 lib/medea/jasondb.rb
medea-0.3.3 lib/medea/jasondb.rb
medea-0.3.2 lib/medea/jasondb.rb
medea-0.3.1 lib/medea/jasondb.rb
medea-0.3.0 lib/medea/jasondb.rb
medea-0.2.31 lib/medea/jasondb.rb
medea-0.2.29 lib/medea/jasondb.rb
medea-0.2.28 lib/medea/jasondb.rb
Medea-0.2.27 lib/medea/jasondb.rb
Medea-0.2.26 lib/medea/jasondb.rb
medea-0.2.25 lib/medea/jasondb.rb
medea-0.2.24 lib/medea/jasondb.rb
medea-0.2.23 lib/medea/jasondb.rb
medea-0.2.22 lib/medea/jasondb.rb
medea-0.2.21 lib/medea/jasondb.rb
medea-0.2.20 lib/medea/jasondb.rb
medea-0.2.19 lib/medea/jasondb.rb
medea-0.2.18 lib/medea/jasondb.rb
medea-0.2.17 lib/medea/jasondb.rb