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
#!/usr/bin/dumb-init /bin/sh | |
set -e | |
# Note above that we run dumb-init as PID 1 in order to reap zombie processes | |
# as well as forward signals to all processes in its session. Normally, sh | |
# wouldn't do either of these functions so we'd leak zombies as well as do | |
# unclean termination of all our sub-processes. | |
# Prevent core dumps | |
ulimit -c 0 |
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
#Model | |
@user.should have(1).error_on(:username) # Checks whether there is an error in username | |
@user.errors[:username].should include("can't be blank") # check for the error message | |
#Rendering | |
response.should render_template(:index) | |
#Redirecting | |
response.should redirect_to(movies_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
# Russian. Updated 2014-04-01 | |
ru: | |
admin: | |
js: | |
true: 'True' | |
false: 'False' | |
is_present: 'Не пустое' | |
is_blank: 'Пустое' | |
date: 'Дата ...' |
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
unless Rails.env.production? | |
connection = ActiveRecord::Base.connection | |
connection.tables.each do |table| | |
connection.execute("TRUNCATE #{table}") unless table == "schema_migrations" | |
end | |
sql = File.read('db/import.sql') | |
statements = sql.split(/;$/) | |
statements.pop |
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
class LiquidHandler | |
PROTECTED_ASSIGNS = %w( template_root response _session template_class action_name request_origin session template | |
_response url _request _cookies variables_added _flash params _headers request cookies | |
ignore_missing_templates flash _params logger before_filter_chain_aborted headers ) | |
def self.call(template) | |
new.compile(template) | |
end | |
def compile(template) |
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
# Spree extension capistrano tasks | |
# -------------------------------- | |
# $ cap extension:site:update | |
# $ cap deploy:restart | |
#Or remove my snippets extension (not that I would, it's an integral part of the site) | |
# $ cap extension:snippets:remove | |
# $ cap deploy:restart |