mysql2_query_filter-plugin-log 0.0.1

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
+ SHA1:
3
+ metadata.gz: 6398fdbbff56786cf4ee69cb78c6e6e5d553a3ad
4
+ data.tar.gz: 75d7a9ad0ca3e2bae7050aeace1386c53c42e0ab
5
+ SHA512:
6
+ metadata.gz: 3467143df7ef8b5808a1dcc8e4bd226448cbe3b5f970e0c5e0e5731eb4572d5f08cbc54283c5e7cf28a1662c824541225f222b85930851960e5a2b41cda30c50
7
+ data.tar.gz: 23fcbd69c45642faeafa7d406fc4d58fa416ad2a59148c2590e6f97fca4bd191a591a73f0e5645f8d23ad8de1f0381d80ed3f7435ee1d3eaa3f19e6621f28240
data/.gitignore ADDED
@@ -0,0 +1,15 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
15
+ test.rb
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in mysql2_query_filter-plugin-log.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Genki Sugawara
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # Mysql2QueryFilter::Plugin::Log
2
+
3
+ Logging plug-in for [Mysql2QueryFilter](https://github.com/winebarrel/mysql2_query_filter).
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'mysql2_query_filter-plugin-log'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install mysql2_query_filter-plugin-log
20
+
21
+ ## Usage
22
+
23
+ ```ruby
24
+ require 'mysql2_query_filter'
25
+
26
+ Mysql2QueryFilter.configure do |filter|
27
+ filter.plugin :log #, out: $stderr
28
+ end
29
+
30
+ Mysql2QueryFilter.enable
31
+
32
+ client = Mysql2::Client.new(host: 'localhost', username: 'root')
33
+ client.query('show databases')
34
+ ```
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1,13 @@
1
+ require 'mysql2_query_filter'
2
+ require 'mysql2_query_filter/plugin/log'
3
+
4
+ module Mysql2QueryFilter::Plugin
5
+ class Log < Filter
6
+ Mysql2QueryFilter.register(:log, self)
7
+
8
+ def filter(sql)
9
+ out = @options[:out] || $stderr
10
+ out.puts(sql)
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,20 @@
1
+ # coding: utf-8
2
+ Gem::Specification.new do |spec|
3
+ spec.name = 'mysql2_query_filter-plugin-log'
4
+ spec.version = '0.0.1'
5
+ spec.authors = ['Genki Sugawara']
6
+ spec.email = ['sgwr_dts@yahoo.co.jp']
7
+ spec.summary = %q{Logging plug-in for Mysql2QueryFilter.}
8
+ spec.description = %q{Logging plug-in for Mysql2QueryFilter.}
9
+ spec.homepage = 'https://github.com/winebarrel/mysql2_query_filter-plugin-log'
10
+ spec.license = 'MIT'
11
+
12
+ spec.files = `git ls-files -z`.split("\x0")
13
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
14
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
15
+ spec.require_paths = ['lib']
16
+
17
+ spec.add_dependency 'mysql2_query_filter'
18
+ spec.add_development_dependency 'bundler'
19
+ spec.add_development_dependency 'rake'
20
+ end
metadata ADDED
@@ -0,0 +1,93 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mysql2_query_filter-plugin-log
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Genki Sugawara
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-05-09 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: mysql2_query_filter
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Logging plug-in for Mysql2QueryFilter.
56
+ email:
57
+ - sgwr_dts@yahoo.co.jp
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - .gitignore
63
+ - Gemfile
64
+ - LICENSE.txt
65
+ - README.md
66
+ - Rakefile
67
+ - lib/mysql2_query_filter/plugin/log.rb
68
+ - mysql2_query_filter-plugin-log.gemspec
69
+ homepage: https://github.com/winebarrel/mysql2_query_filter-plugin-log
70
+ licenses:
71
+ - MIT
72
+ metadata: {}
73
+ post_install_message:
74
+ rdoc_options: []
75
+ require_paths:
76
+ - lib
77
+ required_ruby_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - '>='
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ required_rubygems_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - '>='
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ requirements: []
88
+ rubyforge_project:
89
+ rubygems_version: 2.0.14
90
+ signing_key:
91
+ specification_version: 4
92
+ summary: Logging plug-in for Mysql2QueryFilter.
93
+ test_files: []