gratan 0.3.1 → 0.3.2

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: d8880a61459d0f5dec955a97b90f921b374b23476c01913a65986956abcdbe1d
4
- data.tar.gz: 18e91a08edd239e935d5c2f689b9245d9ce1c974e17b9ab398292d778ffec121
3
+ metadata.gz: aec8e580145f0a156029a046eadf67c7ef3e944a6713563057aeb7541707069e
4
+ data.tar.gz: 49a303e016bb7ff1d8f2217a3e6bb5e39158f543afecf39d261b3c7b62b512c4
5
5
  SHA512:
6
- metadata.gz: 223c54af48a4cb382f786dbacd996c1c1764e25f5ba98bc02603caa82df32c94d0cbfa316d7765cf1d4763d9bc7d3bfaf9da3e118ed139d0ef375738046e07fc
7
- data.tar.gz: 0e09f5a45012efbe908daae140e8f2a200254bd523b51f5fa3e62a71acd66be8d69dc278a9298a123787663a6ceda3aad41aa1867d918d0eceae536527b6e729
6
+ metadata.gz: 66c0b62746e3102edcb2cfac2e4dfbc9e09faa553135192031519736a90f46d2403d4963444569999cdd67559927593a3560006a98f3b8904a7b7758aee6a2c0
7
+ data.tar.gz: 0e27293d8efca3d6b6fec63a0c84dbd9f349bac00d0b307f0229f7691b49205703fc476b39a97d3546317d13454c8f0fcccda92bc7f5e977d027c3faf22ca292
data/bin/gratan CHANGED
@@ -35,33 +35,34 @@ options = {
35
35
 
36
36
  ARGV.options do |opt|
37
37
  begin
38
- opt.on('' , '--host HOST') {|v| mysql_options[:host] = v }
39
- opt.on('' , '--port PORT', Integer) {|v| mysql_options[:port] = v }
40
- opt.on('' , '--socket SOCKET') {|v| mysql_options[:socket] = v }
41
- opt.on('' , '--username USERNAME') {|v| mysql_options[:username] = v }
42
- opt.on('' , '--password PASSWORD') {|v| mysql_options[:password] = v }
43
- opt.on('' , '--database DATABASE') {|v| mysql_options[:database] = v }
44
- opt.on('-a', '--apply') { mode = :apply }
45
- opt.on('-f', '--file FILE') {|v| file = v }
46
- opt.on('' , '--dry-run') { options[:dry_run] = true }
47
- opt.on('-e', '--export') { mode = :export }
48
- opt.on('' , '--with-identifier') { options[:with_identifier] = true }
49
- opt.on('' , '--split') { split = true }
50
- opt.on('' , '--chunk-by-user') { options[:chunk_by_user] = true }
51
- opt.on('-o', '--output FILE') {|v| output_file = v }
52
- opt.on('' , '--ignore-user REGEXP') {|v| options[:ignore_user] = Regexp.new(v) }
53
- opt.on('' , '--target-user REGEXP') {|v| options[:target_user] = Regexp.new(v) }
54
- opt.on('' , '--ignore-object REGEXP') {|v| options[:ignore_object] = Regexp.new(v) }
55
- opt.on('' , '--enable-expired') { options[:enable_expired] = true }
56
- opt.on('' , '--ignore-not-exist') {|v| options[:ignore_not_exist] = true }
57
- opt.on('' , '--ignore-password-secret') {|v| options[:ignore_password_secret] = true }
58
- opt.on('' , '--skip-disable-log-bin') { options[:skip_disable_log_bin] = true }
59
- opt.on('' , '--override-sql-mode') { options[:override_sql_mode] = true }
60
- opt.on('' , '--use-show-create-user') { options[:use_show_create_user] = true }
61
- opt.on('' , '--no-color') { options[:color] = false }
62
- opt.on('' , '--debug') { options[:debug] = true }
63
- opt.on('' , '--auto-identify OUTPUT') {|v| options[:identifier] = Gratan::Identifier::Auto.new(v, options) }
64
- opt.on('' , '--csv-identify CSV') {|v| options[:identifier] = Gratan::Identifier::CSV.new(v, options) }
38
+ opt.on('' , '--host HOST') {|v| mysql_options[:host] = v }
39
+ opt.on('' , '--port PORT', Integer) {|v| mysql_options[:port] = v }
40
+ opt.on('' , '--socket SOCKET') {|v| mysql_options[:socket] = v }
41
+ opt.on('' , '--username USERNAME') {|v| mysql_options[:username] = v }
42
+ opt.on('' , '--password PASSWORD') {|v| mysql_options[:password] = v }
43
+ opt.on('' , '--database DATABASE') {|v| mysql_options[:database] = v }
44
+ opt.on('-a', '--apply') { mode = :apply }
45
+ opt.on('-f', '--file FILE') {|v| file = v }
46
+ opt.on('' , '--dry-run') { options[:dry_run] = true }
47
+ opt.on('-e', '--export') { mode = :export }
48
+ opt.on('' , '--with-identifier') { options[:with_identifier] = true }
49
+ opt.on('' , '--split') { split = true }
50
+ opt.on('' , '--chunk-by-user') { options[:chunk_by_user] = true }
51
+ opt.on('-o', '--output FILE') {|v| output_file = v }
52
+ opt.on('' , '--ignore-user REGEXP') {|v| options[:ignore_user] = Regexp.new(v) }
53
+ opt.on('' , '--target-user REGEXP') {|v| options[:target_user] = Regexp.new(v) }
54
+ opt.on('' , '--ignore-object REGEXP') {|v| options[:ignore_object] = Regexp.new(v) }
55
+ opt.on('' , '--enable-expired') { options[:enable_expired] = true }
56
+ opt.on('' , '--ignore-not-exist') {|v| options[:ignore_not_exist] = true }
57
+ opt.on('' , '--ignore-password-secret') {|v| options[:ignore_password_secret] = true }
58
+ opt.on('' , '--skip-disable-log-bin') { options[:skip_disable_log_bin] = true }
59
+ opt.on('' , '--override-sql-mode') { options[:override_sql_mode] = true }
60
+ opt.on('' , '--use-show-create-user') { options[:use_show_create_user] = true }
61
+ opt.on('' , '--no-color') { options[:color] = false }
62
+ opt.on('' , '--debug') { options[:debug] = true }
63
+ opt.on('' , '--wait-timeout SECOND', Integer) {|v| options[:wait_timeout] = v }
64
+ opt.on('' , '--auto-identify OUTPUT') {|v| options[:identifier] = Gratan::Identifier::Auto.new(v, options) }
65
+ opt.on('' , '--csv-identify CSV') {|v| options[:identifier] = Gratan::Identifier::CSV.new(v, options) }
65
66
 
66
67
  opt.on('' , '--mysql2-options JSON') do |json|
67
68
  json = JSON.parse(json)
@@ -246,6 +246,7 @@ class Gratan::Client
246
246
  begin
247
247
  @driver.disable_log_bin_local
248
248
  @driver.override_sql_mode
249
+ @driver.set_wait_timeout
249
250
  @updated = false
250
251
  yield
251
252
  updated = @updated
@@ -215,6 +215,12 @@ class Gratan::Driver
215
215
  end
216
216
  end
217
217
 
218
+ def set_wait_timeout
219
+ if @options[:wait_timeout]
220
+ query("SET @@wait_timeout = #{@options[:wait_timeout]}")
221
+ end
222
+ end
223
+
218
224
  private
219
225
 
220
226
  def query(sql)
@@ -1,3 +1,3 @@
1
1
  module Gratan
2
- VERSION = '0.3.1'
2
+ VERSION = '0.3.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gratan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-06 00:00:00.000000000 Z
11
+ date: 2019-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mysql2
@@ -209,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
209
209
  version: '0'
210
210
  requirements: []
211
211
  rubyforge_project:
212
- rubygems_version: 2.7.6
212
+ rubygems_version: 2.7.6.2
213
213
  signing_key:
214
214
  specification_version: 4
215
215
  summary: Gratan is a tool to manage MySQL permissions using Ruby DSL.