首页 软件开发 代码片段 ruby ( Page 26 )

ruby 388

#Ruby
Ruby 使用 POST 方法提交数据

require 'net/http' url = URI.parse('http://www.rubyinside.com/test.cgi') response = Net::H…

2015-01-22 688

#Ruby
Ubuntu操作系统下rbenv、ruby、rails开发环境搭建

# ! /usr/bin/sh # Ubuntu系统下安装ruby/rails必要的库和编译环境 sudo apt-get update sudo apt-get install …

2015-01-22 823

#Ruby
看糗百简单ruby版

#encoding: utf-8 require 'open-uri' require 'nokogiri' doc = Nokogiri::HTML(open('http://w…

2015-01-21 895

#Ruby
Rails 删除数据库中相关记录

create database Contact; use Contact; CREATE TABLE Employee ( Name VARCHAR(50), Phone VARC…

2015-01-21 574

#Ruby
Ruby 在 IE 中打开对话框

require "win32ole" def ieInputBox( msg, default ) ie = WIN32OLE.new("InternetExplorer.Appl…

2015-01-19 944

#Ruby
Ruby 使用 Net::FTP 移动文件

require 'net/ftp' ftp = Net::FTP.new("ftp.ruby-lang.org") ftp.login ftp.passive = true fil…

2015-01-19 514

#Ruby
计算斐波那契(Fibonacci)

# Calculate the Fibonacci to 'x' number of places and return it as an array def Fibonacci(…

2015-01-19 592

#Ruby
命令行调用google翻译的ruby脚本

require 'uri' require 'open-uri' require 'iconv' CN_re = /(?:\xe4[\xb8-\xbf][\x80-\xbf]|[\…

2015-01-16 528

#Ruby
Rails 创建一个 Controller

// To creates the web application // Use the command rails applicationName: rails oschina …

2015-01-16 389

#Ruby
Ruby排列计算

#!/usr/bin/env ruby # PERMUTATIONS COMPUTER # based on Bogomolyn algorithm # http://www.be…

2015-01-15 856

#Ruby
使用 Webrick 开发一个基本的 HTTP 服务器

require 'webrick' class MyServlet < WEBrick::HTTPServlet::AbstractServlet def do_GET(re…

2015-01-15 347

#Ruby
Ruby 字符串回文判断

def is_palindrome(word) if word == word.reverse "#{ word } is a palindrome." else "#{ word…

2015-01-14 531
1 24 25 26 27 28 33