lynx 0.1.0 → 0.2.0
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.
Potentially problematic release.
This version of lynx might be problematic. Click here for more details.
data/lib/lynx/command/basic.rb
CHANGED
@@ -31,7 +31,7 @@ module Lynx
|
|
31
31
|
|
32
32
|
instruct(:mysql){ |c| c.config.mysql }
|
33
33
|
instruct(:dump){ |c| c.config.dump }
|
34
|
-
instruct(:with_database){ |c| c.config.database }
|
34
|
+
instruct(:with_database){ |c| "--database=#{c.config.database}" }
|
35
35
|
instruct(:sql){ |c, sql| "--execute='#{sql}'" }
|
36
36
|
instruct(:batch){ '--batch' }
|
37
37
|
instruct(:no_names){ '--skip-column-names' }
|
data/lib/lynx/command/dump.rb
CHANGED
@@ -6,25 +6,29 @@ module Lynx
|
|
6
6
|
def initialize(*args)
|
7
7
|
super(*args)
|
8
8
|
|
9
|
+
@database = '--all-databases'
|
10
|
+
@tables = []
|
11
|
+
|
9
12
|
dump
|
10
13
|
end
|
11
14
|
|
12
15
|
instruct(:where){ |c,condition| "--where='#{condition}'" }
|
13
|
-
instruct(:with_database){ |c| c.database(c.config.database) }
|
14
16
|
|
15
|
-
def
|
16
|
-
@
|
17
|
-
@command += args
|
17
|
+
def with_database
|
18
|
+
@database = @config.database
|
18
19
|
|
19
20
|
self
|
20
21
|
end
|
21
22
|
|
22
23
|
def table(*args)
|
23
|
-
@
|
24
|
-
@command += args
|
24
|
+
@tables += args
|
25
25
|
|
26
26
|
self
|
27
27
|
end
|
28
|
+
|
29
|
+
def to_s
|
30
|
+
"#{super} #{@database} #{@tables.join(' ')}"
|
31
|
+
end
|
28
32
|
end
|
29
33
|
end
|
30
34
|
end
|
data/lib/lynx/version.rb
CHANGED
@@ -8,13 +8,10 @@ describe Lynx::Command::Dump do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def test_command
|
11
|
+
@command.with_database
|
11
12
|
@command.table('bar')
|
12
13
|
@command.where('1=1')
|
13
14
|
|
14
|
-
assert_equal "dump --
|
15
|
-
end
|
16
|
-
|
17
|
-
def test_with_database
|
18
|
-
assert_equal "dump --databases foo", @command.with_database.to_s
|
15
|
+
assert_equal "dump --where='1=1' foo bar", @command.to_s
|
19
16
|
end
|
20
17
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lynx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: minitest
|