摘要: #ruby提供了多种运行外部程序的方法#1.%x %x不需要使用引号包含。#2. system方法 #3.exec类似system但是会中断当前的代码执行#system和exec不能捕获执行程序的输出。list=%x(dir d:\\) #捕获到输出结果system('notepad')p 'sys... 阅读全文
posted @ 2015-01-09 16:52 Rookier 阅读(1296) 评论(0) 推荐(0) 编辑
摘要: #require 'net/http'#p Net::HTTP.get_response(URI.parse('http://www.kuaiyoujia.com')){|res|# puts res.code# p res['SERVER']# res.each {|key,value|# ... 阅读全文
posted @ 2015-01-09 14:20 Rookier 阅读(233) 评论(0) 推荐(0) 编辑