lib/couch_potato.rb in couch_potato-0.2.12 vs lib/couch_potato.rb in couch_potato-0.2.13
- old
+ new
@@ -3,10 +3,11 @@
require 'json/add/core'
require 'json/add/rails'
require 'ostruct'
+JSON.create_id = 'ruby_class'
module CouchPotato
Config = Struct.new(:database_name).new
# Returns a database instance which you can then use to create objects and query views. You have to set the CouchPotato::Config.database_name before this works.
@@ -21,10 +22,10 @@
private
def self.full_url_to_database
raise('No Database configured. Set CouchPotato::Config.database_name') unless CouchPotato::Config.database_name
- if CouchPotato::Config.database_name[0,7] == 'http://'
+ if CouchPotato::Config.database_name.match(%r{https?://})
CouchPotato::Config.database_name
else
"http://127.0.0.1:5984/#{CouchPotato::Config.database_name}"
end
end