NOTE I now use the conventions detailed in the SUIT framework
Used to provide structural templates.
Pattern
t-template-name
## | |
# test/spec/mini 5 | |
# http://gist.github.com/307649 | |
# chris@ozmm.org | |
# | |
def context(*args, &block) | |
return super unless (name = args.first) && block | |
require 'test/unit' | |
klass = Class.new(defined?(ActiveSupport::TestCase) ? ActiveSupport::TestCase : Test::Unit::TestCase) do | |
def self.test(name, &block) |
# 1.9.2 | |
Rehearsal ------------------------------------------------------- | |
no-send 1.950000 0.000000 1.950000 ( 1.961587) | |
symbol-send 2.190000 0.000000 2.190000 ( 2.192600) | |
string-send 4.790000 0.000000 4.790000 ( 4.812341) | |
---------------------------------------------- total: 8.930000sec | |
user system total real | |
no-send 2.330000 0.000000 2.330000 ( 2.332294) |
Ruby | |
принципиальное различие скриптовых и “обычных” языков | |
3 принципа ООП | |
реализация множественного наследования в ruby | |
duck typing | |
многопоточность в ruby | |
Rails | |
что такое MVC и зачем это нужно | |
локига в контроллере, должна ли быть и почему | |
синхронные и асинхронные операции — предложить варианты решения |
require 'active_record' | |
require 'yaml' | |
require 'mysql' | |
require 'logger' | |
task :default => :migrate | |
desc "Migrate the database through scripts in db/migrate. Target specific version with VERSION=x" | |
task :migrate => :environment do | |
ActiveRecord::Migrator.migrate('db/migrate', ENV["VERSION"] ? ENV["VERSION"].to_i : nil ) |
NOTE I now use the conventions detailed in the SUIT framework
Used to provide structural templates.
Pattern
t-template-name
namespace :deploy do | |
namespace :assets do | |
task :precompile, :roles => :web, :except => { :no_release => true } do | |
from = source.next_revision(current_revision) | |
if capture("cd #{latest_release} && #{source.local.log(from)} vendor/assets/ app/assets/ | wc -l").to_i > 0 | |
run %Q{cd #{latest_release} && #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:precompile} | |
else | |
logger.info "Skipping asset pre-compilation because there were no asset changes" | |
end | |
end |
This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.
You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf
using homebrew.
From: Chris DeSalvo <chris.desalvo@voxer.com> | |
Subject: Why we can't process Emoji anymore | |
Date: Thu, 12 Jan 2012 18:49:20 -0800 | |
Message-Id: <AE459007-DF2E-4E41-B7A4-FA5C2A83025F@voxer.com> | |
--Apple-Mail=_6DEAA046-886A-4A03-8508-6FD077D18F8B | |
Content-Transfer-Encoding: quoted-printable | |
Content-Type: text/plain; | |
charset=utf-8 |
by Jonathan Rochkind, http://bibwild.wordpress.com
Capistrano automates pushing out a new version of your application to a deployment location.
I've been writing and deploying Rails apps for a while, but I avoided using Capistrano until recently. I've got a pretty simple one-host deployment, and even though everyone said Capistrano was great, every time I tried to get started I just got snowed under not being able to figure out exactly what I wanted to do, and figured I wasn't having that much trouble doing it "manually".
class ActionDispatch::Routing::Mapper | |
def draw(routes_name) | |
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb"))) | |
end | |
end | |
BCX::Application.routes.draw do | |
draw :api | |
draw :account | |
draw :session |