querybuilder 1.2.2 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,8 @@
1
+ == 1.2.3 2013-11-04
2
+
3
+ * Major enhancement
4
+ * Fixed ruby dynamic string escaping.
5
+
1
6
  == 1.2.2 2013-05-07
2
7
 
3
8
  * Major enhancement
@@ -1,3 +1,3 @@
1
1
  module QueryBuilder
2
- VERSION = '1.2.2'
2
+ VERSION = '1.2.3'
3
3
  end
@@ -495,15 +495,13 @@ module QueryBuilder
495
495
  content.first == :or ? process(content) : "(#{process(content)})"
496
496
  end
497
497
 
498
- def process_string(string)
499
- quote(string)
500
- end
501
-
502
498
  def process_dstring(string)
503
499
  raise QueryBuilder::SyntaxError.new("Cannot parse rubyless (missing binding context).") unless helper = @rubyless_helper
504
500
  res = RubyLess.translate_string(helper, string)
505
501
  res.literal ? quote(res.literal) : insert_bind(res)
506
502
  end
503
+
504
+ alias process_string process_dstring
507
505
 
508
506
  def process_rubyless(string)
509
507
  # compile RubyLess...
@@ -697,7 +695,7 @@ module QueryBuilder
697
695
 
698
696
  def change_processor(processor, opts = {})
699
697
  if @this
700
- @this.change_processor(processor)
698
+ @this.change_processor(processor, opts)
701
699
  else
702
700
  if processor.kind_of?(String)
703
701
  processor = QueryBuilder.resolve_const(processor)
@@ -706,7 +704,7 @@ module QueryBuilder
706
704
  if processor.kind_of?(Processor)
707
705
  # instance of processor
708
706
  elsif processor <= Processor
709
- processor = processor.new(this, opts)
707
+ processor = processor.new(this, {:rubyless_helper => @rubyless_helper}.merge(opts))
710
708
  else
711
709
  raise QueryBuilder::SyntaxError.new("Cannot use #{processor} as Query compiler (not a QueryBuilder::Processor).")
712
710
  end
@@ -714,6 +712,7 @@ module QueryBuilder
714
712
  @query.processor_class = processor.class
715
713
  @query.main_class = processor.resolve_main_class(processor.class.main_class)
716
714
  update_processor(processor)
715
+
717
716
  end
718
717
  end
719
718
 
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{querybuilder}
8
- s.version = "1.2.2"
8
+ s.version = "1.2.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Gaspard Bucher"]
12
- s.date = %q{2013-05-07}
12
+ s.date = %q{2013-11-04}
13
13
  s.description = %q{QueryBuilder is an interpreter for the "pseudo sql" language. This language
14
14
  can be used for two purposes:
15
15
 
@@ -180,6 +180,9 @@ filter_quote_string:
180
180
  src: "objects where name = \"l'avion\""
181
181
  sql: "SELECT objects.* FROM objects WHERE objects.name = 'l''avion' AND objects.parent_id = 123"
182
182
 
183
+ filter_quote_ruby_in_string:
184
+ src: "objects where name = '#{hop}'"
185
+ res: "/unknown method 'hop/"
183
186
 
184
187
  field_with_digits:
185
188
  src: "objects where idx_foo1 is not null"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: querybuilder
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 2
10
- version: 1.2.2
9
+ - 3
10
+ version: 1.2.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Gaspard Bucher
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-05-07 00:00:00 +02:00
18
+ date: 2013-11-04 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency