GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Rubygem
Description: Merb Core: All you need. None you don't.
Homepage: http://www.merbivore.com
Clone URL: git://github.com/wycats/merb-core.git
Adds specs and changes for compatibility with ActiveSupport.  There is one 
caveat.  It will not change YAML generated Hash keys to strings if they 
are defined as symbols as is currently the behaviour of ActiveSupport.

Closes #134

Squashed commit of the following:

commit 03b56a347cc331fdd3d5566bec1904732481e743
Author: Daniel Neighman <has.sox@gmail.com>
Date:   Thu Mar 6 23:52:43 2008 +1100

    Adds *.pid to the .gitignore file

commit 213c0792398b3c57965b766547e6d2882154185c
Author: Daniel Neighman <has.sox@gmail.com>
Date:   Thu Mar 6 23:51:25 2008 +1100

    Added all specs from ActiveSupport Hash#from_xml to Merb core_ext 
    Hash#from_xml

commit f5e566a445f44be446ad63ab9e1d995dc46c0ae1
Author: Daniel Neighman <has.sox@gmail.com>
Date:   Thu Mar 6 23:38:31 2008 +1100

    Adds more active resource compatible specs

commit abc4c1fd3c97720091f8205f30c7929d8dd9db48
Author: Daniel Neighman <has.sox@gmail.com>
Date:   Thu Mar 6 22:35:51 2008 +1100

    Adds support for nil="true" attribute

commit c3485f018979674d3ef326fb06da9e2d911c0792
Author: Daniel Neighman <has.sox@gmail.com>
Date:   Thu Mar 6 22:12:11 2008 +1100

    Adds some specs from ActiveSupport for from_xml

commit da7afbf04c4ff3c1ad3fbabcae1c49980eed06c3
Author: Daniel Neighman <has.sox@gmail.com>
Date:   Thu Mar 6 20:54:41 2008 +1100

    Fixes nil values
hassox (author)
Thu Mar 06 05:03:45 -0800 2008
commit  2368f8f95e17f236ce50abdf77b83d7db587abd4
tree    424ab87f320a0374bf0ae141c112056992cb7bf3
parent  d4e533e96774982ff117c82bc209e1245be64a49
...
8
9
10
11
12
 
 
13
...
8
9
10
 
11
12
13
14
0
@@ -8,4 +8,5 @@ log
0
 log/*
0
 */log/*
0
 coverage
0
-.DS_Store
0
\ No newline at end of file
0
+.DS_Store
0
+*.pid
0
\ No newline at end of file
...
 
 
1
2
3
...
247
248
249
250
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
251
252
253
254
255
256
 
 
 
 
 
 
 
 
257
258
259
...
262
263
264
 
 
 
 
 
 
 
 
 
 
265
266
267
268
269
270
271
272
273
274
275
276
277
 
 
 
 
 
 
 
 
 
278
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
279
280
281
282
283
284
285
286
287
...
311
312
313
314
315
316
317
318
319
320
321
322
 
 
 
323
324
325
...
357
358
359
360
 
 
361
362
363
...
1
2
3
4
5
...
249
250
251
 
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
 
 
 
 
272
273
274
275
276
277
278
279
280
281
282
...
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
 
302
303
 
 
 
 
 
 
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
 
 
 
 
 
334
335
336
...
360
361
362
 
 
 
 
 
 
 
 
 
363
364
365
366
367
368
...
400
401
402
 
403
404
405
406
407
0
@@ -1,3 +1,5 @@
0
+require 'base64'
0
+
0
 class Hash
0
   class << self
0
     # Converts valid XML into a Ruby Hash structure.
0
@@ -247,13 +249,34 @@ require 'rexml/light/node'
0
 # This represents the hard part of the work, all I did was change the
0
 # underlying parser.
0
 class REXMLUtilityNode # :nodoc:
0
- attr_accessor :name, :attributes, :children
0
+ attr_accessor :name, :attributes, :children, :type
0
+ cattr_accessor :typecasts, :available_typecasts
0
+
0
+ self.typecasts = {}
0
+ self.typecasts["integer"] = lambda{|v| v.nil? ? nil : v.to_i}
0
+ self.typecasts["boolean"] = lambda{|v| v.nil? ? nil : (v.strip != "false")}
0
+ self.typecasts["datetime"] = lambda{|v| v.nil? ? nil : Time.parse(v).utc}
0
+ self.typecasts["date"] = lambda{|v| v.nil? ? nil : Date.parse(v)}
0
+ self.typecasts["dateTime"] = lambda{|v| v.nil? ? nil : Time.parse(v).utc}
0
+ self.typecasts["decimal"] = lambda{|v| BigDecimal(v)}
0
+ self.typecasts["double"] = lambda{|v| v.nil? ? nil : v.to_f}
0
+ self.typecasts["float"] = lambda{|v| v.nil? ? nil : v.to_f}
0
+ self.typecasts["symbol"] = lambda{|v| v.to_sym}
0
+ self.typecasts["string"] = lambda{|v| v.to_s}
0
+ self.typecasts["yaml"] = lambda{|v| v.nil? ? nil : YAML.load(v)}
0
+ self.typecasts["base64Binary"] = lambda{|v| Base64.decode64(v)}
0
+
0
+ self.available_typecasts = self.typecasts.keys
0
 
0
   def initialize(name, attributes = {})
0
- @name = name.tr("-", "_")
0
- @attributes = undasherize_keys(attributes)
0
- @children = []
0
- @text = false
0
+ @name = name.tr("-", "_")
0
+ # leave the type alone if we don't know what it is
0
+ @type = self.class.available_typecasts.include?(attributes["type"]) ? attributes.delete("type") : attributes["type"]
0
+
0
+ @nil_element = attributes.delete("nil") == "true"
0
+ @attributes = undasherize_keys(attributes)
0
+ @children = []
0
+ @text = false
0
   end
0
 
0
   def add_node(node)
0
@@ -262,26 +285,52 @@ class REXMLUtilityNode # :nodoc:
0
   end
0
 
0
   def to_hash
0
+ if @type == "file"
0
+ f = StringIO.new(::Base64.decode64(@children.first || ""))
0
+ class << f
0
+ attr_accessor :original_filename, :content_type
0
+ end
0
+ f.original_filename = attributes['name'] || 'untitled'
0
+ f.content_type = attributes['content_type'] || 'application/octet-stream'
0
+ return {name => f}
0
+ end
0
+
0
     if @text
0
       return { name => typecast_value( translate_xml_entities( inner_html ) ) }
0
     else
0
       #change repeating groups into an array
0
- # group by the first key of each element of the array to find repeating groups
0
       groups = @children.inject({}) { |s,e| (s[e.name] ||= []) << e; s }
0
       
0
- hash = {}
0
- groups.each do |key, values|
0
- if values.size == 1
0
- hash.merge! values.first
0
- else
0
- hash.merge! key => values.map { |element| element.to_hash[key] }
0
+ out = nil
0
+ if @type == "array"
0
+ out = []
0
+ groups.each do |k, v|
0
+ if v.size == 1
0
+ out << v.first.to_hash.entries.first.last
0
+ else
0
+ out << v.map{|e| e.to_hash[k]}
0
+ end
0
         end
0
+ out = out.flatten
0
+
0
+ else # If Hash
0
+ out = {}
0
+ groups.each do |k,v|
0
+ if v.size == 1
0
+ out.merge!(v.first)
0
+ else
0
+ out.merge!( k => v.map{|e| e.to_hash[k]})
0
+ end
0
+ end
0
+ out.merge! attributes unless attributes.empty?
0
+ out = out.empty? ? nil : out
0
+ end
0
+
0
+ if @type && out.nil?
0
+ { name => typecast_value(out) }
0
+ else
0
+ { name => out }
0
       end
0
-
0
- # merge the arrays, including attributes
0
- hash.merge! attributes unless attributes.empty?
0
-
0
- { name => hash }
0
     end
0
   end
0
 
0
@@ -311,15 +360,9 @@ class REXMLUtilityNode # :nodoc:
0
   # If +self+ does not have a "type" key, or if it's not one of the
0
   # options specified above, the raw +value+ will be returned.
0
   def typecast_value(value)
0
- return value unless attributes["type"]
0
-
0
- case attributes["type"]
0
- when "integer" then value.to_i
0
- when "boolean" then value.strip == "true"
0
- when "datetime" then ::Time.parse(value).utc
0
- when "date" then ::Date.parse(value)
0
- else value
0
- end
0
+ return value unless @type
0
+ proc = self.class.typecasts[@type]
0
+ proc.nil? ? value : proc.call(value)
0
   end
0
 
0
   # Convert basic XML entities into their literal values.
0
@@ -357,7 +400,8 @@ class REXMLUtilityNode # :nodoc:
0
   # ==== Returns
0
   # String:: The HTML node in text form.
0
   def to_html
0
- "<#{name}#{attributes.to_xml_attributes}>#{inner_html}</#{name}>"
0
+ attributes.merge!(:type => @type ) if @type
0
+ "<#{name}#{attributes.to_xml_attributes}>#{@nil_element ? '' : inner_html}</#{name}>"
0
   end
0
 
0
   # ==== Alias
...
1
2
 
3
4
5
...
145
146
147
148
 
149
150
151
...
234
235
236
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
237
238
239
...
1
2
3
4
5
6
...
146
147
148
 
149
150
151
152
...
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
0
@@ -1,5 +1,6 @@
0
 require File.dirname(__FILE__) + '/../../spec_helper'
0
 require "date"
0
+require 'bigdecimal'
0
 
0
 describe Hash, "environmentize_keys!" do
0
   it "should transform keys to uppercase text" do
0
@@ -145,7 +146,7 @@ describe Hash, "from_xml" do
0
   end
0
   
0
   it "should typecast a false boolean" do
0
- ["false", "1", "0", "some word" ].each do |w|
0
+ ["false"].each do |w|
0
       Hash.from_xml("<tag type='boolean'>#{w}</tag>")['tag'].should be_false
0
     end
0
   end
0
@@ -234,6 +235,277 @@ describe Hash, "from_xml" do
0
     
0
     Hash.from_xml(xml).should == hash
0
   end
0
+
0
+ it "should properly handle nil values (ActiveSupport Compatible)" do
0
+ topic_xml = <<-EOT
0
+ <topic>
0
+ <title></title>
0
+ <id type="integer"></id>
0
+ <approved type="boolean"></approved>
0
+ <written-on type="date"></written-on>
0
+ <viewed-at type="datetime"></viewed-at>
0
+ <content type="yaml"></content>
0
+ <parent-id></parent-id>
0
+ </topic>
0
+ EOT
0
+
0
+ expected_topic_hash = {
0
+ 'title' => nil,
0
+ 'id' => nil,
0
+ 'approved' => nil,
0
+ 'written_on' => nil,
0
+ 'viewed_at' => nil,
0
+ 'content' => nil,
0
+ 'parent_id' => nil
0
+ }
0
+ Hash.from_xml(topic_xml)["topic"].should == expected_topic_hash
0
+ end
0
+
0
+ it "should handle a single record from xml (ActiveSupport Compatible)" do
0
+ topic_xml = <<-EOT
0
+ <topic>
0
+ <title>The First Topic</title>
0
+ <author-name>David</author-name>
0
+ <id type="integer">1</id>
0
+ <approved type="boolean"> true </approved>
0
+ <replies-count type="integer">0</replies-count>
0
+ <replies-close-in type="integer">2592000000</replies-close-in>
0
+ <written-on type="date">2003-07-16</written-on>
0
+ <viewed-at type="datetime">2003-07-16T09:28:00+0000</viewed-at>
0
+ <content type="yaml">--- \n1: should be an integer\n:message: Have a nice day\narray: \n- should-have-dashes: true\n should_have_underscores: true\n</content>
0
+ <author-email-address>david@loudthinking.com</author-email-address>
0
+ <parent-id></parent-id>
0
+ <ad-revenue type="decimal">1.5</ad-revenue>
0
+ <optimum-viewing-angle type="float">135</optimum-viewing-angle>
0
+ <resident type="symbol">yes</resident>
0
+ </topic>
0
+ EOT
0
+
0
+ expected_topic_hash = {
0
+ 'title' => "The First Topic",
0
+ 'author_name' => "David",
0
+ 'id' => 1,
0
+ 'approved' => true,
0
+ 'replies_count' => 0,
0
+ 'replies_close_in' => 2592000000,
0
+ 'written_on' => Date.new(2003, 7, 16),
0
+ 'viewed_at' => Time.utc(2003, 7, 16, 9, 28),
0
+ # Changed this line where the key is :message. The yaml specifies this as a symbol, and who am I to change what you specify
0
+ # The line in ActiveSupport is
0
+ # 'content' => { 'message' => "Have a nice day", 1 => "should be an integer", "array" => [{ "should-have-dashes" => true, "should_have_underscores" => true }] },
0
+ 'content' => { :message => "Have a nice day", 1 => "should be an integer", "array" => [{ "should-have-dashes" => true, "should_have_underscores" => true }] },
0
+ 'author_email_address' => "david@loudthinking.com",
0
+ 'parent_id' => nil,
0
+ 'ad_revenue' => BigDecimal("1.50"),
0
+ 'optimum_viewing_angle' => 135.0,
0
+ 'resident' => :yes
0
+ }
0
+
0
+ Hash.from_xml(topic_xml)["topic"].each do |k,v|
0
+ v.should == expected_topic_hash[k]
0
+ end
0
+ end
0
+
0
+ it "should handle multiple records (ActiveSupport Compatible)" do
0
+ topics_xml = <<-EOT
0
+ <topics type="array">
0
+ <topic>
0
+ <title>The First Topic</title>
0
+ <author-name>David</author-name>
0
+ <id type="integer">1</id>
0
+ <approved type="boolean">false</approved>
0
+ <replies-count type="integer">0</replies-count>
0
+ <replies-close-in type="integer">2592000000</replies-close-in>
0
+ <written-on type="date">2003-07-16</written-on>
0
+ <viewed-at type="datetime">2003-07-16T09:28:00+0000</viewed-at>
0
+ <content>Have a nice day</content>
0
+ <author-email-address>david@loudthinking.com</author-email-address>
0
+ <parent-id nil="true"></parent-id>
0
+ </topic>
0
+ <topic>
0
+ <title>The Second Topic</title>
0
+ <author-name>Jason</author-name>
0
+ <id type="integer">1</id>
0
+ <approved type="boolean">false</approved>
0
+ <replies-count type="integer">0</replies-count>
0
+ <replies-close-in type="integer">2592000000</replies-close-in>
0
+ <written-on type="date">2003-07-16</written-on>
0
+ <viewed-at type="datetime">2003-07-16T09:28:00+0000</viewed-at>
0
+ <content>Have a nice day</content>
0
+ <author-email-address>david@loudthinking.com</author-email-address>
0
+ <parent-id></parent-id>
0
+ </topic>
0
+ </topics>
0
+ EOT
0
+
0
+ expected_topic_hash = {
0
+ 'title' => "The First Topic",
0
+ 'author_name' => "David",
0
+ 'id' => 1,
0
+ 'approved' => false,
0
+ 'replies_count' => 0,
0
+ 'replies_close_in' => 2592000000,
0
+ 'written_on' => Date.new(2003, 7, 16),
0
+ 'viewed_at' => Time.utc(2003, 7, 16, 9, 28),
0
+ 'content' => "Have a nice day",
0
+ 'author_email_address' => "david@loudthinking.com",
0
+ 'parent_id' => nil
0
+ }
0
+ # puts Hash.from_xml(topics_xml)['topics'].first.inspect
0
+ Hash.from_xml(topics_xml)["topics"].first.each do |k,v|
0
+ v.should == expected_topic_hash[k]
0
+ end
0
+ end
0
+
0
+ it "should handle a single record from_xml with attributes other than type (ActiveSupport Compatible)" do
0
+ topic_xml = <<-EOT
0
+ <rsp stat="ok">
0
+ <photos page="1" pages="1" perpage="100" total="16">
0
+ <photo id="175756086" owner="55569174@N00" secret="0279bf37a1" server="76" title="Colored Pencil PhotoBooth Fun" ispublic="1" isfriend="0" isfamily="0"/>
0
+ </photos>
0
+ </rsp>
0
+ EOT
0
+
0
+ expected_topic_hash = {
0
+ 'id' => "175756086",
0
+ 'owner' => "55569174@N00",
0
+ 'secret' => "0279bf37a1",
0
+ 'server' => "76",
0
+ 'title' => "Colored Pencil PhotoBooth Fun",
0
+ 'ispublic' => "1",
0
+ 'isfriend' => "0",
0
+ 'isfamily' => "0",
0
+ }
0
+ Hash.from_xml(topic_xml)["rsp"]["photos"]["photo"].each do |k,v|
0
+ v.should == expected_topic_hash[k]
0
+ end
0
+ end
0
+
0
+ it "should handle an emtpy array (ActiveSupport Compatible)" do
0
+ blog_xml = <<-XML
0
+ <blog>
0
+ <posts type="array"></posts>
0
+ </blog>
0
+ XML
0
+ expected_blog_hash = {"blog" => {"posts" => []}}
0
+ Hash.from_xml(blog_xml).should == expected_blog_hash
0
+ end
0
+
0
+ it "should handle empty array with whitespace from xml (ActiveSupport Compatible)" do
0
+ blog_xml = <<-XML
0
+ <blog>
0
+ <posts type="array">
0
+ </posts>
0
+ </blog>
0
+ XML
0
+ expected_blog_hash = {"blog" => {"posts" => []}}
0
+ Hash.from_xml(blog_xml).should == expected_blog_hash
0
+ end
0
+
0
+ it "should handle array with one entry from_xml (ActiveSupport Compatible)" do
0
+ blog_xml = <<-XML
0
+ <blog>
0
+ <posts type="array">
0
+ <post>a post</post>
0
+ </posts>
0
+ </blog>
0
+ XML
0
+ expected_blog_hash = {"blog" => {"posts" => ["a post"]}}
0
+ Hash.from_xml(blog_xml).should == expected_blog_hash
0
+ end
0
+
0
+ it "should handle array with multiple entries from xml (ActiveSupport Compatible)" do
0
+ blog_xml = <<-XML
0
+ <blog>
0
+ <posts type="array">
0
+ <post>a post</post>
0
+ <post>another post</post>
0
+ </posts>
0
+ </blog>
0
+ XML
0
+ expected_blog_hash = {"blog" => {"posts" => ["a post", "another post"]}}
0
+ Hash.from_xml(blog_xml).should == expected_blog_hash
0
+ end
0
+
0
+ it "should handle file types (ActiveSupport Compatible)" do
0
+ blog_xml = <<-XML
0
+ <blog>
0
+ <logo type="file" name="logo.png" content_type="image/png">
0
+ </logo>
0
+ </blog>
0
+ XML
0
+ hash = Hash.from_xml(blog_xml)
0
+ hash.should have_key('blog')
0
+ hash['blog'].should have_key('logo')
0
+
0
+ file = hash['blog']['logo']
0
+ file.original_filename.should == 'logo.png'
0
+ file.content_type.should == 'image/png'
0
+ end
0
+
0
+ it "should handle file from xml with defaults (ActiveSupport Compatible)" do
0
+ blog_xml = <<-XML
0
+ <blog>
0
+ <logo type="file">
0
+ </logo>
0
+ </blog>
0
+ XML
0
+ file = Hash.from_xml(blog_xml)['blog']['logo']
0
+ file.original_filename.should == 'untitled'
0
+ file.content_type.should == 'application/octet-stream'
0
+ end
0
+
0
+ it "should handle xsd like types from xml (ActiveSupport Compatible)" do
0
+ bacon_xml = <<-EOT
0
+ <bacon>
0
+ <weight type="double">0.5</weight>
0
+ <price type="decimal">12.50</price>
0
+ <chunky type="boolean"> 1 </chunky>
0
+ <expires-at type="dateTime">2007-12-25T12:34:56+0000</expires-at>
0
+ <notes type="string"></notes>
0
+ <illustration type="base64Binary">YmFiZS5wbmc=</illustration>
0
+ </bacon>
0
+ EOT
0
+
0
+ expected_bacon_hash = {
0
+ 'weight' => 0.5,
0
+ 'chunky' => true,
0
+ 'price' => BigDecimal("12.50"),
0
+ 'expires_at' => Time.utc(2007,12,25,12,34,56),
0
+ 'notes' => "",
0
+ 'illustration' => "babe.png"
0
+ }
0
+
0
+ Hash.from_xml(bacon_xml)["bacon"].should == expected_bacon_hash
0
+ end
0
+
0
+ it "should let type trickle through when unknown (ActiveSupport Compatible)" do
0
+ product_xml = <<-EOT
0
+ <product>
0
+ <weight type="double">0.5</weight>
0
+ <image type="ProductImage"><filename>image.gif</filename></image>
0
+
0
+ </product>
0
+ EOT
0
+
0
+ expected_product_hash = {
0
+ 'weight' => 0.5,
0
+ 'image' => {'type' => 'ProductImage', 'filename' => 'image.gif' },
0
+ }
0
+
0
+ Hash.from_xml(product_xml)["product"].should == expected_product_hash
0
+ end
0
+
0
+ it "should handle unescaping from xml (ActiveResource Compatible)" do
0
+ xml_string = '<person><bare-string>First &amp; Last Name</bare-string><pre-escaped-string>First &amp;amp; Last Name</pre-escaped-string></person>'
0
+ expected_hash = {
0
+ 'bare_string' => 'First & Last Name',
0
+ 'pre_escaped_string' => 'First &amp; Last Name'
0
+ }
0
+
0
+ Hash.from_xml(xml_string)['person'].should == expected_hash
0
+ end
0
+
0
 end
0
 
0
 describe Hash, 'to_params' do

Comments

    No one has commented yet.