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)}"
Ïà¹ØÎĵµ£º
Prepare
1. Download 'OCI 1.x.x.rb' (it's VERY important - execution MUST be *.rb)
2. Download 'oci8lib.so'
Install
1. Copy 'OCI8.rb' to .../ruby/lib/ruby/site_ruby/1.8/DBD/OCI8
2. Copy 'oci8.rb' to .../ruby/lib/ruby/site_ruby/1.8
3. Copy 'oci8lib.so' to .../ruby/lib/ruby/site_ruby/1.8/i386-msv ......
ÓÐÒ»¸öȫеÄÏîÄ¿£¬ÒòΪ¿¼Âǵ½½«À´µÄÊý¾ÝÀ©Õ¹ÐÔÄÜ£¬ËùÒÔ¿¼ÂÇÓÃCassandra×öÊý¾Ý´æ´¢£¬Ç°¶ËÓÃLighttpd + FastCGI + Rails¡£ÔÚʹÓÃCassandraµÄʱºò£¬¾õµÃÓÐһЩ¶«Î÷¿ÉÄÜ´ó¼Ò¶¼ÐèÒª£¬¾ÍдÁËÒ»¸ö¼òµ¥µÄÖ¸ÄÏ¡£ÒòΪÄÚÈݱȽϳ¤£¨16Ò³£©£¬¾ÍŪÁ˸öPDFÎļþ¸ø´ó¼ÒÏÂÔØ¡£
Cassandra in Action with Twitter's Ruby Client.pdf
Èç¹ûÏÂÔ ......
RuportÖÐpdf_writer¶ÔÖÐÎĵÄÖ§³Ö²¢²»ºÃ£¬Êä³öµÄÖÐÎÄÏÔʾµÄÊÇÂÒÂë¡£ÉÏÍø²éÁ˺ܶà×ÊÁÏ£¬Ò²Ã»ÓÐÕÒµ½ºÃµÄ½â¾ö·½°¸£¬ÎÞÄÎÖ»ºÃ²é¿´Ô´´úÂ룬µ½µ×ΪʲôRuport×Ô´øµÄPDF¹¤¾ß²»Ö§³ÖÖÐÎÄÊä³ö¡£
Ruport::Formatter::PDF::WriterÖÐÕÒµ½ÒÔÏ´úÂë
metrics = load_font_metrics(font)
metrics = PDF::Writer: ......
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 Ruportʵ¼ù—±¨±í²ÎÊýʵÏÖ µÄ»ù´¡ÉϽøÐиÄÔ죬ʵÏÖ±¨±íÖ´Ðж¨Òåʱ±¨±í²ÎÊýµÄÔö¡¢É¾¡¢¸Ä²Ù×÷
Ò»¡¢ÐÞ¸Äviews/report_executions/edit.html.erb
²»½öÏÔʾÔÚн¨±¨±íÖ´ÐÐʱ±£´æµÄ±¨±í²ÎÊý£¬»¹¿É¶¯Ì¬ÏÔʾʣÓàµÄ²ÎÊý£¨ÕâÀï¿ØÖƲÎÊý×î¶à¿É¶¨Òå5¸ö£©£¬ÕâÑù¿É±ÜÃâÒÅÍü¶¨Ò屨±í²ÎÊý»òÐèÒªÔö¼Ó±¨±í²ÎÊýµ ......