- Интересно было бы послушать чем отличается переезд с хероку от обычного деплоя на новый сервер, если чем-то отличается.
- перенос БД (mongodump/mongorestore)
- изменение способа хранения настроек
- настройка почты (Google Apps)
require 'rubygems' | |
require 'json' | |
def save_settings(settings) | |
`gsettings set com.canonical.Unity.Panel systray-whitelist "#{settings.to_json.gsub('"', "'")}"` | |
end | |
def current_settings |
# ./spec/spec_helper.rb | |
# | |
# Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|f| require f} | |
# | |
# | |
# Usage: | |
# | |
# its(:updated_at) { should be_the_same_time_as updated_at } | |
# | |
# |
# | |
# Put this file into spec/support/ folder. | |
# | |
# Helper +action+ allows you to write something like | |
# | |
# describe "GET index" do | |
# action { get :index } | |
# | |
# context 'if user signed in' do | |
# before { sign_in user } |
# Usage | |
# | |
# class Rectangle | |
# include TypeCast | |
# | |
# ... | |
# | |
# attr_accessor :width, :height, :fill | |
# type_cast :width, :height, :method => :to_f | |
# type_cast :fill, :allow_nil => false, :method => lambda { |value| !!value } |
describe SomeController do | |
context "if user is not logged in" do | |
specify "GET 'show' should redirect to login page" do | |
get :show | |
response.should redirect_to login_path | |
end | |
specify "PUT 'update' should redirect to login page" do | |
put :update | |
response.should redirect_to login_path |
class FirstController < ApplicationController | |
def edit | |
prepare_model_for_form | |
end | |
def update | |
current_user.attributes = params[:user] | |
current_user.validates_email! | |
if current_user.save |
# encoding: utf-8 | |
def gas(name = "", acct = "") | |
url = "http://sevgaz.com.ua/index.php?option=com_content&view=article&id=52" | |
data = `curl -F "afam=#{name}" -F "peracc=#{acct}" "#{url}" 2>/dev/null` | |
data.scan(%r{Адрес.*?<tr><td>(.*?)</td>\s*<td>\s*<strong>(.*?)</strong>}).flatten | |
end | |
def water(name = "", acct = "") |
# spec/support/carrierwave.rb | |
class TestStorage < CarrierWave::Storage::File | |
def store!(file) | |
end | |
def retrieve!(identifier) | |
identifier | |
end | |
end |
source :gemcutter | |
source 'http://gems.github.com' | |
gem 'rails', '3.2.7' | |
gem 'rake', '0.9.2.2' | |
gem 'foreman' | |
gem 'sidekiq', '= 2.4.0' | |
gem 'sinatra', require: false | |
# Database and data related [Putting pg to the end because of a weird bug with Lion, pg and openssl] |