oci8_simple 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/lib/oci8_simple/client.rb +1 -2
- data/lib/oci8_simple/config.rb +3 -2
- data/test/client_test.rb +3 -1
- metadata +4 -4
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.1
|
data/lib/oci8_simple/client.rb
CHANGED
@@ -36,7 +36,6 @@ module Oci8Simple
|
|
36
36
|
# SQL
|
37
37
|
class Client
|
38
38
|
USER_DIR = File.join(ENV["HOME"], ".oci8_simple")
|
39
|
-
CONFIG = Config.new
|
40
39
|
LOG_FILE = File.join(USER_DIR, "oci8_simple.log")
|
41
40
|
|
42
41
|
attr_accessor :log_file, :env
|
@@ -97,7 +96,7 @@ module Oci8Simple
|
|
97
96
|
end
|
98
97
|
|
99
98
|
def config
|
100
|
-
@config ||=
|
99
|
+
@config ||= Config.new[env]
|
101
100
|
end
|
102
101
|
|
103
102
|
# Create and return raw Oci8 connection
|
data/lib/oci8_simple/config.rb
CHANGED
@@ -25,11 +25,12 @@ module Oci8Simple
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def load_yaml
|
28
|
+
file = database_yaml_path
|
28
29
|
begin
|
29
|
-
@raw_config = YAML.load_file(
|
30
|
+
@raw_config = YAML.load_file(file)
|
30
31
|
rescue Errno::ENOENT => e
|
31
32
|
raise ConfigError.new <<-ERR
|
32
|
-
File #{
|
33
|
+
File #{file} doesn't exist - use the following template:
|
33
34
|
|
34
35
|
environment:
|
35
36
|
database: 192.168.1.3:1521/sid
|
data/test/client_test.rb
CHANGED
@@ -20,7 +20,9 @@ class ClientTest < Test::Unit::TestCase
|
|
20
20
|
end
|
21
21
|
context "with no database.yml" do
|
22
22
|
setup do
|
23
|
-
|
23
|
+
fake_file = "/flkjlkj/flkjljk/flklkj"
|
24
|
+
Oci8Simple::Config.any_instance.expects(:database_yaml_path).returns(fake_file)
|
25
|
+
YAML.expects(:load_file).with(fake_file).raises(Errno::ENOENT.new)
|
24
26
|
end
|
25
27
|
should "raise a custom error" do
|
26
28
|
assert_raise Oci8Simple::ConfigError do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oci8_simple
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
12
|
+
date: 2013-04-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ruby-oci8
|
@@ -78,7 +78,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
78
78
|
version: '0'
|
79
79
|
segments:
|
80
80
|
- 0
|
81
|
-
hash:
|
81
|
+
hash: 2209339732871713714
|
82
82
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
87
87
|
version: '0'
|
88
88
|
segments:
|
89
89
|
- 0
|
90
|
-
hash:
|
90
|
+
hash: 2209339732871713714
|
91
91
|
requirements: []
|
92
92
|
rubyforge_project:
|
93
93
|
rubygems_version: 1.8.25
|