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 IDE?
路过帮顶
帮顶
cheng_er你这个头像比我的还黄啊.
友情Up!~
纯顶
引用
cheng_er你这个头像比我的还黄啊.
这年头,奇怪的事情怎么这么多呢我就说
......
数字从右边起每三位用一个逗号隔开
1232445 ⇒ 1,232,445
---- ChangeStr.rb内容 ------------------------------------------
def change_str(num)
str = num.to_s
nil while str. ......
请问有没有人学习Ruby语言?
这个问题有什么意义?
肯定有
。。。。。。。。。。。。。。呵呵
这个可以有
啪啪地,
。。。有还是没有?
引用
这个问题有什么意义?
散分的意义的有!
哈哈, ......
希望给大家提供一些新的思路.
我们在使用C编程时会遇到一个问题,比如头文件的一个函数包含在一个lib 中,但是
在实际连接中我们不知道它在哪个库中。也许可行的一种办法是直接上网查询某个
函数的依赖条件,这对 ......