octoshark 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 250485b4a7d40ba746223723276e9edbee4fc8b0
4
- data.tar.gz: 0c58c2fd4569f288fe87129c0566bba3d34790aa
3
+ metadata.gz: 2f85ce710bd85c0dbfebb2c5eef56c15df187261
4
+ data.tar.gz: 65a8ee327c29c51b51c062e8adecbff951d382b5
5
5
  SHA512:
6
- metadata.gz: e904f55fa222ea36745a01fedbf936dd2bca0bbfe116b7eaa69ab0e56ae5fef5503fe800d2f5065d8d69d6ee2b7244ba5644e5ff5e5adc66d032f9f3d1fc9470
7
- data.tar.gz: 139e493c0f689d4865f218247a8e0bfafee8f9605e7cb14b0ad0c3356422d0a32e731fd5127b52da7d6f05e291112c373af40959324b1fa2c9f5d26799ac4469
6
+ metadata.gz: 00f549a2766e0d417746d7cb3b90c7e83d104891d5611795493d5388e50d6d0816de5f92b9abddb40e208ddf5dd539fea44a57bd293d82707275f641d08b93d7
7
+ data.tar.gz: d629c9207dd790baf07fe66e57a0f489b1bf364ce4257fa5385f28a8fd7debfdbd805bd69bf7c32eb29d64ffa859dd16e482fe4a3cccfd598e50df233fdf182f
@@ -1 +1 @@
1
- 2.1.1
1
+ 2.2.2
@@ -1,16 +1,18 @@
1
1
  rvm:
2
- - 2.1.0
2
+ - 2.2.2
3
3
  cache:
4
4
  - bundler
5
5
  notifications:
6
6
  email:
7
7
  - dalibor.nasevic@gmail.com
8
8
  gemfile:
9
+ - gemfiles/rails3.0.gemfile
9
10
  - gemfiles/rails3.1.gemfile
10
11
  - gemfiles/rails3.2.gemfile
11
- - gemfiles/rails4.gemfile
12
+ - gemfiles/rails4.0.gemfile
12
13
  - gemfiles/rails4.1.gemfile
13
14
  - gemfiles/rails4.2.gemfile
15
+ - gemfiles/rails5.0.gemfile
14
16
  before_script:
15
17
  - cp spec/support/config.yml.travis spec/support/config.yml
16
18
  - bundle exec rake db:create
data/Appraisals CHANGED
@@ -1,3 +1,8 @@
1
+ appraise "rails3.0" do
2
+ gem "activerecord", "~> 3.0.0"
3
+ gem "mysql2", '< 0.3'
4
+ end
5
+
1
6
  appraise "rails3.1" do
2
7
  gem "activerecord", "~> 3.1.0"
3
8
  end
@@ -6,7 +11,7 @@ appraise "rails3.2" do
6
11
  gem "activerecord", "~> 3.2.0"
7
12
  end
8
13
 
9
- appraise "rails4" do
14
+ appraise "rails4.0" do
10
15
  gem "activerecord", "~> 4.0.0"
11
16
  end
12
17
 
@@ -17,3 +22,7 @@ end
17
22
  appraise "rails4.2" do
18
23
  gem "activerecord", "~> 4.2.0"
19
24
  end
25
+
26
+ appraise "rails5.0" do
27
+ gem "activerecord", "~> 5.0.0"
28
+ end
@@ -1,5 +1,9 @@
1
1
  # Change log
2
2
 
3
+ ## 0.2.1 2016-09-09
4
+
5
+ - Add support for Rails 5 and Rails 3
6
+
3
7
  ## 0.2.0 2016-08-29
4
8
 
5
9
  - `Octoshark::ConnectionManager` is split in two managers `Octoshark::ConnectionPoolsManager` for persistent connections and `Octoshark::ConnectionManager` for non-persistent connections.
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", "~> 3.0.0"
6
+ gem "mysql2", "< 0.3"
7
+
8
+ gemspec :path => "../"
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", "~> 5.0.0"
6
+
7
+ gemspec :path => "../"
@@ -65,6 +65,7 @@ module Octoshark
65
65
  if defined?(ActiveRecord::ConnectionAdapters::ConnectionSpecification)
66
66
  spec_class = ActiveRecord::ConnectionAdapters::ConnectionSpecification
67
67
  else
68
+ # Rails 3.0, 3.1 and 3.2
68
69
  spec_class = ActiveRecord::Base::ConnectionSpecification
69
70
  end
70
71
  end
@@ -73,12 +74,20 @@ module Octoshark
73
74
  @connection_pools = HashWithIndifferentAccess.new
74
75
 
75
76
  @configs.each_pair do |name, config|
76
- @connection_pools[name] = create_connection_pool(config)
77
+ @connection_pools[name] = create_connection_pool(name, config)
77
78
  end
78
79
  end
79
80
 
80
- def create_connection_pool(config)
81
- spec = spec_class.new(config, "#{config[:adapter]}_connection")
81
+ def create_connection_pool(name, config)
82
+ adapter_method = "#{config[:adapter]}_connection"
83
+ spec =
84
+ if spec_class.instance_method(:initialize).arity == 3
85
+ # Rails 5 ConnectionSpecification accepts spec name
86
+ spec_class.new(name, config, adapter_method)
87
+ else
88
+ spec_class.new(config, adapter_method)
89
+ end
90
+
82
91
  ActiveRecord::ConnectionAdapters::ConnectionPool.new(spec)
83
92
  end
84
93
  end
@@ -1,3 +1,3 @@
1
1
  module Octoshark
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octoshark
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dalibor Nasevic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-29 00:00:00.000000000 Z
11
+ date: 2016-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -125,11 +125,13 @@ files:
125
125
  - LICENSE.txt
126
126
  - README.md
127
127
  - Rakefile
128
+ - gemfiles/rails3.0.gemfile
128
129
  - gemfiles/rails3.1.gemfile
129
130
  - gemfiles/rails3.2.gemfile
131
+ - gemfiles/rails4.0.gemfile
130
132
  - gemfiles/rails4.1.gemfile
131
133
  - gemfiles/rails4.2.gemfile
132
- - gemfiles/rails4.gemfile
134
+ - gemfiles/rails5.0.gemfile
133
135
  - lib/octoshark.rb
134
136
  - lib/octoshark/active_record_extensions.rb
135
137
  - lib/octoshark/connection_manager.rb
@@ -166,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
166
168
  version: '0'
167
169
  requirements: []
168
170
  rubyforge_project:
169
- rubygems_version: 2.2.2
171
+ rubygems_version: 2.4.5
170
172
  signing_key:
171
173
  specification_version: 4
172
174
  summary: Octoshark is an ActiveRecord connection switcher
@@ -179,3 +181,4 @@ test_files:
179
181
  - spec/support/config.yml.template
180
182
  - spec/support/config.yml.travis
181
183
  - spec/support/helpers.rb
184
+ has_rdoc: