sequel-asterisk-hunter 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 4bad7485ec1b6b176301338382a6c00486f16d9fed57119347bcb8cc0c54adcc
4
+ data.tar.gz: d6e2f7fb265e2c0ab50e28b3c22f0efe4197da92be083d4d37b844035cbfc626
5
+ SHA512:
6
+ metadata.gz: 6f866ce8be50dfc6e64d35612ca13d2d88a8e9a070d1c4d4fff500c7371d55b3b125248cddde858000108411adc285188d39f663b9213c08c0e7cd02556d0851
7
+ data.tar.gz: 13ea915608b82db75f6b4ad103cd77c1f2f9ae6f74ff2af4523360b691bd1a6b6ab20284b9db170bd7e93a10c6c74426bca47275d3fa394b57e1a06b3de64d00
data/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ ### 1.0.0 (2018.12.21)
2
+
3
+ * Initial commit
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2018 Danilo Barion Nogueira
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,51 @@
1
+ # SequelAsteriskHunter
2
+
3
+ This extension adds the `Sequel::Dataset#hunt` method, which...
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'sequel-asterisk-hunter'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install sequel-asterisk-hunter
18
+
19
+ The plugin needs to be initialized by the Sequel extension interface. The simplest way to configure plugin globally is adding this line to the initializer:
20
+
21
+ ```ruby
22
+ Sequel.extension :hunt
23
+ ```
24
+ or
25
+ ```ruby
26
+ Sequel::Database.extension :hunt
27
+ ```
28
+
29
+ But anyway I recommend reading more about [Sequel extensions system](https://github.com/jeremyevans/sequel/blob/master/doc/extensions.rdoc#sequel-extensions).
30
+
31
+ ## Usage
32
+
33
+ ```ruby
34
+ dataset.hunt
35
+ ```
36
+
37
+ ## Usage examples
38
+
39
+ ### Hunting 'SELECT * ...'
40
+ ```ruby
41
+ DB[:my_table].hunt
42
+ #=> #<Sequel::YourAdapter::Dataset: "SELECT * FROM \"my_table\"">
43
+ ```
44
+
45
+ ## Contributing
46
+
47
+ 1. Fork it
48
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
49
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
50
+ 4. Push to the branch (`git push origin my-new-feature`)
51
+ 5. Create new Pull Request
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "sequel/extensions/asterisk_hunter"
4
+ require "sequel-asterisk-hunter/version"
5
+
6
+ module SequelAsteriskHunter
7
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SequelAsteriskHunter
4
+ VERSION = "1.0.0"
5
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "sequel"
4
+
5
+ module Sequel
6
+ module Extensions
7
+ module AsteriskHunter
8
+ def hunt(action: :log)
9
+ return 'Find it!' if self.inspect.include?('SELECT *')
10
+ self
11
+ end
12
+ end
13
+ end
14
+
15
+ Dataset.register_extension(:hunt, Extensions::AsteriskHunter)
16
+ end
metadata ADDED
@@ -0,0 +1,65 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sequel-asterisk-hunter
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Danilo Barion Nogueira
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-12-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: sequel
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 3.48.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 3.48.0
27
+ description: The Sequel extension which allow you to find all your 'SELECT * FROM
28
+ ...' queries.
29
+ email: danilo.barion@gmail.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - CHANGELOG.md
35
+ - LICENSE
36
+ - README.md
37
+ - lib/sequel-asterisk-hunter.rb
38
+ - lib/sequel-asterisk-hunter/version.rb
39
+ - lib/sequel/extensions/asterisk_hunter.rb
40
+ homepage: https://github.com/danilobarion1986/sequel-asterisk-hunter
41
+ licenses:
42
+ - MIT
43
+ metadata: {}
44
+ post_install_message:
45
+ rdoc_options: []
46
+ require_paths:
47
+ - lib
48
+ required_ruby_version: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: '0'
53
+ required_rubygems_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
58
+ requirements: []
59
+ rubyforge_project:
60
+ rubygems_version: 2.7.6
61
+ signing_key:
62
+ specification_version: 4
63
+ summary: The Sequel extension which allow you to find all your 'SELECT * FROM ...'
64
+ queries.
65
+ test_files: []