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
相关问答:
我是用netbeans 去寫bnf
a program will ONLY accept strings based on the following grammar:
<compute> --> <value> = < ......
连接Mysql数据库的时候,老是报这个错误!不知道怎么回事
各位大大们,能否告知,感激不尽
另外,我在公司域中,可能会出现一些问题
NoMethodError in BookController#list
undefined met ......
刚开始看ruby
用的是1.8.7版本,编译器SciTE,操作系统win7
用gets方法,包括gets.chomp都没法输入,会弹出一个控制台界面,但点击键盘没有任何反应,如果在输入命令之前有输出,也不会显示在控制台上,而是关 ......
希望给大家提供一些新的思路.
我们在使用C编程时会遇到一个问题,比如头文件的一个函数包含在一个lib 中,但是
在实际连接中我们不知道它在哪个库中。也许可行的一种办法是直接上网查询某个
函数的依赖条件,这对 ......
学习PHP有一段时间了 现在想同时学习RUBY ON RAILS
由于之前学习PHP 已经装好了APACHE 和 MYSQL 现在想让APACHE服务器也可以运行RUBY。
应该怎么办?
请高手提示 谢谢
Rails应用部署专栏: http://ww ......