mysql_double_index 0.1.1 → 0.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5638e899d0b0c52f23e82b2f6885dcf9b66a918a
4
- data.tar.gz: 4837bf00e19aa1efcc68ad43c08f383858a0e77c
3
+ metadata.gz: 9be150c8a42ecd1d0811cff3b08d04c8b9b2030d
4
+ data.tar.gz: 0f6c6723de490acefc1bf95fd8a15015db68c03c
5
5
  SHA512:
6
- metadata.gz: 16a95ba601d9b2cb3dddf769aa008d2e760738de40fa383be32e442df3250d680bc8681f52a38cc3c38ee212ad03cddd1b5ed9c676871fe3293d54eaec856bc6
7
- data.tar.gz: 135a98ac122b45ee4e70a4c2a6031d54bd8bd66336e44850f0d6334c66455b282818c631b216eca911b62bb1d993fa7ea7aa752e05cf4a0338ff9e39181b6833
6
+ metadata.gz: b13ed17e507f6415781657b4d12121a354d3bcd086a039466f614e2b4f8c2194cf1d5bd0557afcfb8700e3c0301c8e957908a2491f89b594fa1b27d6b2837ee1
7
+ data.tar.gz: ed820770082696ee8cb0665005665293ed79b2d074db45df58e7bfee7b04b7cb50a5bb839840b43d8aeced0b4d69ea644605e5002e0038ac671193649bb921a2
data/.gitignore CHANGED
@@ -7,3 +7,5 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ /*.gem
11
+ /config/*.*
@@ -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
@@ -1,3 +1,3 @@
1
1
  module MysqlDoubleIndex
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -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.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
  - - ">="