mysql_double_index 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/lib/mysql_double_index/db_conn.rb +12 -0
- data/lib/mysql_double_index/version.rb +1 -1
- data/mysql_double_index.gemspec +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9be150c8a42ecd1d0811cff3b08d04c8b9b2030d
|
4
|
+
data.tar.gz: 0f6c6723de490acefc1bf95fd8a15015db68c03c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b13ed17e507f6415781657b4d12121a354d3bcd086a039466f614e2b4f8c2194cf1d5bd0557afcfb8700e3c0301c8e957908a2491f89b594fa1b27d6b2837ee1
|
7
|
+
data.tar.gz: ed820770082696ee8cb0665005665293ed79b2d074db45df58e7bfee7b04b7cb50a5bb839840b43d8aeced0b4d69ea644605e5002e0038ac671193649bb921a2
|
data/.gitignore
CHANGED
@@ -0,0 +1,12 @@
|
|
1
|
+
module MysqlDoubleIndex
|
2
|
+
module_function
|
3
|
+
def load_config
|
4
|
+
config_path = Rails.root ? File.join(Rails.root, "config", "database.yml") : './config/database.yml'
|
5
|
+
File.open(config_path)
|
6
|
+
end
|
7
|
+
|
8
|
+
def db_connection
|
9
|
+
dbconfig = YAML::load(MysqlDoubleIndex.load_config)
|
10
|
+
ActiveRecord::Base.establish_connection(dbconfig[Rails::env.to_s])
|
11
|
+
end
|
12
|
+
end
|
data/mysql_double_index.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
26
26
|
spec.bindir = "exe"
|
27
27
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
|
-
spec.require_paths = ["lib"]
|
28
|
+
spec.require_paths = ["lib","lib/mysql_double_index"]
|
29
29
|
|
30
30
|
spec.add_development_dependency "rspec", "~> 3.2"
|
31
31
|
spec.add_development_dependency "bundler", "~> 1.10"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mysql_double_index
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sunyafei
|
@@ -124,6 +124,7 @@ files:
|
|
124
124
|
- bin/console
|
125
125
|
- bin/setup
|
126
126
|
- lib/mysql_double_index.rb
|
127
|
+
- lib/mysql_double_index/db_conn.rb
|
127
128
|
- lib/mysql_double_index/version.rb
|
128
129
|
- mysql_double_index.gemspec
|
129
130
|
homepage: https://github.com/sun1752709589
|
@@ -135,6 +136,7 @@ post_install_message:
|
|
135
136
|
rdoc_options: []
|
136
137
|
require_paths:
|
137
138
|
- lib
|
139
|
+
- lib/mysql_double_index
|
138
140
|
required_ruby_version: !ruby/object:Gem::Requirement
|
139
141
|
requirements:
|
140
142
|
- - ">="
|