activerecord-fb-adapter 0.9.0 → 0.9.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.
- checksums.yaml +4 -4
- data/lib/active_record/fb_base.rb +11 -6
- metadata +9 -10
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fd91257c22642692e91cfd7a15de3bc0684d3148
|
|
4
|
+
data.tar.gz: 28371fa7615afc66fcbf322ea08b77810390fe05
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 76431db22cf5caf52185ab189ab48295dcbe62e8bba1863ecb21c7213c5ab228d78c87b19a10d3f872741e2247ab40ef3130404db3bb0b8c93acdcdc9083a2ca
|
|
7
|
+
data.tar.gz: 732da63410df05ae6416c6f38d7c4e3ff322a0b5a49a66cd61930db5a4ec2835508c26c081477c48b962e96daf2bd76e423d82524aade7d3f404ee012a65250f
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
module ActiveRecord
|
|
2
2
|
class Base
|
|
3
3
|
def self.fb_connection(config) # :nodoc:
|
|
4
|
-
config = config.symbolize_keys.reverse_merge(:downcase_names => true)
|
|
5
|
-
fail ArgumentError, 'No database specified. Missing argument: database.' unless config[:database]
|
|
6
|
-
if db_host = config[:host]
|
|
7
|
-
config[:database] = File.expand_path(config[:database]) if db_host =~ /localhost/i
|
|
8
|
-
config[:database].prepend "#{db_host}/#{config[:port] || 3050}:"
|
|
9
|
-
end
|
|
10
4
|
require 'fb'
|
|
5
|
+
config = fb_connection_config(config)
|
|
11
6
|
db = ::Fb::Database.new(config)
|
|
12
7
|
begin
|
|
13
8
|
connection = db.connect
|
|
@@ -21,5 +16,15 @@ module ActiveRecord
|
|
|
21
16
|
end
|
|
22
17
|
ConnectionAdapters::FbAdapter.new(connection, logger, config)
|
|
23
18
|
end
|
|
19
|
+
|
|
20
|
+
def self.fb_connection_config(config)
|
|
21
|
+
config = config.symbolize_keys.reverse_merge(:downcase_names => true, :port => 3050)
|
|
22
|
+
fail ArgumentError, 'No database specified. Missing argument: database.' if !config[:database]
|
|
23
|
+
if config[:host].nil? || config[:host] =~ /localhost/i
|
|
24
|
+
config[:database] = File.expand_path(config[:database], defined?(Rails) && Rails.root)
|
|
25
|
+
end
|
|
26
|
+
config[:database] = "#{config[:host]}/#{config[:port]}:#{config[:database]}" if config[:host]
|
|
27
|
+
config
|
|
28
|
+
end
|
|
24
29
|
end
|
|
25
30
|
end
|
metadata
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activerecord-fb-adapter
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.9.
|
|
4
|
+
version: 0.9.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Brent Rowland
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-12-
|
|
11
|
+
date: 2014-12-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: fb
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- -
|
|
17
|
+
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
19
|
version: 0.7.4
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
|
-
- -
|
|
24
|
+
- - ">="
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: 0.7.4
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: activerecord
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- -
|
|
31
|
+
- - ">="
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
33
|
version: 3.2.0
|
|
34
34
|
type: :runtime
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
|
-
- -
|
|
38
|
+
- - ">="
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
40
|
version: 3.2.0
|
|
41
41
|
description:
|
|
@@ -64,20 +64,19 @@ require_paths:
|
|
|
64
64
|
- lib
|
|
65
65
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
66
66
|
requirements:
|
|
67
|
-
- -
|
|
67
|
+
- - ">="
|
|
68
68
|
- !ruby/object:Gem::Version
|
|
69
69
|
version: '0'
|
|
70
70
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
71
71
|
requirements:
|
|
72
|
-
- -
|
|
72
|
+
- - ">="
|
|
73
73
|
- !ruby/object:Gem::Version
|
|
74
74
|
version: '0'
|
|
75
75
|
requirements:
|
|
76
76
|
- Firebird library fb
|
|
77
77
|
rubyforge_project:
|
|
78
|
-
rubygems_version: 2.2.
|
|
78
|
+
rubygems_version: 2.2.0
|
|
79
79
|
signing_key:
|
|
80
80
|
specification_version: 4
|
|
81
81
|
summary: ActiveRecord Firebird Adapter for Rails 3 and 4 with support for migrations.
|
|
82
82
|
test_files: []
|
|
83
|
-
has_rdoc: false
|