Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

RUBY ʵÏÖSOAP

SOAP ·þÎñ¶Ë£º
#!/usr/local/bin/ruby
require 'soap/rpc/standaloneServer'
module MySOAP
 class Timer
  def now
   Time.new.strftime("%Y-%m-%d %H:%M:%S")
  end
 end
 class Add
   def add(i, j)
  return i.to_i + j.to_i
   end
 end
end
class TimeServer < SOAP::RPC::StandaloneServer
 def on_init
  time = MySOAP::Timer.new
  add = MySOAP::Add.new
  add_method(time,"now")
  add_method(add,"add")
 end
end
NS = 'http://localhost/soap'
port = 4000
svr = TimeServer.new('timer',NS,'0.0.0.0',port)
trap('INT') { svr.shutdown }
puts "My SOAP is starting... port:#{port} (Ctrl+c to quit)"
svr.start
puts "My SOAP is stop."
SOAP¿Í»§¶Ë£º
require 'soap/rpc/driver'
proxy = SOAP::RPC::Driver.new("http://localhost:4000","http://localhost/soap")
proxy.add_method('now')
proxy.add_method('add','i','j')
puts "Server time now is : #{proxy.now}"
puts "9 + 2000 = #{proxy.add(9,2000)}"


Ïà¹ØÎĵµ£º

rubyÎļþ´ÓÃüÁîÐÐÖнÓÊÕ²ÎÊý£¨È«¾Ö±äÁ¿£ºARGV)


ÏÂÎÄת×Ô£º
http://www.cnblogs.com/watir/archive/2009/04/25/1443440.html
rubyÎļþ´ÓÃüÁîÐÐÖнÓÊÕ²ÎÊý
ÔÚÃüÁîÐз½·¨Ö´ÐÐrubyÎļþʱ£¬ÐèÒª´ÓÃüÁîÐÐÖд«Èë²ÎÊý£¬¿ÉÒÔʹÓÃÈ«¾Ö±äÁ¿£ºARGV
ÈçÓÐruby Îļþtest.rb,ÄÚÈÝÈçÏ£º
1 def hello(a)
2   puts a
3 end

5  ......

Ruby Ruportʵ¼ù—¼òµ¥±¨±íϵͳ

¿ª·¢»·¾³
OS:WindowsXP
Ruby:Ruby1.8.7
Rails:Rails2.3.5
Mysql:Mysql5.0.9
IDE:Rubymine2.0.1
×¼±¸¹¤×÷£º
°²×°ÒÔÏÂgem°ü
gem install ruport
gem install ruport-util
gem install acts_as_reportable
±¾ÀýÉè¼ÆµÄ±¨±íϵͳ¹¤×÷Ô­ÀíÈçͼ£¨´¿Êô¸öÈËÀí½â£©£¬ÒÔProducts±íΪÀý£º
½ÓÏÂÀ´ÊµÏÖµÄÀý×Ó½«ÀûÓÃeval·½·¨ÊµÏ ......

install ruby on cygwin

ת×Ô http://zhujg.javaeye.com/blog/355040
Ê×ÏÈ °²×° cygwin
cygwin Òª°²×°µÄ²å¼þÊÇ
ĬÈϵÄ+ make + gcc + libiconv
+ openssl
cygwinÏÂÐèÒª±àÒëÔ­Îļþ
µ½ruby-lang(http://ruby-lang.org/)
ÏÂÔØruby-1.9.1-p0.tar.gz
tar xvf ruby-1.9.1-p0.tar.gz
cd
ruby-1.9.1-p0
./configure
make && make in ......

Installing Ruby 1.8.6 from Source on Ubuntu

Installing Ruby from source is my preferred method, although in Ubuntu Feisty you can supposedly install it with apt-get install ruby
now. Here’s the essential packages needed to get a source build working right though and the process I just went through:
sudo apt-get install build-essentia ......

ruby gem mysql on cygwin

1£®    °²×°Cygwin
ÔËÐÐCygwinµÄ°²×°³ÌÐò¡£´ÓÎļû°üµÄµÄÁбíÖУ¬ÔÚDEVÀïÃ棬ȷ¶¨ÒªÑ¡Ôñ
• Ruby
• gcc
• subversion
    ÄãÐèҪʹÓÃgccÀ´½¨Á¢Cygwin°æ±¾µÄMySQL.
2. ÔÚwindowsÉÏÃæ°²×°MYSQL£º
    download MySQL 5.0 Windows Installer
3£®  & ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ