sequel-asterisk-hunter 1.1.0 → 1.2.0
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 +4 -4
- data/CHANGELOG.md +10 -0
- data/lib/sequel-asterisk-hunter/version.rb +1 -1
- data/lib/sequel/extensions/asterisk_hunter.rb +17 -11
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a9879e4821cf6fb0be3d5b03c8fee2feaa388375460cc5db45133eb0d2bc3fe6
|
|
4
|
+
data.tar.gz: 7e92a385d101069ca0d0c1159cf40ea1bb61c9fd8b4072f60301c2c3b848ba3c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7da834408353c984a343795de929fae7af77671f68617561d442b6d2ad49f45f41dfe4f4ae1fc17410a36b402d794de4e9f831389aa35f02b8ed93a68d2dde97
|
|
7
|
+
data.tar.gz: 9e16f7c16b044d0f8ae9dacc5b3e295289fe86134aed124e9639032f8555adbe48fbd986ba6ad0faab796701926616ddddc2e9db59694e5ecfb27858e9406a85
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
### 1.2.0 (2018.12.26)
|
|
2
|
+
|
|
3
|
+
- Change overriden method from `Sequel::Dataset#all` to `Sequel::Dataset#fetch_rows`, to hunt `SELECT *` statements for any query executed.
|
|
4
|
+
- Refactorings
|
|
5
|
+
|
|
6
|
+
### 1.1.0 (2018.12.22)
|
|
7
|
+
|
|
8
|
+
- Override Sequel::Dataset#all to find for `SELECT *` statements.
|
|
9
|
+
- Add method to define an action to be called if a `SELECT *` statements is found.
|
|
10
|
+
|
|
1
11
|
### 1.0.1 (2018.12.21)
|
|
2
12
|
|
|
3
13
|
- Fix extension name passed to method Dataset.register_extension.
|
|
@@ -1,27 +1,33 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require
|
|
3
|
+
require 'sequel'
|
|
4
4
|
|
|
5
5
|
module Sequel
|
|
6
6
|
module Extensions
|
|
7
7
|
module AsteriskHunter
|
|
8
|
-
|
|
8
|
+
class << self
|
|
9
|
+
attr_accessor :action
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
def define_action(user_action)
|
|
12
|
+
raise TypeError, 'Action parameter must be a callable object!' unless user_action.respond_to?(:call)
|
|
13
|
+
AsteriskHunter.action = user_action
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
class DefaultAction
|
|
18
|
+
def self.call; end
|
|
19
|
+
def call; end
|
|
13
20
|
end
|
|
14
21
|
|
|
15
|
-
def
|
|
16
|
-
|
|
17
|
-
|
|
22
|
+
def fetch_rows(sql)
|
|
23
|
+
hunt(sql)
|
|
24
|
+
super
|
|
18
25
|
end
|
|
19
26
|
|
|
20
27
|
private
|
|
21
28
|
|
|
22
|
-
def hunt
|
|
23
|
-
|
|
24
|
-
self
|
|
29
|
+
def hunt(sql)
|
|
30
|
+
AsteriskHunter.action&.call || AsteriskHunter::DefaultAction if sql.include?('SELECT *')
|
|
25
31
|
end
|
|
26
32
|
end
|
|
27
33
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sequel-asterisk-hunter
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Danilo Barion Nogueira
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-12-
|
|
11
|
+
date: 2018-12-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: sequel
|