Skip to content

Instantly share code, notes, and snippets.

@jayroh
Created November 7, 2013 22:06
Show Gist options
  • Save jayroh/7362664 to your computer and use it in GitHub Desktop.
Save jayroh/7362664 to your computer and use it in GitHub Desktop.
personal setup for setting up a rails engine with zeus and a customized tmux session
require 'zeus/rails'
ROOT_PATH = File.expand_path(Dir.pwd)
ENV_PATH = File.expand_path('spec/dummy/config/environment', ROOT_PATH)
BOOT_PATH = File.expand_path('spec/dummy/config/boot', ROOT_PATH)
APP_PATH = File.expand_path('spec/dummy/config/application', ROOT_PATH)
ENGINE_ROOT = File.expand_path(Dir.pwd)
ENGINE_PATH = File.expand_path('lib/thredded/engine', ENGINE_ROOT)
class CustomPlan < Zeus::Rails
end
Zeus.plan = CustomPlan.new
#!/bin/zsh
tmux has-session -t thredded_gem 2>/dev/null
if [ "$?" -eq 1 ] ; then
echo "Project not found. Creating and configuring."
# Set up primary window
tmux new-session -d -s thredded_gem
tmux rename-window "vim"
tmux send-keys -t 1 'vim .' Enter
tmux split-window -h -p 25
tmux select-pane -t 1
# Set up rails server and zeus
tmux neww -n servers
tmux select-window -t :2
tmux send-keys -t 1 'cd spec/dummy; rails s' Enter
tmux split-window -v -p 20
tmux send-keys -t 2 'zeus start' Enter
# Head back to primary window
tmux select-window -t :1
else
echo "Project found. Connecting."
fi
tmux attach-session -t thredded_gem
{
"command": "ruby -rubygems -r./custom_plan -eZeus.go",
"plan": {
"boot": {
"default_bundle": {
"development_environment": {
"prerake": {"rake": []},
"runner": ["r"],
"console": ["c"],
"server": ["s"],
"generate": ["g"],
"destroy": ["d"],
"dbconsole": []
},
"test_environment": {
"test_helper": {"test": ["rspec", "testrb"]}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment