NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths
Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.
NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths
Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.
This is all based on the [alpha release][1].
From the built-in help system:
For many settings TextMate will look for a .tm_properties file in the current folder and in any parent folders (up to the user’s home folder).
These are simple setting = value listings where the value is a format string in which other variables can be referenced.
| rails_env = ENV['RAILS_ENV'] | |
| raise "Please specify RAILS_ENV." unless rails_env | |
| rails_root = ENV['RAILS_ROOT'] || File.expand_path(File.join(File.dirname(__FILE__), '..', '..')) | |
| RESQUE_PROCESSORS = [ | |
| [1, "foo,bar"], | |
| [2, "baz"], | |
| [3, "demo"] | |
| ] |
| rails_env = ENV['RAILS_ENV'] | |
| raise "Please specify RAILS_ENV." unless rails_env | |
| rails_root = ENV['RAILS_ROOT'] || File.expand_path(File.join(File.dirname(__FILE__), '..', '..')) | |
| God.watch do |w| | |
| w.dir = "#{rails_root}" | |
| w.name = "resque-scheduler" | |
| w.group = 'resque' | |
| w.interval = 30.seconds | |
| w.env = {"RAILS_ENV"=>rails_env, "BUNDLE_GEMFILE"=>"#{rails_root}/Gemfile"} |
| /** | |
| * Application helpers | |
| * requires Underscore.js | |
| */ | |
| var ApplicationHelpers = { | |
| /** | |
| * Railsify object's keys to play nice with default Rails controller setup. | |
| * Rails default controller setup expects params submitted via PUT / POST as: | |
| * | |
| * (POST) {'my_model[attr1]' : 'value1', ... etc. } |
| #!/bin/bash | |
| # http://namakesugi.blog42.fc2.com/blog-entry-98.htmlを参考に。 | |
| # | |
| sudo aptitude install -y \ | |
| cmake \ | |
| paco \ | |
| bison \ | |
| g++ \ | |
| libncurses5-dev \ |
| #!/bin/bash | |
| ### rvm | |
| # rvmをシングルユーザで入れることがオフィシャルで推奨されているので、sudoは付けない。 | |
| # 以下全て同様。 | |
| bash < <(curl -s https://rvm.beginrescueend.com/install/rvm) | |
| echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.zshrc | |
| ### REE | |
| sudo aptitude -y install \ |
| # 在本地服务器建立 rubygems.org 的镜像缓存,以提高 gem 的安装速度 | |
| # 此配置设置缓存过期为1天,也就是说,新上的 gem 无法马上安装 | |
| # 做这个起什么作用? | |
| # rubygems 的很多资源文件是存放到 Amazon S3 上面的,由于 GFW 对某些 S3 服务器又连接重置或丢包,导致 gem 安装异常缓慢或有时候根本无法连接安装。 | |
| # 而通过这种跳板的方式可以很好的解决这个问题,当然前提是 Nginx反向代理 服务器需要在国外 | |
| proxy_cache_path /var/cache/rubygems levels=1:2 keys_zone=RUBYGEMS:10m | |
| inactive=24h max_size=1g; | |
| server { | |
| listen 80; |
| class DatabaseYml < Thor | |
| FILE = 'config/database.yml' | |
| desc "mysql db_name", "create a database.yml for the named mysql database" | |
| method_options :force => :boolean | |
| def mysql(name) | |
| yml = %( | |
| env: &env | |
| adapter: mysql | |
| encoding: utf8 |
| # module: sftp | |
| # A generic Thor module for sftp syncing. | |
| # | |
| # 1. Call `thor sftp:setup` to create config file. | |
| # 2. Edit the config file | |
| # 3. Call `tor sftp:sync` start the sync | |
| # | |
| # Ze end. |