atl_config 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/atl_config.rb +1 -1
- data/lib/atl_config/confluencecfg.rb +5 -2
- data/lib/atl_config/jiraconfig.rb +5 -2
- data/lib/atl_config/serverxml.rb +4 -3
- data/lib/atl_config/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 816e2a8bee15734535cb9fee7f917b61a4a70a52
|
4
|
+
data.tar.gz: 1d36325668175bc6c17c5275d6477639e0893793
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db6131e084339bf9b73f7062104e84ef15c9bc3ca35cccdc034f9a924d68454f302d204e2a3700bc57d33c1f01e88d9458165c25089ab57f9419bfa2b920cfcc
|
7
|
+
data.tar.gz: 1814c75a945c5ed933d879e01f5b4a96c1d79200f35ed13fe80f069c218fd264e3f9c0e02a16572e3b0776957646fe3a86979e10b4d8656be06cd8595fbecfc0
|
data/lib/atl_config.rb
CHANGED
@@ -7,5 +7,5 @@ require "atl_config/appinfo"
|
|
7
7
|
|
8
8
|
module AtlConfig
|
9
9
|
# Struct containing database connection info.
|
10
|
-
DBInfo = Struct.new :datasource, :user, :password, :dbtype, :host, :port, :database
|
10
|
+
DBInfo = Struct.new :datasource, :user, :password, :dbtype, :host, :port, :database, :jdbcurl, :dburl
|
11
11
|
end
|
@@ -12,8 +12,11 @@ module AtlConfig
|
|
12
12
|
base = config.xpath("/confluence-configuration/properties")
|
13
13
|
r.user = base.xpath("property[@name='hibernate.connection.username']/text()").first&.to_s
|
14
14
|
r.password = base.xpath("property[@name='hibernate.connection.password']/text()").first&.to_s
|
15
|
-
|
16
|
-
|
15
|
+
# jdbcurl is the URL in Java/JDBC format. dburl is the URL in Ruby format
|
16
|
+
r.jdbcurl = base.xpath("property[@name='hibernate.connection.url']/text()").first&.to_s
|
17
|
+
# FIXME: it's probably more complex than this..
|
18
|
+
r.dburl = r.jdbcurl.gsub("jdbc:postgresql", "postgres")
|
19
|
+
urlparts = AtlConfig::JDBCURL.parse(r.jdbcurl)
|
17
20
|
r.dbtype = urlparts[:dbtype]
|
18
21
|
r.host = urlparts[:host]
|
19
22
|
r.port = if urlparts[:port] then urlparts[:port].to_i
|
@@ -12,8 +12,11 @@ module AtlConfig
|
|
12
12
|
base = config.xpath("/jira-database-config/jdbc-datasource")
|
13
13
|
r.user = base.xpath("username/text()").first&.to_s
|
14
14
|
r.password = base.xpath("password/text()").first&.to_s
|
15
|
-
|
16
|
-
|
15
|
+
# jdbcurl is the URL in Java/JDBC format. dburl is the URL in Ruby format
|
16
|
+
r.jdbcurl = base.xpath("url/text()").first&.to_s
|
17
|
+
# FIXME: it's probably more complex than this..
|
18
|
+
r.dburl = r.jdbcurl.gsub("jdbc:postgresql", "postgres")
|
19
|
+
urlparts = AtlConfig::JDBCURL.parse(r.jdbcurl)
|
17
20
|
r.dbtype = urlparts[:dbtype]
|
18
21
|
r.host = urlparts[:host]
|
19
22
|
r.port = if urlparts[:port] then urlparts[:port].to_i
|
data/lib/atl_config/serverxml.rb
CHANGED
@@ -14,9 +14,10 @@ module AtlConfig
|
|
14
14
|
r = DBInfo.new
|
15
15
|
r.user = datasource.xpath("@username")&.to_s
|
16
16
|
r.password = datasource.xpath("@password")&.to_s
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
r.jdbcurl = datasource.xpath("@url")&.to_s
|
18
|
+
r.dburl = r.jdbcurl.gsub("jdbc:postgresql", "postgres")
|
19
|
+
if r.jdbcurl then
|
20
|
+
urlparts = AtlConfig::JDBCURL.parse(r.jdbcurl)
|
20
21
|
r.dbtype = urlparts[:dbtype]
|
21
22
|
r.host = urlparts[:host]
|
22
23
|
r.port = if urlparts[:port] then urlparts[:port].to_i
|
data/lib/atl_config/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: atl_config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Turner
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03
|
11
|
+
date: 2016-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|