ruby²Ù×÷Îļþ
require 'app/configuration'
module RubyAMF
module Configuration
#set the service path used in all requests
# RubyAMF::App::RequestStore.service_path = File.expand_path(RAILS_ROOT) + '/app/controllers'
# => CLASS MAPPING CONFIGURATION
ClassMappings.register(
:actionscript => 'Stock',
:ruby => 'Stock',
:type => 'active_record',
:attributes => ["code", "name"])
end
end
ClassMappings.register(
:actionscript => 'Rolestock',
:ruby => 'Rolestock',
:type => 'active_record',
:associations => ["stock"],
:attributes => ["id", "cost", "amount"])
ÉÏÃæËãÊÇÕû¸öÎļþ°É£¬Ö®ºóÎÒÔÚÁíÒ»¸öͬµÈ¼¶Â·¾¶ÎļþÏÂÒª²Ù×÷Õâ¸öÎļþ
File.open("rubyamf_config.rb") do |file|
while line = file.gets
Ïà¹ØÎÊ´ð£º
ÎÒ×Ô¼ºÐ´ÁËÒ»¸ö¿âÎļþ£¬¿âÎļþÄÚ²¿Ã»ÎÊÌâ¡£ÎÒÏÖÔÚÏëÓà ruby£¨rpgÀµ÷ÓÃÕâ¸ö¿â£¬ÏÖÔÚÎÊÌâ³öÀ´ÁË£¬±¨´í£¬ËµµÄÊÇGetProcAddress : nSrv or nSrvA ºÃÏñÊDz»ÄÜÕÒµ½Õâ¸öº¯Êý°É£¬ nSrv ÊÇÎÒ¿âÎļþÀïµÄÒ»¸öº¯ÊýµÄÃû× ......
ËÖªµÀºÃÓõÄRuby IDE£¿
·¹ý°ï¶¥
°ï¶¥
cheng_erÄãÕâ¸öÍ·Ïñ±ÈÎҵϹ»Æ°¡.
ÓÑÇéUp£¡~
´¿¶¥
ÒýÓÃ
cheng_erÄãÕâ¸öÍ·Ïñ±ÈÎҵϹ»Æ°¡.
ÕâÄêÍ·,Ææ¹ÖµÄÊÂÇéÔõôÕâô¶àÄØÎÒ¾Í˵
......
Ruby ´úÂëÈçÏ£º
class Array
def uniq_by
seen = {}
select{ |x|
v = yield(x)
!seen[v] && (seen[v]=true)
}
end
end
Çója ......
ÎÒÊÇÓÃnetbeans È¥寫bnf
a program will ONLY accept strings based on the following grammar:
<compute> --> <value> = < ......
Ö÷Òª×öÄĸö·½ÃæµÄ£¿ÊDZàÒëÐ͵Äô£¿
Ò»Ãűà³ÌÓïÑÔ£¬²»ÊDZàÒëÐ͵Ä
¿´¿´ÕâÀï°É:
http://www.ruby-lang.org/en/
rubyÊÇһÎâÊÍÐ͵ÄÃæÏò¶ÔÏóÓïÑÔ¡£×î¾ß´ú±íµÄÓ¦ÓÃÊÇrails---web¿ìËÙ¿ª·¢¿ò¼Ü
......