Ruby´ò°ü·¢²¼
http://www.erikveen.dds.nl/distributingrubyapplications/rails.html£º
In this tutorial, we'll go through the following steps: Setup the environment Create the SQLite database Develop the Rails application Create the RBA (= Ruby archive) from the application with Tar2RubyScript Create the standalone executable with RubyScript2Exe module Rails
class Configuration
def database_configuration
#conf = YAML::load(ERB.new(IO.read(database_configuration_file)).result) »á³ö´í
conf = YAML::load(File.read(database_configuration_file))
if defined?(TAR2RUBYSCRIPT)
conf.each do |k, v|
if v["adapter"] =~ /^sqlite/
v["database"] = oldlocation(v["database"]) if v.include?("database")
v["dbfile"] = oldlocation(v["dbfile"]) if v.include?("dbfile")
end
end
end
conf
end
end
end "database"=>"E:/worksapce/temp/db/demo_development.sqlite3", oldlocation(v["database"]) ÆäʵÊÇÔÚDB×ÓĿ¼ÖУ¬¶ø²»ÊÇÔÚµ±Ç°ÔËÐеÄĿ¼ÏÂ
tar2rubyscript¿ÉÒÔÁË
rubyscript2exe ²»ÐУ¬ÓпÉÄÜÊÇRAILS°æ±¾ÎÊÌ⣬ ÏÖÔÚÖ¤Ã÷²»ÊÇRAILS°æ±¾ÎÊÌ⣬¹À¼ÆÊÇRUBY °æ±¾ÎÊÌâ 2.Exerb²»ÄÜͨ¹ýgem°²×°£¬²»¹ý°²×°·½Ê½Ò²Ê®·Ö·½±ã¡£
Ê×Ïȵ½exerbµÄ¹Ù·½ÍøÕ¾ÏÂÔØexerb.Á´½ÓÔÚÒ³ÃæÖмäÄǸöλÖá£
Ïà¹ØÎĵµ£º
ÏÂÎÄת×Ô£º
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
4
5 ......
Bignum
+ ¼Ó
- ¼õ
* ³Ë
/ ³ý
** Ö¸Êý²Ù×÷2**2 Òâ˼ÊÇ2µÄƽ·½
<=> ´óÓÚ, ......
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¸ö£©£¬ÕâÑù¿É±ÜÃâÒÅÍü¶¨Ò屨±í²ÎÊý»òÐèÒªÔö¼Ó±¨±í²ÎÊýµ ......
RuportĿǰ×Ô´øÖ§³ÖPDF,HTML,CSV,TXT¸ñʽÊä³ö£¬Èç¹ûÏë´òÓ¡.xml£¬.bat±¨±íÔõô°ì£¿
±¾Àý½«ÒÔXML¸ñʽΪÀý£¬ÊµÏÖRuport::FormatterµÄÁíÒ»ÖÖ×Ô¶¨ÒåÓ¦Óá£
RuportµÄÓ¦Óòο¼£º Ruby Ruportʵ¼ù—¼òµ¥±¨±íϵͳ
×¢£ºÆäËû¸ñʽµÄ±¨±íÖ»ÐèÒªÐÞ¸Ärenders¶ÔÓ¦µÄÄÚÈÝ£¨ÈçÏ£Íû±£´æÎª.bat¸ñʽ£¬½«renders :xml¸ÄΪrenders :bat£©£¬ ......