Is there a plugin/gem to log/record the history of rails script/generate commands?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
I added code to script/generate and that does the trick.
CMD = "#{$0} #{ARGV.join(' ')}\n"
File.open(File.expand_path('../../log/generate.log',
__FILE__), 'a') {|f| f.write(CMD) }