merb-core 0.9.13 → 1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. data/Rakefile +5 -3
  2. data/lib/merb-core.rb +84 -41
  3. data/lib/merb-core/bootloader.rb +71 -60
  4. data/lib/merb-core/config.rb +31 -17
  5. data/lib/merb-core/controller/abstract_controller.rb +35 -35
  6. data/lib/merb-core/controller/exceptions.rb +14 -9
  7. data/lib/merb-core/controller/merb_controller.rb +22 -20
  8. data/lib/merb-core/controller/mime.rb +5 -5
  9. data/lib/merb-core/controller/mixins/authentication.rb +11 -8
  10. data/lib/merb-core/controller/mixins/conditional_get.rb +7 -7
  11. data/lib/merb-core/controller/mixins/controller.rb +15 -15
  12. data/lib/merb-core/controller/mixins/render.rb +16 -16
  13. data/lib/merb-core/controller/mixins/responder.rb +23 -23
  14. data/lib/merb-core/controller/template.rb +17 -17
  15. data/lib/merb-core/core_ext/hash.rb +2 -2
  16. data/lib/merb-core/core_ext/kernel.rb +19 -18
  17. data/lib/merb-core/dispatch/cookies.rb +13 -0
  18. data/lib/merb-core/dispatch/default_exception/default_exception.rb +12 -1
  19. data/lib/merb-core/dispatch/dispatcher.rb +6 -5
  20. data/lib/merb-core/dispatch/request.rb +56 -52
  21. data/lib/merb-core/dispatch/request_parsers.rb +7 -7
  22. data/lib/merb-core/dispatch/router.rb +14 -14
  23. data/lib/merb-core/dispatch/router/behavior.rb +31 -31
  24. data/lib/merb-core/dispatch/router/cached_proc.rb +13 -1
  25. data/lib/merb-core/dispatch/router/resources.rb +9 -9
  26. data/lib/merb-core/dispatch/router/route.rb +60 -7
  27. data/lib/merb-core/dispatch/session.rb +21 -15
  28. data/lib/merb-core/dispatch/session/container.rb +10 -8
  29. data/lib/merb-core/dispatch/session/cookie.rb +12 -11
  30. data/lib/merb-core/dispatch/session/memcached.rb +4 -2
  31. data/lib/merb-core/dispatch/session/memory.rb +8 -6
  32. data/lib/merb-core/dispatch/session/store_container.rb +6 -5
  33. data/lib/merb-core/dispatch/worker.rb +28 -10
  34. data/lib/merb-core/gem_ext/erubis.rb +4 -2
  35. data/lib/merb-core/logger.rb +3 -22
  36. data/lib/merb-core/plugins.rb +5 -5
  37. data/lib/merb-core/rack.rb +1 -1
  38. data/lib/merb-core/rack/adapter.rb +5 -1
  39. data/lib/merb-core/rack/adapter/abstract.rb +15 -10
  40. data/lib/merb-core/rack/adapter/ebb.rb +4 -2
  41. data/lib/merb-core/rack/adapter/evented_mongrel.rb +2 -1
  42. data/lib/merb-core/rack/adapter/fcgi.rb +3 -1
  43. data/lib/merb-core/rack/adapter/irb.rb +10 -1
  44. data/lib/merb-core/rack/adapter/mongrel.rb +5 -2
  45. data/lib/merb-core/rack/adapter/runner.rb +3 -1
  46. data/lib/merb-core/rack/adapter/swiftiplied_mongrel.rb +2 -1
  47. data/lib/merb-core/rack/adapter/thin.rb +4 -1
  48. data/lib/merb-core/rack/adapter/thin_turbo.rb +1 -0
  49. data/lib/merb-core/rack/adapter/webrick.rb +8 -34
  50. data/lib/merb-core/rack/application.rb +2 -2
  51. data/lib/merb-core/rack/handler/mongrel.rb +7 -0
  52. data/lib/merb-core/rack/helpers.rb +1 -1
  53. data/lib/merb-core/rack/middleware.rb +7 -1
  54. data/lib/merb-core/rack/middleware/conditional_get.rb +3 -0
  55. data/lib/merb-core/rack/middleware/content_length.rb +2 -0
  56. data/lib/merb-core/rack/middleware/path_prefix.rb +4 -0
  57. data/lib/merb-core/rack/middleware/profiler.rb +3 -1
  58. data/lib/merb-core/rack/middleware/static.rb +7 -1
  59. data/lib/merb-core/rack/middleware/tracer.rb +1 -0
  60. data/lib/merb-core/rack/stream_wrapper.rb +35 -30
  61. data/lib/merb-core/server.rb +17 -16
  62. data/lib/merb-core/tasks/gem_management.rb +1 -1
  63. data/lib/merb-core/tasks/merb.rb +3 -1
  64. data/lib/merb-core/tasks/merb_rake_helper.rb +1 -1
  65. data/lib/merb-core/test.rb +8 -8
  66. data/lib/merb-core/test/helpers.rb +1 -1
  67. data/lib/merb-core/test/helpers/cookie_jar.rb +16 -2
  68. data/lib/merb-core/test/helpers/mock_request_helper.rb +13 -13
  69. data/lib/merb-core/test/helpers/request_helper.rb +1 -1
  70. data/lib/merb-core/test/helpers/route_helper.rb +2 -2
  71. data/lib/merb-core/test/matchers.rb +3 -3
  72. data/lib/merb-core/test/matchers/request_matchers.rb +1 -1
  73. data/lib/merb-core/test/run_spec.rb +1 -1
  74. data/lib/merb-core/test/tasks/spectasks.rb +1 -1
  75. data/lib/merb-core/test/test_ext/hpricot.rb +1 -1
  76. data/lib/merb-core/test/test_ext/rspec.rb +2 -2
  77. data/lib/merb-core/test/test_ext/string.rb +1 -1
  78. data/lib/merb-core/version.rb +1 -1
  79. metadata +8 -22
  80. data/lib/merb-core/test/matchers/view_matchers.rb +0 -231
  81. data/lib/merb-core/test/webrat.rb +0 -37
  82. data/lib/merb-core/vendor/nokogiri/css.rb +0 -6
  83. data/lib/merb-core/vendor/nokogiri/css/generated_parser.rb +0 -653
  84. data/lib/merb-core/vendor/nokogiri/css/generated_tokenizer.rb +0 -159
  85. data/lib/merb-core/vendor/nokogiri/css/node.rb +0 -95
  86. data/lib/merb-core/vendor/nokogiri/css/parser.rb +0 -24
  87. data/lib/merb-core/vendor/nokogiri/css/parser.y +0 -198
  88. data/lib/merb-core/vendor/nokogiri/css/tokenizer.rb +0 -9
  89. data/lib/merb-core/vendor/nokogiri/css/tokenizer.rex +0 -63
  90. data/lib/merb-core/vendor/nokogiri/css/xpath_visitor.rb +0 -159
@@ -1,37 +0,0 @@
1
- module Merb
2
- module WebratHelper
3
-
4
- def self.delegate_to_session(*meths)
5
- meths.each do |meth|
6
- self.class_eval <<-RUBY
7
- def #{meth}(*args, &blk)
8
- with_session do |sess|
9
- sess.#{meth}(*args, &blk)
10
- end
11
- end
12
- RUBY
13
- end
14
- end
15
-
16
- def with_session
17
- @session ||= ::Webrat::Session.new
18
- yield @session
19
- @session.response
20
- end
21
-
22
- # all of these methods delegate to the @session, which should
23
- # be created transparently.
24
- #
25
- # Note that when using Webrat, #request also uses @session, so
26
- # that #request and webrat native functions behave interchangably
27
- delegate_to_session :visits, :within, :clicks_link_within,
28
- :reload, :header, :http_accept, :basic_auth,
29
- :save_and_open_page, :fill_in, :check,
30
- :uncheck, :choose, :select, :attach_file,
31
- :click_area, :click_link, :click_button,
32
- :field_labeled
33
-
34
- alias reloads reload
35
- alias visit visits
36
- end
37
- end
@@ -1,6 +0,0 @@
1
- require 'merb-core/vendor/nokogiri/css/node'
2
- require 'merb-core/vendor/nokogiri/css/xpath_visitor'
3
- require 'merb-core/vendor/nokogiri/css/generated_tokenizer'
4
- require 'merb-core/vendor/nokogiri/css/generated_parser'
5
- require 'merb-core/vendor/nokogiri/css/tokenizer'
6
- require 'merb-core/vendor/nokogiri/css/parser'
@@ -1,653 +0,0 @@
1
- #
2
- # DO NOT MODIFY!!!!
3
- # This file is automatically generated by racc 1.4.5
4
- # from racc grammer file "lib/nokogiri/css/parser.y".
5
- #
6
-
7
- require 'racc/parser'
8
-
9
-
10
- module Nokogiri
11
-
12
- module CSS
13
-
14
- class GeneratedParser < Racc::Parser
15
-
16
- ##### racc 1.4.5 generates ###
17
-
18
- racc_reduce_table = [
19
- 0, 0, :racc_error,
20
- 4, 46, :_reduce_1,
21
- 1, 46, :_reduce_2,
22
- 2, 49, :_reduce_3,
23
- 2, 49, :_reduce_4,
24
- 2, 49, :_reduce_5,
25
- 1, 49, :_reduce_6,
26
- 2, 49, :_reduce_7,
27
- 2, 49, :_reduce_8,
28
- 2, 50, :_reduce_9,
29
- 2, 50, :_reduce_10,
30
- 1, 50, :_reduce_none,
31
- 2, 50, :_reduce_12,
32
- 1, 50, :_reduce_13,
33
- 3, 48, :_reduce_14,
34
- 1, 48, :_reduce_none,
35
- 2, 57, :_reduce_16,
36
- 1, 51, :_reduce_17,
37
- 1, 51, :_reduce_18,
38
- 6, 55, :_reduce_19,
39
- 6, 55, :_reduce_20,
40
- 5, 55, :_reduce_21,
41
- 2, 54, :_reduce_22,
42
- 3, 54, :_reduce_23,
43
- 3, 54, :_reduce_24,
44
- 3, 54, :_reduce_25,
45
- 1, 59, :_reduce_none,
46
- 1, 59, :_reduce_none,
47
- 4, 60, :_reduce_28,
48
- 3, 60, :_reduce_29,
49
- 2, 60, :_reduce_30,
50
- 1, 60, :_reduce_31,
51
- 2, 61, :_reduce_32,
52
- 2, 61, :_reduce_33,
53
- 1, 52, :_reduce_none,
54
- 0, 52, :_reduce_none,
55
- 2, 56, :_reduce_36,
56
- 2, 56, :_reduce_37,
57
- 2, 56, :_reduce_38,
58
- 2, 56, :_reduce_39,
59
- 1, 56, :_reduce_none,
60
- 1, 56, :_reduce_none,
61
- 1, 56, :_reduce_none,
62
- 1, 56, :_reduce_none,
63
- 1, 62, :_reduce_44,
64
- 4, 58, :_reduce_45,
65
- 4, 58, :_reduce_46,
66
- 0, 58, :_reduce_none,
67
- 1, 63, :_reduce_none,
68
- 1, 63, :_reduce_none,
69
- 1, 63, :_reduce_none,
70
- 1, 63, :_reduce_none,
71
- 1, 63, :_reduce_none,
72
- 1, 63, :_reduce_none,
73
- 1, 63, :_reduce_none,
74
- 5, 53, :_reduce_55,
75
- 1, 64, :_reduce_none,
76
- 2, 47, :_reduce_none,
77
- 0, 47, :_reduce_none ]
78
-
79
- racc_reduce_n = 59
80
-
81
- racc_shift_n = 97
82
-
83
- racc_action_table = [
84
- 5, 79, 81, 27, 10, 26, 94, 93, 42, 2,
85
- 42, 30, 56, 5, 5, 28, 79, 81, 10, 42,
86
- 42, 42, 47, 2, 51, 42, 42, 10, 82, 84,
87
- 85, 52, 78, 10, 10, 7, 9, 12, 15, 42,
88
- 10, 17, 77, 82, 84, 85, 10, 78, 7, 7,
89
- 9, 12, 15, 42, 5, 17, 68, 77, 10, 9,
90
- 69, 15, 10, 2, 17, 9, 9, 15, 15, 50,
91
- 17, 17, 9, 5, 15, 26, 21, 17, 9, 54,
92
- 15, 23, 63, 17, 37, 38, 39, 64, 42, 7,
93
- 9, 12, 15, 44, 9, 17, 15, 42, 15, 17,
94
- 76, 42, 86, 31, 42, 89, 42, 25, 7, 91,
95
- 33, 92, 34, 35, 53, 42, 42 ]
96
-
97
- racc_action_check = [
98
- 0, 73, 73, 6, 0, 7, 90, 90, 63, 0,
99
- 28, 7, 29, 17, 55, 6, 71, 71, 55, 33,
100
- 34, 35, 17, 55, 22, 37, 38, 4, 73, 73,
101
- 73, 23, 73, 1, 11, 0, 0, 0, 0, 42,
102
- 67, 0, 73, 71, 71, 71, 14, 71, 17, 55,
103
- 55, 55, 55, 44, 36, 55, 50, 71, 36, 4,
104
- 52, 4, 16, 36, 4, 1, 11, 1, 11, 21,
105
- 1, 11, 67, 41, 67, 5, 5, 67, 14, 27,
106
- 14, 5, 41, 14, 13, 13, 13, 41, 64, 36,
107
- 36, 36, 36, 16, 16, 36, 16, 65, 18, 16,
108
- 69, 15, 72, 9, 75, 80, 83, 5, 41, 87,
109
- 13, 88, 13, 13, 24, 93, 94 ]
110
-
111
- racc_action_pointer = [
112
- -2, 27, nil, nil, 21, 65, 3, -5, nil, 92,
113
- nil, 28, nil, 77, 40, 92, 56, 11, 58, nil,
114
- nil, 62, -18, 20, 72, nil, nil, 79, 1, -30,
115
- nil, nil, nil, 10, 11, 12, 52, 16, 17, nil,
116
- nil, 71, 30, nil, 44, nil, nil, nil, nil, nil,
117
- 40, nil, 53, nil, nil, 12, nil, nil, nil, nil,
118
- nil, nil, nil, -1, 79, 88, nil, 34, nil, 84,
119
- nil, 13, 61, -2, nil, 95, nil, nil, nil, nil,
120
- 64, nil, nil, 97, nil, nil, nil, 68, 69, nil,
121
- -4, nil, nil, 106, 107, nil, nil ]
122
-
123
- racc_action_default = [
124
- -59, -42, -17, -13, -41, -59, -59, -59, -2, -59,
125
- -44, -43, -18, -15, -40, -58, -35, -59, -11, -38,
126
- -37, -31, -59, -26, -59, -22, -27, -59, -58, -59,
127
- -26, -16, -39, -58, -58, -58, -59, -58, -58, -6,
128
- -36, -59, -58, -34, -58, -9, -10, -33, -32, -12,
129
- -59, -23, -30, -24, 97, -59, -25, -5, -8, -7,
130
- -14, -3, -4, -58, -58, -58, -57, -59, -29, -59,
131
- -1, -47, -59, -47, -56, -58, -28, -48, -52, -53,
132
- -59, -54, -49, -58, -50, -51, -21, -59, -59, -19,
133
- -59, -20, -55, -58, -58, -45, -46 ]
134
-
135
- racc_goto_table = [
136
- 41, 19, 8, 80, 20, 87, 48, 22, 6, 29,
137
- 49, 32, 46, 55, 40, 45, 43, 36, 57, 58,
138
- 59, 24, 61, 62, 75, nil, nil, 66, nil, 67,
139
- 65, nil, nil, nil, nil, nil, nil, nil, 60, nil,
140
- nil, nil, nil, nil, nil, nil, nil, nil, 71, 72,
141
- 73, nil, nil, nil, nil, nil, nil, 70, nil, nil,
142
- 88, nil, nil, nil, nil, nil, nil, 74, 90, nil,
143
- nil, nil, nil, nil, nil, nil, nil, nil, 95, 96 ]
144
-
145
- racc_goto_check = [
146
- 2, 11, 3, 13, 11, 13, 9, 14, 1, 14,
147
- 10, 11, 8, 2, 11, 7, 11, 4, 2, 2,
148
- 2, 15, 2, 2, 19, nil, nil, 2, nil, 2,
149
- 9, nil, nil, nil, nil, nil, nil, nil, 3, nil,
150
- nil, nil, nil, nil, nil, nil, nil, nil, 2, 2,
151
- 2, nil, nil, nil, nil, nil, nil, 3, nil, nil,
152
- 2, nil, nil, nil, nil, nil, nil, 11, 2, nil,
153
- nil, nil, nil, nil, nil, nil, nil, nil, 2, 2 ]
154
-
155
- racc_goto_pointer = [
156
- nil, 8, -15, 2, 4, nil, nil, -1, -4, -11,
157
- -8, 0, nil, -68, 2, 16, nil, nil, nil, -43 ]
158
-
159
- racc_goto_default = [
160
- nil, nil, nil, nil, nil, 13, 16, nil, nil, 18,
161
- 1, 3, 4, nil, nil, nil, 11, 14, 83, nil ]
162
-
163
- racc_token_table = {
164
- false => 0,
165
- Object.new => 1,
166
- :FUNCTION => 2,
167
- :INCLUDES => 3,
168
- :DASHMATCH => 4,
169
- :LBRACE => 5,
170
- :HASH => 6,
171
- :PLUS => 7,
172
- :GREATER => 8,
173
- :S => 9,
174
- :STRING => 10,
175
- :IDENT => 11,
176
- :COMMA => 12,
177
- :URI => 13,
178
- :CDO => 14,
179
- :CDC => 15,
180
- :NUMBER => 16,
181
- :PERCENTAGE => 17,
182
- :LENGTH => 18,
183
- :EMS => 19,
184
- :EXS => 20,
185
- :ANGLE => 21,
186
- :TIME => 22,
187
- :FREQ => 23,
188
- :IMPORTANT_SYM => 24,
189
- :IMPORT_SYM => 25,
190
- :MEDIA_SYM => 26,
191
- :PAGE_SYM => 27,
192
- :CHARSET_SYM => 28,
193
- :DIMENSION => 29,
194
- :PREFIXMATCH => 30,
195
- :SUFFIXMATCH => 31,
196
- :SUBSTRINGMATCH => 32,
197
- :TILDE => 33,
198
- :NOT_EQUAL => 34,
199
- :SLASH => 35,
200
- :DOUBLESLASH => 36,
201
- :NOT => 37,
202
- "." => 38,
203
- "*" => 39,
204
- "[" => 40,
205
- "]" => 41,
206
- ")" => 42,
207
- ":" => 43,
208
- "=" => 44 }
209
-
210
- racc_use_result_var = true
211
-
212
- racc_nt_base = 45
213
-
214
- Racc_arg = [
215
- racc_action_table,
216
- racc_action_check,
217
- racc_action_default,
218
- racc_action_pointer,
219
- racc_goto_table,
220
- racc_goto_check,
221
- racc_goto_default,
222
- racc_goto_pointer,
223
- racc_nt_base,
224
- racc_reduce_table,
225
- racc_token_table,
226
- racc_shift_n,
227
- racc_reduce_n,
228
- racc_use_result_var ]
229
-
230
- Racc_token_to_s_table = [
231
- '$end',
232
- 'error',
233
- 'FUNCTION',
234
- 'INCLUDES',
235
- 'DASHMATCH',
236
- 'LBRACE',
237
- 'HASH',
238
- 'PLUS',
239
- 'GREATER',
240
- 'S',
241
- 'STRING',
242
- 'IDENT',
243
- 'COMMA',
244
- 'URI',
245
- 'CDO',
246
- 'CDC',
247
- 'NUMBER',
248
- 'PERCENTAGE',
249
- 'LENGTH',
250
- 'EMS',
251
- 'EXS',
252
- 'ANGLE',
253
- 'TIME',
254
- 'FREQ',
255
- 'IMPORTANT_SYM',
256
- 'IMPORT_SYM',
257
- 'MEDIA_SYM',
258
- 'PAGE_SYM',
259
- 'CHARSET_SYM',
260
- 'DIMENSION',
261
- 'PREFIXMATCH',
262
- 'SUFFIXMATCH',
263
- 'SUBSTRINGMATCH',
264
- 'TILDE',
265
- 'NOT_EQUAL',
266
- 'SLASH',
267
- 'DOUBLESLASH',
268
- 'NOT',
269
- '"."',
270
- '"*"',
271
- '"["',
272
- '"]"',
273
- '")"',
274
- '":"',
275
- '"="',
276
- '$start',
277
- 'selector',
278
- 's_0toN',
279
- 'simple_selector_1toN',
280
- 'combinator',
281
- 'simple_selector',
282
- 'element_name',
283
- 'hcap_0toN',
284
- 'negation',
285
- 'function',
286
- 'attrib',
287
- 'hcap_1toN',
288
- 'class',
289
- 'attrib_val_0or1',
290
- 'expr',
291
- 'an_plus_b',
292
- 'pseudo',
293
- 'attribute_id',
294
- 'eql_incl_dash',
295
- 'negation_arg']
296
-
297
- Racc_debug_parser = false
298
-
299
- ##### racc system variables end #####
300
-
301
- # reduce 0 omitted
302
-
303
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 13
304
- def _reduce_1( val, _values, result )
305
- result = [val.first, val.last].flatten
306
- result
307
- end
308
- .,.,
309
-
310
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 13
311
- def _reduce_2( val, _values, result )
312
- result = val.flatten
313
- result
314
- end
315
- .,.,
316
-
317
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 16
318
- def _reduce_3( val, _values, result )
319
- result = :DIRECT_ADJACENT_SELECTOR
320
- result
321
- end
322
- .,.,
323
-
324
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 17
325
- def _reduce_4( val, _values, result )
326
- result = :CHILD_SELECTOR
327
- result
328
- end
329
- .,.,
330
-
331
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 18
332
- def _reduce_5( val, _values, result )
333
- result = :PRECEDING_SELECTOR
334
- result
335
- end
336
- .,.,
337
-
338
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 19
339
- def _reduce_6( val, _values, result )
340
- result = :DESCENDANT_SELECTOR
341
- result
342
- end
343
- .,.,
344
-
345
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 20
346
- def _reduce_7( val, _values, result )
347
- result = :DESCENDANT_SELECTOR
348
- result
349
- end
350
- .,.,
351
-
352
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 21
353
- def _reduce_8( val, _values, result )
354
- result = :CHILD_SELECTOR
355
- result
356
- end
357
- .,.,
358
-
359
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 31
360
- def _reduce_9( val, _values, result )
361
- result = if val[1].nil?
362
- val.first
363
- else
364
- Node.new(:CONDITIONAL_SELECTOR, [val.first, val[1]])
365
- end
366
- result
367
- end
368
- .,.,
369
-
370
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 34
371
- def _reduce_10( val, _values, result )
372
- result = Node.new(:CONDITIONAL_SELECTOR, val)
373
- result
374
- end
375
- .,.,
376
-
377
- # reduce 11 omitted
378
-
379
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 38
380
- def _reduce_12( val, _values, result )
381
- result = Node.new(:CONDITIONAL_SELECTOR, val)
382
- result
383
- end
384
- .,.,
385
-
386
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 43
387
- def _reduce_13( val, _values, result )
388
- result = Node.new(:CONDITIONAL_SELECTOR,
389
- [Node.new(:ELEMENT_NAME, ['*']), val.first]
390
- )
391
- result
392
- end
393
- .,.,
394
-
395
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 48
396
- def _reduce_14( val, _values, result )
397
- result = Node.new(val[1], [val.first, val.last])
398
- result
399
- end
400
- .,.,
401
-
402
- # reduce 15 omitted
403
-
404
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 51
405
- def _reduce_16( val, _values, result )
406
- result = Node.new(:CLASS_CONDITION, [val[1]])
407
- result
408
- end
409
- .,.,
410
-
411
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 54
412
- def _reduce_17( val, _values, result )
413
- result = Node.new(:ELEMENT_NAME, val)
414
- result
415
- end
416
- .,.,
417
-
418
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 55
419
- def _reduce_18( val, _values, result )
420
- result = Node.new(:ELEMENT_NAME, val)
421
- result
422
- end
423
- .,.,
424
-
425
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 63
426
- def _reduce_19( val, _values, result )
427
- result = Node.new(:ATTRIBUTE_CONDITION,
428
- [Node.new(:ELEMENT_NAME, [val[2]])] + (val[4] || [])
429
- )
430
- result
431
- end
432
- .,.,
433
-
434
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 68
435
- def _reduce_20( val, _values, result )
436
- result = Node.new(:ATTRIBUTE_CONDITION,
437
- [val[2]] + (val[4] || [])
438
- )
439
- result
440
- end
441
- .,.,
442
-
443
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 74
444
- def _reduce_21( val, _values, result )
445
- # Non standard, but hpricot supports it.
446
- result = Node.new(:PSEUDO_CLASS,
447
- [Node.new(:FUNCTION, ['nth-child(', val[2]])]
448
- )
449
- result
450
- end
451
- .,.,
452
-
453
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 79
454
- def _reduce_22( val, _values, result )
455
- result = Node.new(:FUNCTION, [val.first.strip])
456
- result
457
- end
458
- .,.,
459
-
460
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 82
461
- def _reduce_23( val, _values, result )
462
- result = Node.new(:FUNCTION, [val.first.strip, val[1]].flatten)
463
- result
464
- end
465
- .,.,
466
-
467
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 85
468
- def _reduce_24( val, _values, result )
469
- result = Node.new(:FUNCTION, [val.first.strip, val[1]].flatten)
470
- result
471
- end
472
- .,.,
473
-
474
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 88
475
- def _reduce_25( val, _values, result )
476
- result = Node.new(:FUNCTION, [val.first.strip, val[1]].flatten)
477
- result
478
- end
479
- .,.,
480
-
481
- # reduce 26 omitted
482
-
483
- # reduce 27 omitted
484
-
485
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 102
486
- def _reduce_28( val, _values, result )
487
- if val[1] == 'n'
488
- result = Node.new(:AN_PLUS_B, val)
489
- else
490
- raise Racc::ParseError, "parse error on IDENT '#{val[1]}'"
491
- end
492
- result
493
- end
494
- .,.,
495
-
496
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 113
497
- def _reduce_29( val, _values, result )
498
- # n+3, -n+3
499
- if val[0] == 'n'
500
- val.unshift("1")
501
- result = Node.new(:AN_PLUS_B, val)
502
- elsif val[0] == '-n'
503
- val[0] = 'n'
504
- val.unshift("-1")
505
- result = Node.new(:AN_PLUS_B, val)
506
- else
507
- raise Racc::ParseError, "parse error on IDENT '#{val[1]}'"
508
- end
509
- result
510
- end
511
- .,.,
512
-
513
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 124
514
- def _reduce_30( val, _values, result )
515
- if val[1] == 'n'
516
- val << "+"
517
- val << "0"
518
- result = Node.new(:AN_PLUS_B, val)
519
- else
520
- raise Racc::ParseError, "parse error on IDENT '#{val[1]}'"
521
- end
522
- result
523
- end
524
- .,.,
525
-
526
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 136
527
- def _reduce_31( val, _values, result )
528
- if val[0] == 'even'
529
- val = ["2","n","+","0"]
530
- result = Node.new(:AN_PLUS_B, val)
531
- elsif val[0] == 'odd'
532
- val = ["2","n","+","1"]
533
- result = Node.new(:AN_PLUS_B, val)
534
- else
535
- raise Racc::ParseError, "parse error on IDENT '#{val[0]}'"
536
- end
537
- result
538
- end
539
- .,.,
540
-
541
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 141
542
- def _reduce_32( val, _values, result )
543
- result = Node.new(:PSEUDO_CLASS, [val[1]])
544
- result
545
- end
546
- .,.,
547
-
548
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 141
549
- def _reduce_33( val, _values, result )
550
- result = Node.new(:PSEUDO_CLASS, [val[1]])
551
- result
552
- end
553
- .,.,
554
-
555
- # reduce 34 omitted
556
-
557
- # reduce 35 omitted
558
-
559
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 151
560
- def _reduce_36( val, _values, result )
561
- result = Node.new(:COMBINATOR, val)
562
- result
563
- end
564
- .,.,
565
-
566
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 154
567
- def _reduce_37( val, _values, result )
568
- result = Node.new(:COMBINATOR, val)
569
- result
570
- end
571
- .,.,
572
-
573
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 157
574
- def _reduce_38( val, _values, result )
575
- result = Node.new(:COMBINATOR, val)
576
- result
577
- end
578
- .,.,
579
-
580
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 160
581
- def _reduce_39( val, _values, result )
582
- result = Node.new(:COMBINATOR, val)
583
- result
584
- end
585
- .,.,
586
-
587
- # reduce 40 omitted
588
-
589
- # reduce 41 omitted
590
-
591
- # reduce 42 omitted
592
-
593
- # reduce 43 omitted
594
-
595
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 166
596
- def _reduce_44( val, _values, result )
597
- result = Node.new(:ID, val)
598
- result
599
- end
600
- .,.,
601
-
602
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 169
603
- def _reduce_45( val, _values, result )
604
- result = [val.first, val[2]]
605
- result
606
- end
607
- .,.,
608
-
609
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 170
610
- def _reduce_46( val, _values, result )
611
- result = [val.first, val[2]]
612
- result
613
- end
614
- .,.,
615
-
616
- # reduce 47 omitted
617
-
618
- # reduce 48 omitted
619
-
620
- # reduce 49 omitted
621
-
622
- # reduce 50 omitted
623
-
624
- # reduce 51 omitted
625
-
626
- # reduce 52 omitted
627
-
628
- # reduce 53 omitted
629
-
630
- # reduce 54 omitted
631
-
632
- module_eval <<'.,.,', 'lib/nokogiri/css/parser.y', 186
633
- def _reduce_55( val, _values, result )
634
- result = Node.new(:NOT, [val[2]])
635
- result
636
- end
637
- .,.,
638
-
639
- # reduce 56 omitted
640
-
641
- # reduce 57 omitted
642
-
643
- # reduce 58 omitted
644
-
645
- def _reduce_none( val, _values, result )
646
- result
647
- end
648
-
649
- end # class GeneratedParser
650
-
651
- end # module CSS
652
-
653
- end # module Nokogiri