octoshark 0.0.6 → 0.0.7

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: 90a3eb977595f681e0fffb0fe11387a0bfd14a5f
4
- data.tar.gz: 2eb1ddcefcd71470ab1f6f0271b854b3294b9874
3
+ metadata.gz: d633a471d22eac63cd9221ccc6d05446f0dd374f
4
+ data.tar.gz: 17bbd7dd09f26461f283520e1a7dd2eec5224817
5
5
  SHA512:
6
- metadata.gz: f317a576062bdee24ca65433969742ec7d86890af9f936d6fa6241bd69e5e4486dfa06e2de5bcac6f2c639c4946c9b25fd144db7afdfc29478cee5ff4b0db991
7
- data.tar.gz: d27b2fdafc8a99bd78ac69e80152e509710908ebc5116451128c732ef793f79d5ad852dc4c47df3dfc757d21ec710996b4f4ff97f000d9f3df34230845e4763b
6
+ metadata.gz: 5e44c905b0c564be6446d7e9adde9d69cf6013da491da760194eeafc86c50b43322b1de1b036d1d1f18b6ba4a88f17a7740b399540f2f67d21a024f3152cf36f
7
+ data.tar.gz: ee16b4532fd1efc1709c3a401ae084de11e3bf62c53a657f5fab86bfa1fed022d2263c4a17d7d62b623362d1e432df5be2abdc3a8adcd64a43f381788a19937c
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- ![Travis status](https://travis-ci.org/dalibor/octoshark.png)
1
+ ![Octoshark logo](https://dl.dropboxusercontent.com/u/3230730/github/octoshark.png)
2
2
 
3
- # Octoshark
3
+ ![Travis status](https://travis-ci.org/dalibor/octoshark.png)
4
4
 
5
5
  Octoshark is a simple ActiveRecord connection switcher. It provides a general purpose connection switching mechanism that can be used in sharding and master-slave multi-database environments. It's up to you to specify how ActiveRecord models will use the Octoshark connections, see below for example scenarios.
6
6
 
@@ -155,6 +155,10 @@ def clean_database_with
155
155
  end
156
156
  ```
157
157
 
158
+ ## Logo
159
+
160
+ Thanks to [@saschamt](https://github.com/saschamt) for Octoshark logo design. :)
161
+
158
162
  ## Contributing
159
163
 
160
164
  1. Fork it ( http://github.com/dalibor/octoshark/fork )
@@ -17,17 +17,23 @@ module Octoshark
17
17
  end
18
18
 
19
19
  module ActiveRecordAbstractAdapter
20
+ extend ActiveSupport::Concern
21
+
20
22
  attr_accessor :connection_name
21
23
 
22
- def log(sql, name = "SQL", *other_args)
24
+ included do
25
+ alias_method_chain :log, :octoshark
26
+ end
27
+
28
+ def log_with_octoshark(sql, name = "SQL", *other_args, &block)
23
29
  if connection_name
24
30
  name = "[Octoshark: #{connection_name}] #{name}"
25
31
  end
26
32
 
27
- super(sql, name, *other_args)
33
+ log_without_octoshark(sql, name, *other_args, &block)
28
34
  end
29
35
  end
30
36
  end
31
37
 
32
38
  ActiveRecord::Base.send(:include, Octoshark::ActiveRecordBase)
33
- ActiveRecord::ConnectionAdapters::AbstractAdapter.send(:prepend, Octoshark::ActiveRecordAbstractAdapter)
39
+ ActiveRecord::ConnectionAdapters::AbstractAdapter.send(:include, Octoshark::ActiveRecordAbstractAdapter)
@@ -1,3 +1,3 @@
1
1
  module Octoshark
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
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.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dalibor Nasevic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-24 00:00:00.000000000 Z
11
+ date: 2014-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord