activerecord_url_connections 0.0.1
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/.gitignore +4 -0
- data/Gemfile +5 -0
- data/Rakefile +2 -0
- data/activerecord_url_connections.gemspec +19 -0
- data/lib/activerecord_url_connections.rb +13 -0
- data/lib/activerecord_url_connections/version.rb +3 -0
- metadata +68 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "activerecord_url_connections/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "activerecord_url_connections"
|
7
|
+
s.version = ActiverecordURLConnections::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Glenn Gillen"]
|
10
|
+
s.email = ["glenn@rubypond.com"]
|
11
|
+
s.homepage = ""
|
12
|
+
s.summary = %q{Convert URLs into AR friendly hashes}
|
13
|
+
s.description = %q{Allows database connections to be defined as URLS, then converted to hash for use in ActiveRecord}
|
14
|
+
s.rubyforge_project = "activerecord_url_connections"
|
15
|
+
s.files = `git ls-files`.split("\n")
|
16
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
17
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
18
|
+
s.require_paths = ["lib"]
|
19
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module ActiverecordURLConnections
|
2
|
+
def self.parse(str)
|
3
|
+
config = URI.parse(str)
|
4
|
+
{ :encoding => "unicode",
|
5
|
+
:port => config.port,
|
6
|
+
:username => config.user,
|
7
|
+
:adapter => "postgresql",
|
8
|
+
:database => config.path.gsub(%r{/},""),
|
9
|
+
:host => config.host,
|
10
|
+
:password => config.password
|
11
|
+
}
|
12
|
+
end
|
13
|
+
end
|
metadata
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: activerecord_url_connections
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.0.1
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Glenn Gillen
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2011-06-01 00:00:00 +01:00
|
14
|
+
default_executable:
|
15
|
+
dependencies: []
|
16
|
+
|
17
|
+
description: Allows database connections to be defined as URLS, then converted to hash for use in ActiveRecord
|
18
|
+
email:
|
19
|
+
- glenn@rubypond.com
|
20
|
+
executables: []
|
21
|
+
|
22
|
+
extensions: []
|
23
|
+
|
24
|
+
extra_rdoc_files: []
|
25
|
+
|
26
|
+
files:
|
27
|
+
- .gitignore
|
28
|
+
- Gemfile
|
29
|
+
- Rakefile
|
30
|
+
- activerecord_url_connections.gemspec
|
31
|
+
- lib/activerecord_url_connections.rb
|
32
|
+
- lib/activerecord_url_connections/version.rb
|
33
|
+
has_rdoc: true
|
34
|
+
homepage: ""
|
35
|
+
licenses: []
|
36
|
+
|
37
|
+
post_install_message:
|
38
|
+
rdoc_options: []
|
39
|
+
|
40
|
+
require_paths:
|
41
|
+
- lib
|
42
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
43
|
+
none: false
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
hash: -3301545664464402447
|
48
|
+
segments:
|
49
|
+
- 0
|
50
|
+
version: "0"
|
51
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
hash: -3301545664464402447
|
57
|
+
segments:
|
58
|
+
- 0
|
59
|
+
version: "0"
|
60
|
+
requirements: []
|
61
|
+
|
62
|
+
rubyforge_project: activerecord_url_connections
|
63
|
+
rubygems_version: 1.6.0
|
64
|
+
signing_key:
|
65
|
+
specification_version: 3
|
66
|
+
summary: Convert URLs into AR friendly hashes
|
67
|
+
test_files: []
|
68
|
+
|