chef-zero 1.5.4 → 1.5.5

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.
@@ -20,6 +20,7 @@ module ChefZero
20
20
  values.any? { |value| !@regexp.match(value).nil? }
21
21
  end
22
22
 
23
+ DEFAULT_FIELD = "text"
23
24
  WORD_CHARACTER = "[A-Za-z0-9@._':]"
24
25
  NON_WORD_CHARACTER = "[^A-Za-z0-9@._':]"
25
26
  end
@@ -49,18 +49,24 @@ module ChefZero
49
49
  @index+=1
50
50
  end
51
51
  @index+=1 if !eof?
52
- end until eof? || @query_string[@index] =~ /\s/ || peek_operator_token
52
+ end while !eof? && peek_term_token
53
53
  @query_string[start_index..@index-1]
54
54
  end
55
55
  end
56
56
 
57
57
  def skip_whitespace
58
58
  if @query_string[@index] =~ /\s/
59
- whitespace = /\s+/.match(@query_string, @index)
59
+ whitespace = /\s+/.match(@query_string, @index) || peek
60
60
  @index += whitespace[0].length
61
61
  end
62
62
  end
63
63
 
64
+ def peek_term_token
65
+ return nil if @query_string[@index] =~ /\s/
66
+ op = peek_operator_token
67
+ return !op || op == '-'
68
+ end
69
+
64
70
  def peek_operator_token
65
71
  if ['"', '+', '-', '!', '(', ')', '{', '}', '[', ']', '^', ':'].include?(@query_string[@index])
66
72
  return @query_string[@index]
@@ -142,7 +148,7 @@ module ChefZero
142
148
  right = next_token
143
149
  parse_error(right, "Expected left term in range query") if !right
144
150
  end_range = next_token
145
- parse_error(right, "Expected end range '#{expected_end_range}") if !['{', '['].include?(end_range)
151
+ parse_error(right, "Expected end range '#{end_range}") if !['}', ']'].include?(end_range)
146
152
  Query::RangeQuery.new(left, right, token == '[', end_range == ']')
147
153
 
148
154
  elsif token == '('
@@ -1,3 +1,3 @@
1
1
  module ChefZero
2
- VERSION = '1.5.4'
2
+ VERSION = '1.5.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.4
4
+ version: 1.5.5
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-07-12 00:00:00.000000000 Z
12
+ date: 2013-08-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: puma
@@ -193,7 +193,8 @@ files:
193
193
  - !binary |-
194
194
  YmluL2NoZWYtemVybw==
195
195
  homepage: http://www.opscode.com
196
- licenses: []
196
+ licenses:
197
+ - Apache 2.0
197
198
  post_install_message:
198
199
  rdoc_options: []
199
200
  require_paths: