Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
public function actionRegistr() | |
{ | |
$form = new RegistrForm; | |
if (!Yii::app()->user->isGuest) { | |
throw new CException('Вы уже зарегистрированны!'); | |
} else { | |
if (isset($_POST['RegistrForm'])) { | |
$form->attributes = $_POST['RegistrForm']; |
#!/usr/bin/env bash | |
apt-get -y update | |
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline5-dev libyaml-dev | |
cd /tmp | |
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz | |
tar -xvzf ruby-1.9.3-p125.tar.gz | |
cd ruby-1.9.3-p125/ | |
./configure --prefix=/usr/local | |
make | |
make install |
require 'spec_helper' | |
describe "HistoryItems" do | |
before(:each) {login_as :user} | |
describe "GET /history_items" do | |
it "works!" do | |
visit history_items_path | |
response.should be_success | |
end | |
end |
#!/bin/bash | |
SSHC_PATH=$HOME'/.sshc' | |
if [ ! -d $SSHC_PATH ] ; then | |
mkdir "$SSHC_PATH" | |
fi | |
case "$1" in | |
-a | --add) | |
touching_name="$2" |
namespace :app do | |
namespace :error_pages do | |
desc "Generates static pages 500, 403, 404, 422" | |
task :generate => :environment do | |
av = ActionView::Base.new | |
av.class_eval do | |
include ApplicationHelper | |
include Rails.application.routes.url_helpers | |
end |
class User < ActiveRecord::Base | |
#default_scope where(:banned => false) | |
scope :unbanned, where(:banned => false) | |
include ChooseCity | |
rolify | |
acts_as_voter | |
has_karma(:questions, :as => :submitter, :weight => 0.5) | |
mount_uploader :avatar, AvatarUploader |
class MessageImageWorker | |
@queue = :message_image_queue | |
def self.perform(message_id, image_path) | |
MessageImage.create!(message_id: message_id, image: image_path) | |
end | |
end |
Разрабатывайте скрипты с опциями set -eu
require "rubocop" | |
module RuboCop | |
module Cop | |
module Lint | |
# This cop checks bad use of the Minitest `assert` method | |
# | |
# `assert` method's second argument is the error message when the | |
# first argument evals to false. | |
# |