ruby 388

#Ruby
Ruby 新建 Word 文档

require 'win32ole' wordobj = WIN32OLE.new("word.application") wordobj.documents.add()

2015-11-17 205

#Ruby
Ruby 使用 FTP 进行文件传输

require 'open-uri' output = File.new('1.8.2-patch1.gz', 'w') open('ftp://ftp.ruby-lang.org…

2015-11-16 184

#Ruby
Hpricot 直接解析某 URL 对应的 HTML

require 'rubygems' require 'hpricot' require 'open-uri' doc = Hpricot(open('http://www.rub…

2015-11-15 918

#Ruby
Rails一个简单的文件上传类,仅上传文件

#encoding: utf-8 require 'fileutils' class UploadException < RuntimeError; end #上传文件 cl…

2015-11-13 807

#Ruby
Rails 为网页(rhtml)初始化数据

class HelloController < ApplicationController def there @data_hash = params[:cruncher] …

2015-11-12 324

#Ruby
Ruby 使用 ODBC 连接数据库

require "odbc" DSN = "Myodbc" USER = "YourName" PWD = "123" ODBC.connect(DSN, USER, PWD) d…

2015-11-11 632

#Ruby
Ruby 请求 Zip 压缩的 HTTP 页面

require 'net/http' require 'uri' module Net class HTTP def HTTP.get_with_headers(uri, head…

2015-11-10 802

#Ruby
OPENSSL 升级

2 3 4 5 6 7 8 9 10 11 12 13 14 15 下载:http://openssl.org/ – ./Configure darwin64-x86_…

2015-11-09 356

#Ruby
GEM OPENSSL 出错

Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS s…

2015-11-09 534

#Ruby
HOME-BREW 安装&卸载 GIT

安装 brew install git 卸载git: rm -rf /usr/local/git rm /etc/paths.d/git rm /etc/manpaths.d/gi…

2015-11-09 412

#Ruby
GEM 安装&卸载POD

安装: gem 应该是ruby自带的ruby包管理器 sudo gem install cocoa pods

2015-11-09 911

#Ruby
ruby 安装更新

wget http://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.2.tar.gz tar xfvz ruby-2.2.2.tar.gz …

2015-11-09 499