sequel-asterisk-hunter 1.1.0 → 1.3.3

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
  SHA256:
3
- metadata.gz: 184314bd889776102faf9c036f3bf27971a6c223eb58149a81d4c059dba9abb7
4
- data.tar.gz: f983c5d3722513396327fcb19881a2a3cbb7b155e5c51670ec2a5f359d9dddec
3
+ metadata.gz: 922eebbef5ff98f739ce7edde64c3879ede0fcba187cc47065f1c5a814f87249
4
+ data.tar.gz: c9109cf92d601d12c201f8ea85df1e80d7042d7b7cd0d83d89b29264693b7ace
5
5
  SHA512:
6
- metadata.gz: ad5a7cf4369c55267de29faf95b522fb0b7c337d57c38a1d166dab94898a8660606b151b66c2823e8692c45b8a7f3276ba21509ef7efe46fcd52935d2582acf8
7
- data.tar.gz: 56a829e908a4ae83021d79499af11281ef7b18b6b194d48b36197bb95f321e3ce29bd0de6ce97f4ab51de8862d9a379f62d3bab5859171a715ec4d00aef867ad
6
+ metadata.gz: 764faec3afd9ae1ab06ed3144dd00d348ec3ac62fe00fa28b329b7a44a1cbb702fff8c59a5dbf65e3e641f65bc4d1acd4d40177966d1a498a0ffe872d4f6de30
7
+ data.tar.gz: d942d7690c111b61c7211df051641d6cfdc34b30d5b5e9747642a42156661b96be651cdc5ee315e77e6c447d774d777571324627e461ff0801f5e02b24eaf3b4
@@ -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
- * Initial commit
21
+ - Initial commit.
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # SequelAsteriskHunter
2
2
 
3
- This extension hooks into `Sequel::Dataset#all` method, doing some predefined action when an `SELECT *` statement is found.
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. The simplest way to configure it globally is adding this line to the initializer:
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,7 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "sequel/extensions/asterisk_hunter"
4
- require "sequel-asterisk-hunter/version"
3
+ require 'sequel/extensions/asterisk_hunter'
4
+ require 'sequel-asterisk-hunter/version'
5
5
 
6
+ # no-doc
6
7
  module SequelAsteriskHunter
7
8
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SequelAsteriskHunter
4
- VERSION = "1.1.0"
4
+ VERSION = '1.3.3'
5
5
  end
@@ -1,27 +1,32 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "sequel"
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
- @@action = -> { puts "Find 'SELECT *' in query!" }
11
+ class << self
12
+ attr_accessor :action
9
13
 
10
- def all
11
- hunt
12
- super
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 self.define_action(action)
16
- raise TypeError, 'Action parameter must be a callable object!' unless action.respond_to?(:call)
17
- @@action = action
21
+ def fetch_rows(sql)
22
+ hunt
23
+ super
18
24
  end
19
25
 
20
26
  private
21
27
 
22
28
  def hunt
23
- @@action.call if self.inspect.include?('SELECT *')
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.1.0
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: 2018-12-22 00:00:00.000000000 Z
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
- rubyforge_project:
60
- rubygems_version: 2.7.6
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.