Created
November 7, 2013 22:06
-
-
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
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
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 |
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
#!/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 |
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
{ | |
"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