boot.rb
来自「敏捷开发 ruby on rails 实现的一个购物车系统」· RB 代码 · 共 24 行
RB
24 行
plugin_root = File.join(File.dirname(__FILE__), '..')version = ENV['RAILS_VERSION']version = nil if version and version == ""# first look for a symlink to a copy of the frameworkif !version and framework_root = ["#{plugin_root}/rails", "#{plugin_root}/../../rails"].find { |p| File.directory? p } puts "found framework root: #{framework_root}" # this allows for a plugin to be tested outside of an app and without Rails gems $:.unshift "#{framework_root}/activesupport/lib", "#{framework_root}/activerecord/lib", "#{framework_root}/actionpack/lib"else # simply use installed gems if available puts "using Rails#{version ? ' ' + version : nil} gems" require 'rubygems' if version gem 'rails', version else gem 'actionpack' gem 'activerecord' endend$:.unshift "#{plugin_root}/lib"
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?