oci8_simple 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.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- oci8_simple (0.9.0)
4
+ oci8_simple (0.9.1)
5
5
  ruby-oci8 (~> 2.1.2)
6
6
 
7
7
  GEM
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.0
1
+ 0.9.1
@@ -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 ||= CONFIG[ env]
99
+ @config ||= Config.new[env]
101
100
  end
102
101
 
103
102
  # Create and return raw Oci8 connection
@@ -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(database_yaml_path)
30
+ @raw_config = YAML.load_file(file)
30
31
  rescue Errno::ENOENT => e
31
32
  raise ConfigError.new <<-ERR
32
- File #{CONFIG_FILE} doesn't exist - use the following template:
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
- YAML.expects(:load_file).with(Oci8Simple::Client::CONFIG_FILE).raises(Errno::ENOENT.new)
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.0
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-10 00:00:00.000000000 Z
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: -178540163749839115
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: -178540163749839115
90
+ hash: 2209339732871713714
91
91
  requirements: []
92
92
  rubyforge_project:
93
93
  rubygems_version: 1.8.25