gratan 0.1.0 → 0.1.1

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: 1a970e74897bbcae2cf33d36cecf6b94950b7a55
4
- data.tar.gz: fd04cfd92a0f5fa94c98aca24fc592dc53fc38ac
3
+ metadata.gz: 2f74773279bebd1c013413614ec67f0be35247e6
4
+ data.tar.gz: 01bd667f93ebeb899f36c218a1cccb3a97afca58
5
5
  SHA512:
6
- metadata.gz: 9b5b1868f6322b38a90bc7fb771f947e090c60d9a63c6519ec5a9e66e4e07f832b495200b00091ef366949524e16bbf207251c9a21794dde729ca1104d5816fc
7
- data.tar.gz: 621bf66ba1e3709a247b23bc648029b858f8be33c5e278763c91dda34274c68fe4959638e3cfdcb85c5625a378a4530d3bcc7ec2b2a8e4f97a807f835e3c83f6
6
+ metadata.gz: 567d0a8d2471d18886f0dadd0ad98504aeb03d4baf489f80e7a6ffb109aaa649f4d6bb2adbf7406877f3136bd21887270b6ba9a571b66c1820a3ddb061562fed
7
+ data.tar.gz: 268445b890c90fafe7fd3650686723f1ed81df7c5847f0cb36d8e2cd98c3ae2a88c04b79f4a849ae06faffd94424ef7e6584b66b8924647c3149d841daa325fe
data/README.md CHANGED
@@ -71,16 +71,17 @@ user "scott", "%" do
71
71
 
72
72
  on "test.*" do
73
73
  grant "SELECT"
74
+ grant "INSERT"
74
75
  end
75
76
  end
76
77
 
77
78
  user "scott", "localhost", expired: '2014/10/10' do
78
- on "*.*" do
79
- grant "USAGE"
80
- end
81
-
82
- on "test.*" do
83
- grant "SELECT"
79
+ on "*.*", with: 'GRANT OPTION' do
80
+ grant "ALL PRIVILEGES"
84
81
  end
85
82
  end
86
83
  ```
84
+
85
+ ## What does "Gratan" mean?
86
+
87
+ [![](http://i.gyazo.com/c37d934ba0a61f760603ce4c56401e60.png)](https://www.google.co.jp/search?q=gratin&tbm=isch)
@@ -195,6 +195,7 @@ class Gratan::Client
195
195
  updated = false
196
196
 
197
197
  begin
198
+ @driver.disable_log_bin_local
198
199
  @updated = false
199
200
  yield
200
201
  updated = @updated
@@ -7,13 +7,13 @@ class Gratan::Driver
7
7
  end
8
8
 
9
9
  def each_user
10
- read('SELECT user, host FROM mysql.user').each do |row|
10
+ query('SELECT user, host FROM mysql.user').each do |row|
11
11
  yield(row['user'], row['host'])
12
12
  end
13
13
  end
14
14
 
15
15
  def show_grants(user, host)
16
- read("SHOW GRANTS FOR #{quote_user(user, host)}").each do |row|
16
+ query("SHOW GRANTS FOR #{quote_user(user, host)}").each do |row|
17
17
  yield(row.values.first)
18
18
  end
19
19
  end
@@ -125,9 +125,13 @@ class Gratan::Driver
125
125
  end
126
126
  end
127
127
 
128
+ def disable_log_bin_local
129
+ query('SET SQL_LOG_BIN = 0')
130
+ end
131
+
128
132
  private
129
133
 
130
- def read(sql)
134
+ def query(sql)
131
135
  log(:debug, sql)
132
136
  @client.query(sql)
133
137
  end
@@ -1,3 +1,3 @@
1
1
  module Gratan
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
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.1.0
4
+ version: 0.1.1
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-05 00:00:00.000000000 Z
11
+ date: 2014-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mysql2
@@ -177,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
177
177
  version: '0'
178
178
  requirements: []
179
179
  rubyforge_project:
180
- rubygems_version: 2.4.1
180
+ rubygems_version: 2.0.14
181
181
  signing_key:
182
182
  specification_version: 4
183
183
  summary: Gratan is a tool to manage MySQL permissions using Ruby DSL.