hotdog 0.5.1 → 0.5.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0e018bd515522f3f7d9b0406076de76e413775e2
4
- data.tar.gz: c5500bd55b75ebe3911ed3c4ab7edb224f9385c8
3
+ metadata.gz: 620323cd9db295c0d65d974f1161550aa8f3f5e0
4
+ data.tar.gz: 6ea419f4716a1b4672d4576e25185eeb54586f05
5
5
  SHA512:
6
- metadata.gz: 10840357532b1e1df159a154b39a9791392bc1ddee1bb63267fd9322e4afa17b5e07ac48278d5e3f5246905aa14368227644674f18985b0cbfeec26742efa452
7
- data.tar.gz: 98d740416958f1b36993faad3804ca0c1a542c15d7c5f4db829e0adce60c1f1295bfa4d04a7a00bd0bb1f88f5248a2c5edce58db1a3157c651fe256a673ecc57
6
+ metadata.gz: b3d6b14d0ba95834736734681fcdc40df1b5579b05818fd6324eacb2c8655771d6a5516a71e317f56fca6aa83b2920be0e1ad082308506a0515a98b274b8d32e
7
+ data.tar.gz: b2e2a01aa4dbdaf7095504c1ce3be093d8d1ef4ea70629f1118b301464040058ac51d74d5e7a201b91719d560b6fdf536f652fdf7fd8ffb809896679d17acd4f
@@ -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
- if query_without_condition = expressions.first.maybe_query_without_condition(options)
626
- q = query_without_condition.sub(/\s*;\s*\z/, "") + " WHERE " + expressions.map { |expression| "( %s )" % expression.condition(options) }.join(" OR ") + ";"
627
- condition_length = expressions.first.condition_values(options).length
628
- values = expressions.each_slice(SQLITE_LIMIT_COMPOUND_SELECT / condition_length).flat_map { |expressions|
629
- environment.execute(q, expressions.flat_map { |expression| expression.condition_values(options) }).map { |row| row.first }
630
- }
631
- else
632
- values = []
633
- end
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(optinos={})
653
+ def dump(options={})
652
654
  {multinary_op: @op.to_s, expressions: expressions.map { |expression| expression.dump(options) }}
653
655
  end
654
656
 
@@ -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
- cmdline.concat(args)
110
-
110
+ logger.debug("execute: #{Shellwords.join(cmdline)}")
111
111
  exec(*cmdline)
112
112
  exit(127)
113
113
  end
@@ -1,3 +1,3 @@
1
1
  module Hotdog
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hotdog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yamashita Yuu