Guest User

Untitled

a guest
Mar 2nd, 2015
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Json:
  2. {
  3. "vdd": {
  4. "sites": {
  5. "drupal8": {
  6. "account_name": "root",
  7. "account_pass": "root",
  8. "account_mail": "[email protected]",
  9. "site_name": "Drupal 8",
  10. "site_mail": "[email protected]",
  11. "vhost": {
  12. "document_root": "drupal8",
  13. "url": "drupal8.dev",
  14. "alias": ["www.drupal8.dev"]
  15. }
  16. },
  17. "drupal7": {
  18. "account_name": "root",
  19. "account_pass": "root",
  20. "account_mail": "[email protected]",
  21. "site_name": "Drupal 7",
  22. "site_mail": "[email protected]",
  23. "vhost": {
  24. "document_root": "drupal7",
  25. "url": "drupal7.dev",
  26. "alias": ["www.drupal7.dev"]
  27. }
  28. }
  29. }
  30. }
  31. }
  32.  
  33. ruby code to get each url:
  34. config_json["vdd"]["sites"].each_with_index do |site, idx|
  35. puts site[idx]["vhost"]['url'] // ERROR
  36. end
Advertisement
Add Comment
Please, Sign In to add comment