print "Enter one number:" n1 = gets.to_i print "Enter another number:" n2 = gets.to_i gcf …
require 'gtk' window = Gtk::Window::new button = Gtk::Button::new("Hello, World!") button.…
require 'iconv' input_encoding = "windows-1252" output_encoding = 'utf-8' converted_doc = …
print '1 hello world! ' + "\n" print "2 hello world!\n" print('3 hello world! ' + 10.chr )…
require 'yaml' hash = {1 => 'sqlite3', 2 => 'postgresql', 3 => 'mssql', 4 => '…
#!/usr/bin/env ruby #-w # coding:gbk #''' # author: leijming # date :20120701 #''' load 'p…
require 'net/http' Net::HTTP.start("www.google.com.hk") { |http| resp = http.get("/images/…
#先运行irb 或 pry C=`stty size`.split[1].to_i;S=[0x2743].pack("U*");a={};puts "\033[2J";loop{a…
require "win32ole" docfile = "yourDoc.doc" word = WIN32OLE.new "Word.Application" word.vis…
require 'find' class Recorder attr_accessor :fileSteam def initialize(outputFilePath) @f…
require 'socket' client = TCPSocket.open('127.0.0.1', 'finger') client.send("mysql\n", 0) …
my_account = Account.find 3 your_account = Account.find 4 Account.transaction do my_accoun…