def generate_node_config(file_name, appium_port, device)
      system 'mkdir node_configs >> /dev/null 2>&1'
      f = File.new("#{Dir.pwd}/node_configs/#{file_name}", 'w')
      f.write(JSON.generate(
                capabilities: [{ browserName: device[:udid], maxInstances: 5, platform: device[:platform] }],
                configuration: { cleanUpCycle: 2000,
                                 timeout: 1_800_000,
                                 registerCycle: 5000,
                                 proxy: 'org.openqa.grid.selenium.proxy.DefaultRemoteProxy',
                                 url: "http://127.0.0.1:#{appium_port}/wd/hub",
                                 host: '127.0.0.1',
                                 port: appium_port,
                                 maxSession: 5,
                                 register: true,
                                 hubPort: 4444,
                                 hubHost: 'localhost' }
      ))
      f.close
    end
def generate_node_config(file_name, appium_port, device)
      system 'mkdir node_configs >> /dev/null 2>&1'
      f = File.new("#{Dir.pwd}/node_configs/#{file_name}", 'w')
      f.write(JSON.generate(
                capabilities: [{ browserName: device[:udid], maxInstances: 5, platform: device[:platform] }],
                configuration: { cleanUpCycle: 2000,
                                 timeout: 1_800_000,
                                 registerCycle: 5000,
                                 proxy: 'org.openqa.grid.selenium.proxy.DefaultRemoteProxy',
                                 url: "http://127.0.0.1:#{appium_port}/wd/hub",
                                 host: '127.0.0.1',
                                 port: appium_port,
                                 maxSession: 5,
                                 register: true,
                                 hubPort: 4444,
                                 hubHost: 'localhost' }
      ))
      f.close
    end
Generate node config for sellenium grid