hotdog 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hotdog/commands/pssh.rb +1 -4
- data/lib/hotdog/commands/search.rb +12 -10
- data/lib/hotdog/commands/ssh.rb +2 -2
- data/lib/hotdog/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 620323cd9db295c0d65d974f1161550aa8f3f5e0
|
4
|
+
data.tar.gz: 6ea419f4716a1b4672d4576e25185eeb54586f05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3d6b14d0ba95834736734681fcdc40df1b5579b05818fd6324eacb2c8655771d6a5516a71e317f56fca6aa83b2920be0e1ad082308506a0515a98b274b8d32e
|
7
|
+
data.tar.gz: b2e2a01aa4dbdaf7095504c1ce3be093d8d1ef4ea70629f1118b301464040058ac51d74d5e7a201b91719d560b6fdf536f652fdf7fd8ffb809896679d17acd4f
|
data/lib/hotdog/commands/pssh.rb
CHANGED
@@ -89,16 +89,13 @@ module Hotdog
|
|
89
89
|
else
|
90
90
|
header = name
|
91
91
|
end
|
92
|
-
|
93
92
|
c = cmdline.dup
|
94
93
|
if user
|
95
94
|
c << (user + "@" + address)
|
96
95
|
else
|
97
96
|
c << address
|
98
97
|
end
|
99
|
-
|
100
|
-
c.concat(args)
|
101
|
-
|
98
|
+
logger.debug("execute: #{Shellwords.join(c)}")
|
102
99
|
IO.popen([*c, in: :close, err: [:child, :out]]) do |io|
|
103
100
|
io.each_line do |line|
|
104
101
|
STDOUT.write "#{header}: #{line}"
|
@@ -622,15 +622,17 @@ module Hotdog
|
|
622
622
|
case @op
|
623
623
|
when :OR
|
624
624
|
if expressions.all? { |expression| TagExpressionNode === expression }
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
625
|
+
values = expressions.group_by { |expression| expression.class }.values.flat_map { |expressions|
|
626
|
+
if query_without_condition = expressions.first.maybe_query_without_condition(options)
|
627
|
+
condition_length = expressions.first.condition_values(options).length
|
628
|
+
expressions.each_slice(SQLITE_LIMIT_COMPOUND_SELECT / condition_length).flat_map { |expressions|
|
629
|
+
q = query_without_condition.sub(/\s*;\s*\z/, "") + " WHERE " + expressions.map { |expression| "( %s )" % expression.condition(options) }.join(" OR ") + ";"
|
630
|
+
environment.execute(q, expressions.flat_map { |expression| expression.condition_values(options) }).map { |row| row.first }
|
631
|
+
}
|
632
|
+
else
|
633
|
+
[]
|
634
|
+
end
|
635
|
+
}
|
634
636
|
else
|
635
637
|
values = []
|
636
638
|
end
|
@@ -648,7 +650,7 @@ module Hotdog
|
|
648
650
|
end
|
649
651
|
end
|
650
652
|
|
651
|
-
def dump(
|
653
|
+
def dump(options={})
|
652
654
|
{multinary_op: @op.to_s, expressions: expressions.map { |expression| expression.dump(options) }}
|
653
655
|
end
|
654
656
|
|
data/lib/hotdog/commands/ssh.rb
CHANGED
@@ -43,6 +43,7 @@ module Hotdog
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def parse_options(optparse, args=[])
|
46
|
+
optparse.order(args)
|
46
47
|
end
|
47
48
|
|
48
49
|
def run(args=[])
|
@@ -106,8 +107,7 @@ module Hotdog
|
|
106
107
|
else
|
107
108
|
cmdline << address
|
108
109
|
end
|
109
|
-
|
110
|
-
|
110
|
+
logger.debug("execute: #{Shellwords.join(cmdline)}")
|
111
111
|
exec(*cmdline)
|
112
112
|
exit(127)
|
113
113
|
end
|
data/lib/hotdog/version.rb
CHANGED