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
相关问答:
下面是输出一个小于100的Fibnancci数列:
class test1
def Fib(max)
i1,i2 = 1,1
while i1 <= max
yield i1
......
做了三年。NET了
当然。NET水平也很烂
想多学一些新的语言
这两天在学习RUBY
不知道将来有没有前途
RUBY前辈们,指点一二啊。
别这山看着那山高,其实它们只是你的一个工具,就象武林高手拿个树叶 ......
给Javascript和Ruby开个论坛专栏吧!
给Javascript和Ruby开个论坛专栏吧!
给Javascript和Ruby开个论坛专栏吧!
Javascript有专栏的:http://forum.csdn.net/SList/JavaScript
尊敬的用户deping_chen,您好: ......
Python code:
puts true or false
puts false or true
为什么上面的输出true,下面的输出false?难道只认or前面的?
据说or后面是直接省略的,不知道是不是这样。
楼上的答案好像不是我想要的
ruby社区怎 ......
学习PHP有一段时间了 现在想同时学习RUBY ON RAILS
由于之前学习PHP 已经装好了APACHE 和 MYSQL 现在想让APACHE服务器也可以运行RUBY。
应该怎么办?
请高手提示 谢谢
Rails应用部署专栏: http://ww ......