gratan 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 594f050aa91a09ebe859fee36bee875f22461540
4
- data.tar.gz: 9fd38fa478da13932a4d5d07621e870d8a51f559
3
+ metadata.gz: a2ffc1ee18a760332c433a587564c73b3500ed99
4
+ data.tar.gz: b382285ace7c48e2baac1c77b6fd1e347555b833
5
5
  SHA512:
6
- metadata.gz: 0e924bbca853d1ba2d5c49523aa508f2cd02ba476e6484734eb1fee5f05b5b91db6442c91046b133f3d9aa80ac25a7045c2a118e46a869e639e877c87f41bbae
7
- data.tar.gz: 0a490b3b1941baa49d2592e6d0acfb54f4a95dbb952f2922c922b123d0a1559855784ef678460533081ab3bf349deec757c6092249d7a72a6d2618f0e8cd8dcd
6
+ metadata.gz: 228587ae809aecae4a334fe5b9d00586815de1298159014564b776c26d900668384558e16d991899a0346a84e8455dd4e6d9472ab0a929fdf9741375e395c3b5
7
+ data.tar.gz: c0463a43066294d3072b7e824de9e8575700666208eb1510651c0d4a2e2432f175c584b6dec9e5e6f741eeca87019017790e89861e573fd1ac9b4c22103b9fa0
@@ -201,14 +201,19 @@ class Gratan::Client
201
201
  @updated = false
202
202
  yield
203
203
  updated = @updated
204
+ @driver.flush_privileges if updated
204
205
  ensure
205
206
  @updated = nil
206
207
  end
207
208
 
208
- updated
209
+ if @options[:dry_run]
210
+ false
211
+ else
212
+ updated
213
+ end
209
214
  end
210
215
 
211
216
  def update!
212
- @updated = true unless @options[:dry_run]
217
+ @updated = true
213
218
  end
214
219
  end
@@ -42,6 +42,10 @@ class Gratan::Driver
42
42
  end
43
43
  end
44
44
 
45
+ def flush_privileges
46
+ update("FLUSH PRIVILEGES")
47
+ end
48
+
45
49
  def create_user(user, host, options = {})
46
50
  objects = options[:objects]
47
51
  grant_options = options[:options]
@@ -1,3 +1,3 @@
1
1
  module Gratan
2
- VERSION = '0.1.6'
2
+ VERSION = '0.1.7'
3
3
  end
@@ -43,6 +43,7 @@ end
43
43
  expect(logger).to receive(:debug).with("[DEBUG] SELECT user, host FROM mysql.user")
44
44
  expect(logger).to receive(:info).with("GRANT SELECT, INSERT, UPDATE, DELETE ON *.* TO 'scott'@'localhost' IDENTIFIED BY 'tiger'")
45
45
  expect(logger).to receive(:info).with("GRANT SELECT, INSERT, UPDATE, DELETE ON `test`.* TO 'scott'@'localhost' IDENTIFIED BY 'tiger'")
46
+ expect(logger).to receive(:info).with("FLUSH PRIVILEGES")
46
47
  logger
47
48
  end
48
49
 
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.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-06 00:00:00.000000000 Z
11
+ date: 2014-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mysql2
@@ -181,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
181
181
  version: '0'
182
182
  requirements: []
183
183
  rubyforge_project:
184
- rubygems_version: 2.4.1
184
+ rubygems_version: 2.0.14
185
185
  signing_key:
186
186
  specification_version: 4
187
187
  summary: Gratan is a tool to manage MySQL permissions using Ruby DSL.