This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding : utf-8 -*- | |
set :assets_dependencies, %w(app/assets lib/assets vendor/assets Gemfile.lock config/routes.rb) | |
namespace :deploy do | |
namespace :assets do | |
desc <<-DESC | |
Run the asset precompilation rake task. You can specify the full path \ | |
to the rake executable by setting the rake variable. You can also \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.9.3p0 :001 > Z=Struct.new(:n,:v) | |
=> Z | |
1.9.3p0 :002 > z=[ Z.new('b',1), Z.new('b',2), Z.new('a',1)] | |
=> [#<struct Z n="b", v=1>, #<struct Z n="b", v=2>, #<struct Z n="a", v=1>] | |
1.9.3p0 :003 > z.sort_by{ |z| z.n } | |
=> [#<struct Z n="a", v=1>, #<struct Z n="b", v=2>, #<struct Z n="b", v=1>] | |
1.9.3p0 :004 > z.each_with_index.sort_by{ |z, i| [z.n, i] }.map{|z,_| z} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# daemonized resque scheduler runner | |
require 'yaml' | |
env = ENV['RAILS_ENV'] || 'development' | |
scheduler_config = YAML.load_file(File.expand_path('../../config/resque_schedule.yml', __FILE__))[env] | |
puts scheduler_config.inspect | |
paths = [] | |
paths << stdout_path = scheduler_config['stdout_path'] | |
paths << stderr_path = scheduler_config['stderr_path'] | |
paths << pidfile_path = scheduler_config['pidfile_path'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) | |
require "rvm/capistrano" | |
set :application, "my_app" | |
set :repository, "[email protected]:myuser/myapp.git" | |
set :branch, "production" | |
set :rvm_ruby_string, "1.9.2" | |
set :deploy_to, "/var/applications/" | |
set :user, "username" |
NewerOlder