loop do if PLATFORM =~ /linux/i puts `ifconfig ` else puts `ipconfig ` end sleep 3 p '-' *…
def my_mkdir(dirPath) unless File.exist?(dirPath) my_mkdir(dirPath[0, dirPath.rindex('/')]…
# encoding: ASCII-8BIT require 'open-uri' def master title = ["系统工具","图形图像","多媒体类","游戏娱乐",…
require 'win32ole' excel = WIN32OLE.new("excel.application") excel['Visible'] = true workb…
# 一个类包含:类名,属性列表和内部类指针 class Clazz def initialize(cls_name) @cls_name = cls_name @attrs=[] …
#coding:utf-8 #熟悉ruby基本数据类型 class Ruby01 puts "基本数字类型" puts 1 puts 1.0 puts 1.class #输出Fix…
require 'zlib' file = 'compressed.gz' Zlib::GzipWriter.open(file) do |gzip| gzip << …
require 'rss/2.0' require 'open-uri' url = 'http://www.oschina.net/code/rss' feed = RSS::P…
require 'rubygems' require 'mongrel' class BasicServer < Mongrel::HttpHandler def proce…
require 'socket' server = TCPServer.open(2000) # Listen on port 2000 sockets = [server] # …
require 'tk' root = TkRoot.new 3.times { |r| 4.times { |c| TkLabel.new(root) { text "row #…
redmine自定义长文本字段显示及导出pdf排版问题临时解决方案