sinatra-activerecord 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/sinatra/activerecord.rb +16 -15
- data/sinatra-activerecord.gemspec +1 -1
- metadata +1 -1
data/lib/sinatra/activerecord.rb
CHANGED
|
@@ -31,21 +31,22 @@ module Sinatra
|
|
|
31
31
|
|
|
32
32
|
def database_options
|
|
33
33
|
url = URI(database_url)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
end
|
|
34
|
+
options = {
|
|
35
|
+
:adapter => url.scheme,
|
|
36
|
+
:host => url.host,
|
|
37
|
+
:port => url.port,
|
|
38
|
+
:database => url.path[1..-1],
|
|
39
|
+
:username => url.user,
|
|
40
|
+
:password => url.password
|
|
41
|
+
}
|
|
42
|
+
case url.scheme
|
|
43
|
+
when "sqlite"
|
|
44
|
+
options[:adapter] = "sqlite3"
|
|
45
|
+
options[:database] = url.host
|
|
46
|
+
when "postgres"
|
|
47
|
+
options[:adapter] = "postgresql"
|
|
48
|
+
end
|
|
49
|
+
options.merge(database_extras)
|
|
49
50
|
end
|
|
50
51
|
|
|
51
52
|
def self.registered(app)
|
|
@@ -3,7 +3,7 @@ Gem::Specification.new do |s|
|
|
|
3
3
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
4
4
|
|
|
5
5
|
s.name = 'sinatra-activerecord'
|
|
6
|
-
s.version = '0.1.
|
|
6
|
+
s.version = '0.1.2'
|
|
7
7
|
s.date = '2009-09-21'
|
|
8
8
|
|
|
9
9
|
s.description = "Extends Sinatra with activerecord helpers for instant activerecord use"
|