Sha256: 1fa0ace8eb67d5ed83cc797fa8a67f71ca299c3012740b7e3fc3cc82ae14ff6c

Contents?: true

Size: 630 Bytes

Versions: 10

Compression:

Stored size: 630 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

10 entries across 10 versions & 1 rubygems

Version Path
medea-0.2.13 lib/medea/jasondb.rb
medea-0.2.12 lib/medea/jasondb.rb
medea-0.2.11 lib/medea/jasondb.rb
medea-0.2.10 lib/medea/jasondb.rb
medea-0.2.9 lib/medea/jasondb.rb
medea-0.2.8 lib/medea/jasondb.rb
medea-0.2.7 lib/medea/jasondb.rb
medea-0.2.6 lib/medea/jasondb.rb
medea-0.2.5 lib/medea/jasondb.rb
medea-0.2.4 lib/medea/jasondb.rb