xforty/drush-deploy — pull request #26 by patcon (2013-03-13 22:07:48+00:00)
Title: Remove dependency on php_serialize

A totally minor thing, but you could probably remove the dep on that lib if you used `drush eval 'print json_encode([...]);'` instead of using `php_serialize()` on the PHP array objects :)

I see you also use it in a `drush php-script` call in databases.rb, but it should be swappable too. Maybe I'm missing something though.

```ruby
➜ drupal-skeletor git:(master) ✗ irb
irb(main):001:0> require 'json'
=> true
irb(main):002:0> require 'pp'
=> true
irb(main):003:0> pp JSON.parse %x[drush eval 'print json_encode(_drush_sitealias_all_list());']
{"@none"=>{"root"=>"", "uri"=>""},
"@test.vagrant"=>
{"uri"=>"default",
"root"=>"/var/www/skeletor/current",
"remote-user"=>"vagrant",
"remote-host"=>"33.33.33.10",
"remote-port"=>"2222"},
"@test"=>{"site-list"=>["@test.vagrant"]}}
=> {"@none"=>{"root"=>"", "uri"=>""}, "@test.vagrant"=>{"uri"=>"default", "root"=>"/var/www/skeletor/current", "remote-user"=>"vagrant", "remote-host"=>"33.33.33.10", "remote-port"=>"2222"}, "@test"=>{"site-list"=>["@test.vagrant"]}}
irb(main):004:0> json_aliases = JSON.parse %x[drush eval 'print json_encode(_drush_sitealias_all_list());']
=> {"@none"=>{"root"=>"", "uri"=>""}, "@test.vagrant"=>{"uri"=>"default", "root"=>"/var/www/skeletor/current", "remote-user"=>"vagrant", "remote-host"=>"33.33.33.10", "remote-port"=>"2222"}, "@test"=>{"site-list"=>["@test.vagrant"]}}
irb(main):005:0> json_aliases['@test.vagrant']['remote-user']
=> "vagrant"
irb(main):006:0>
```