sequel-asterisk-hunter 1.1.0 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -1
- data/README.md +5 -2
- data/lib/sequel-asterisk-hunter.rb +3 -2
- data/lib/sequel-asterisk-hunter/version.rb +1 -1
- data/lib/sequel/extensions/asterisk_hunter.rb +15 -10
- metadata +20 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 922eebbef5ff98f739ce7edde64c3879ede0fcba187cc47065f1c5a814f87249
|
4
|
+
data.tar.gz: c9109cf92d601d12c201f8ea85df1e80d7042d7b7cd0d83d89b29264693b7ace
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 764faec3afd9ae1ab06ed3144dd00d348ec3ac62fe00fa28b329b7a44a1cbb702fff8c59a5dbf65e3e641f65bc4d1acd4d40177966d1a498a0ffe872d4f6de30
|
7
|
+
data.tar.gz: d942d7690c111b61c7211df051641d6cfdc34b30d5b5e9747642a42156661b96be651cdc5ee315e77e6c447d774d777571324627e461ff0801f5e02b24eaf3b4
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,21 @@
|
|
1
|
+
### 1.3.1 (2020.03.24)
|
2
|
+
|
3
|
+
- Fix rake [security issue](https://github.com/advisories/GHSA-jppv-gw3r-w3q8).
|
4
|
+
|
5
|
+
### 1.2.0 (2018.12.26)
|
6
|
+
|
7
|
+
- Change overriden method from `Sequel::Dataset#all` to `Sequel::Dataset#fetch_rows`, to hunt `SELECT *` statements for any query executed.
|
8
|
+
- Refactorings.
|
9
|
+
|
10
|
+
### 1.1.0 (2018.12.22)
|
11
|
+
|
12
|
+
- Override Sequel::Dataset#all to find for `SELECT *` statements.
|
13
|
+
- Add method to define an action to be called if a `SELECT *` statements is found.
|
14
|
+
|
1
15
|
### 1.0.1 (2018.12.21)
|
2
16
|
|
3
17
|
- Fix extension name passed to method Dataset.register_extension.
|
4
18
|
|
5
19
|
### 1.0.0 (2018.12.21)
|
6
20
|
|
7
|
-
|
21
|
+
- Initial commit.
|
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# SequelAsteriskHunter
|
2
2
|
|
3
|
-
|
3
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/45c9c0861e32902a4b0a/maintainability)](https://codeclimate.com/github/danilobarion1986/sequel-asterisk-hunter/maintainability)
|
4
|
+
|
5
|
+
This extension hooks into `Sequel::Dataset#fetch_rows` method, doing some predefined action when an `SELECT *` statement is found.
|
4
6
|
|
5
7
|
## Installation
|
6
8
|
|
@@ -18,7 +20,8 @@ Or install it yourself as:
|
|
18
20
|
|
19
21
|
## Usage
|
20
22
|
|
21
|
-
The extension needs to be initialized by the Sequel extension interface.
|
23
|
+
The extension needs to be initialized by the Sequel extension interface.
|
24
|
+
The simplest way to configure it globally is by adding this line to the initializer:
|
22
25
|
|
23
26
|
```ruby
|
24
27
|
Sequel.extension :asterisk_hunter
|
@@ -1,27 +1,32 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require 'sequel'
|
4
4
|
|
5
|
+
# no-doc
|
5
6
|
module Sequel
|
7
|
+
# no-doc
|
6
8
|
module Extensions
|
9
|
+
# no-doc
|
7
10
|
module AsteriskHunter
|
8
|
-
|
11
|
+
class << self
|
12
|
+
attr_accessor :action
|
9
13
|
|
10
|
-
|
11
|
-
|
12
|
-
|
14
|
+
def define_action(user_action)
|
15
|
+
raise TypeError, 'Action parameter must be a callable object!' unless user_action.respond_to?(:call)
|
16
|
+
|
17
|
+
AsteriskHunter.action = user_action
|
18
|
+
end
|
13
19
|
end
|
14
20
|
|
15
|
-
def
|
16
|
-
|
17
|
-
|
21
|
+
def fetch_rows(sql)
|
22
|
+
hunt
|
23
|
+
super
|
18
24
|
end
|
19
25
|
|
20
26
|
private
|
21
27
|
|
22
28
|
def hunt
|
23
|
-
|
24
|
-
self
|
29
|
+
AsteriskHunter.action&.call if sql.include?('SELECT *')
|
25
30
|
end
|
26
31
|
end
|
27
32
|
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.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danilo Barion Nogueira
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sequel
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '5.10'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rubocop
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.63.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.63.0
|
27
41
|
description: This extension hooks into `Sequel::Dataset#all` method, doing some predefined
|
28
42
|
action when an `SELECT *` statement is found.
|
29
43
|
email: danilo.barion@gmail.com
|
@@ -41,7 +55,7 @@ homepage: https://github.com/danilobarion1986/sequel-asterisk-hunter
|
|
41
55
|
licenses:
|
42
56
|
- MIT
|
43
57
|
metadata: {}
|
44
|
-
post_install_message:
|
58
|
+
post_install_message:
|
45
59
|
rdoc_options: []
|
46
60
|
require_paths:
|
47
61
|
- lib
|
@@ -56,9 +70,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
56
70
|
- !ruby/object:Gem::Version
|
57
71
|
version: '0'
|
58
72
|
requirements: []
|
59
|
-
|
60
|
-
|
61
|
-
signing_key:
|
73
|
+
rubygems_version: 3.0.3
|
74
|
+
signing_key:
|
62
75
|
specification_version: 4
|
63
76
|
summary: Sequel extension which allow you to do some action when find any 'SELECT
|
64
77
|
*' queries.
|