Put the ruby file in .git/hooks/post-commit
Create a deploy script as .deploy_*
Example:
# File: .deploy_production
scp -R html example.com:public_html
Then use "deploy *
" in your commit message.
# ~/.rvm/gemsets/global.gems | |
rake | |
bundler | |
autotest-fsevent | |
autotest-growl |
#!/bin/bash | |
if [ `echo -n "$DIALOG" | tail -c 1` != "2" ]; then | |
CHECK=$("$DIALOG" -l | egrep -c 'TextMate — GetBundles') | |
else | |
CHECK=$("$DIALOG" nib --list | egrep -c 'TextMate — GetBundles') | |
fi | |
[[ ! -d ~/Library/Logs ]] && mkdir -p ~/Library/Logs | |
rm -f ~/Library/Logs/TextMateGetBundles.log |
#! /usr/bin/ruby | |
# data set: | |
# id | name | score | postal | color | |
# 1 | john | 14 | 12345 | blue | |
# 2 | jane | 10 | 12345 | blue | |
# 3 | jeff | 6 | 12345 | green | |
# define a simple class for holding the dataset |
# Some values, they are themselves | |
true # => true | |
false # => false | |
"value" # => "value" | |
0 # => 0 | |
nil # => nil | |
module DataMapper | |
# DataMapper::Sweeper provides an observer to model changes that have access | |
# to the controller invoking the changes. | |
# | |
# The api for DataMapper::Sweeper is similar to DataMapper::Observer, but | |
# there is one important difference: in DataMapper::Observer .before and | |
# .after blocks are evaluated in the context of the resource instance. | |
# However, DataMapper::Sweeper .before and .after blocks are evaluated in the | |
# context of an instance of your Sweeper class, and missing methods are |
def page_title() | |
object_name = controller_name.singularize | |
if controller.instance_variables.include?(('@' + object_name).to_sym) | |
locals = { | |
object_name.to_sym => controller.instance_variable_get('@' + object_name).to_s | |
} | |
else | |
locals = {} | |
end |
Put the ruby file in .git/hooks/post-commit
Create a deploy script as .deploy_*
Example:
# File: .deploy_production
scp -R html example.com:public_html
Then use "deploy *
" in your commit message.
🐻 🐨
class Asset < AR | |
end | |
class Alert < AR | |
belongs_to :asset | |
has_many :logs | |
accepts_nested_attributes_for :logs | |
end | |
class Log < AR |
module ApplicationHelper | |
def current_user | |
super.decorator | |
end | |
end |