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 +4 -4
- data/README.md +7 -6
- data/lib/gratan/client.rb +1 -0
- data/lib/gratan/driver.rb +7 -3
- data/lib/gratan/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f74773279bebd1c013413614ec67f0be35247e6
|
4
|
+
data.tar.gz: 01bd667f93ebeb899f36c218a1cccb3a97afca58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 "
|
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)
|
data/lib/gratan/client.rb
CHANGED
data/lib/gratan/driver.rb
CHANGED
@@ -7,13 +7,13 @@ class Gratan::Driver
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def each_user
|
10
|
-
|
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
|
-
|
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
|
134
|
+
def query(sql)
|
131
135
|
log(:debug, sql)
|
132
136
|
@client.query(sql)
|
133
137
|
end
|
data/lib/gratan/version.rb
CHANGED
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.
|
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-
|
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.
|
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.
|