volt-sql 0.0.6 → 0.0.7

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: 82dea3aed38d6078f85ccc292664f511572be317
4
- data.tar.gz: b3e2b71cc9a99dbf06ad0f971f32343e9c5ca9f6
3
+ metadata.gz: 2b564160eb35803e0fd439ca196552b93461d38d
4
+ data.tar.gz: 8f1f276a51235141e58d53f761e6d068a0cf63d0
5
5
  SHA512:
6
- metadata.gz: 05ffe93c5d5ecda9485abdda02bac1fa7328894245646d79f22a105434b0ce96ce23aec29bf0f04b51d9c9c764ad009159716f1c8f60446b3e783142b0972912
7
- data.tar.gz: faf9bb952d7634b4a6e93973a99eb2c1f752a0f1045b7e21553ce93222b5110553ea741cad9564386a5c9035f0bfaa9509ce23f2a0eb38c9f73b7d7572d21f8f
6
+ metadata.gz: 815a358dc61816bbe049af19ea637e1e71ad891c0116fdcd83fefdbdc4b5fc8bba5dd02b47308d6aafda637f058b189eda30ad81d58afdabeef6b1cfd26357de
7
+ data.tar.gz: fa56cc573f964dc9f61d9425de233ef6b3c43fb5a3e52f1b543a1534b68b3037e271b5b3156d46944f77ed8aabba745b4887a192a888f6d0674e6956d077092e
@@ -281,7 +281,7 @@ module Volt
281
281
  # the query that was captured on the client with QueryIdentifier
282
282
 
283
283
  # Grab the AST that was generated from the block call on the client.
284
- block_ast = args.pop
284
+ block_ast, args = args[-1], args[0..-2]
285
285
  args = self.class.move_to_db_types(args)
286
286
 
287
287
  result = result.where(*args) do |ident|
@@ -316,7 +316,7 @@ module Volt
316
316
  end#.tap {|v| puts "QUERY: " + v.inspect }
317
317
 
318
318
  # Unpack extra values
319
- result = unpack_values!(result)
319
+ result = unpack_values(result)
320
320
  end
321
321
 
322
322
  result
@@ -406,7 +406,7 @@ module Volt
406
406
  # Unpacking means moving the extra field out and into the main fields.
407
407
  #
408
408
  # Then transform Time to VoltTime
409
- def unpack_values!(inputs)
409
+ def unpack_values(inputs)
410
410
  values = inputs.each do |values|
411
411
  extra = values.delete(:extra)
412
412
 
@@ -430,7 +430,6 @@ module Volt
430
430
 
431
431
  values
432
432
  end
433
-
434
433
  end
435
434
 
436
435
 
@@ -19,7 +19,7 @@ module Volt
19
19
 
20
20
  def walk(ast)
21
21
  if ast.is_a?(Array) && !ast.is_a?(Sequel::SQL::Identifier)
22
- op = ast.shift
22
+ op, ast = ast[0], ast[1..-1]
23
23
 
24
24
  case op
25
25
  when 'c'
@@ -27,6 +27,8 @@ module Volt
27
27
  when 'a'
28
28
  # We popped off the 'a', so we just return the array
29
29
  return ast
30
+ when 'r'
31
+ return Regexp.new(ast.first)
30
32
  else
31
33
  raise "invalid op: #{op.inspect} - #{ast.inspect} - #{ast.is_a?(Array).inspect}"
32
34
  end
@@ -1,5 +1,5 @@
1
1
  module Volt
2
2
  module Sql
3
- VERSION = '0.0.6'
3
+ VERSION = '0.0.7'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: volt-sql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Stout
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-07 00:00:00.000000000 Z
11
+ date: 2015-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sequel