View difference between Paste ID: fxCAqXs3 and di7WWxU3
SHOW: | | - or go back to the newest paste.
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-
  }
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