workon_rails 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +69 -0
- data/Rakefile +1 -0
- data/bin/fix_windows.sh +17 -0
- data/bin/term +80 -0
- data/bin/window_funcs.inc +52 -0
- data/bin/work.sh +143 -0
- data/bin/workon +86 -0
- data/lib/workon_rails.rb +5 -0
- data/lib/workon_rails/version.rb +3 -0
- data/workon_rails.gemspec +23 -0
- metadata +104 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 2489a80605bd97d87ca720f19a84604ed9cfb239
|
4
|
+
data.tar.gz: a06864b3dd3d5ce3a5d286bf3930417d1314dd0b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 17593a0f1047d2151a65d40b7c71d06318fa64762dc2e6e7c7cb0a5f26c7a0f469d80d29e7f572750239c2b6012ea61b76686fbc3d1f624c6d0f40ebf414ae10
|
7
|
+
data.tar.gz: c6cafb0376e1b96e5f8b71a9d0d865dc19ddd3006feeb4ec1551dffad5b6211cc7b9b3f26a8c98f8103e8b541ebaf6900f461f46f1074450bb01d3fe13b7ef66
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 David Furber
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
# Workon
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'workon_rails', group: :development
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install workon_rails
|
18
|
+
|
19
|
+
|
20
|
+
The first time you run workon from your project root, it creates a .workon file with default configuration.
|
21
|
+
|
22
|
+
## Usage
|
23
|
+
|
24
|
+
Start your project for editing:
|
25
|
+
|
26
|
+
$ workon
|
27
|
+
|
28
|
+
Set your editor to RubyMine. Any valid editor command will do.
|
29
|
+
|
30
|
+
$ workon set editor=mine
|
31
|
+
|
32
|
+
Show configuration:
|
33
|
+
|
34
|
+
$ workon config
|
35
|
+
|
36
|
+
Tell workon what page to open in the browser to start your project:
|
37
|
+
|
38
|
+
$ workon set domain=mysite.test
|
39
|
+
|
40
|
+
OPTIONAL: Set your Pivotal Tracker project ID:
|
41
|
+
|
42
|
+
$ workon set tracker_id=TRACKER_ID
|
43
|
+
|
44
|
+
OPTIONAL: Set your GitHub repo so that Workon can open it in the browser. OPTIONAL
|
45
|
+
|
46
|
+
$ workon set github=singlebrook/swidjit
|
47
|
+
|
48
|
+
OPTIONAL: Set the URL of your ActiveCollab installation and your project name. Get the project name by going to your project in ActiveCollab and copying the part of the URL that comes after /projects/.
|
49
|
+
|
50
|
+
$ workon set ac_url=support.gorges.us
|
51
|
+
$ workon set ac=my-project-name
|
52
|
+
|
53
|
+
OPTIONAL: Tell Workon to move the project windows. Depends on SizeUp.
|
54
|
+
|
55
|
+
$ workon set move_windows=yes :
|
56
|
+
|
57
|
+
## Contributing
|
58
|
+
|
59
|
+
1. Fork it
|
60
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
61
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
62
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
63
|
+
5. Create new Pull Request
|
64
|
+
|
65
|
+
## DESIRED CHANGES
|
66
|
+
|
67
|
+
I don't actually use the SizeUp window positioning. It would be nice if somebody made that work and added the ability to configure where your windows open using the config vars.
|
68
|
+
|
69
|
+
Also the default browser is Google Chrome. That's good enough for me. If you want it to use Firefox, I'm open to a pull request.
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/bin/fix_windows.sh
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
source $CMD_PATH/window_funcs.inc
|
4
|
+
|
5
|
+
# Place git window
|
6
|
+
focus_terminal_window "$APP_NAME"
|
7
|
+
move_front_window "Terminal" "Second Monitor"
|
8
|
+
move_front_window "Terminal" "Lower Right"
|
9
|
+
|
10
|
+
# Place Guard window
|
11
|
+
focus_terminal_window "Spork"
|
12
|
+
move_front_window "Terminal" "Second Monitor"
|
13
|
+
move_front_window "Terminal" "Upper Left"
|
14
|
+
|
15
|
+
# Place Sublime Text 2 window
|
16
|
+
move_front_window "Sublime Text 2" "Second Monitor"
|
17
|
+
move_front_window "Sublime Text 2" "Upper Right"
|
data/bin/term
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
#
|
3
|
+
# Open a new Mac OS X terminal window or tab in the current or another
|
4
|
+
# directory and optionally run a command in the new window or tab.
|
5
|
+
#
|
6
|
+
# - Without any arguments, the new terminal window opens in
|
7
|
+
# the current directory, i.e. the executed command is "cd $PWD".
|
8
|
+
# - If the first argument is a directory, the new terminal will "cd" into
|
9
|
+
# that directory before executing the remaining arguments as command.
|
10
|
+
# - The optional "-t" flag executes the command in a new tab
|
11
|
+
# instead of a new window.
|
12
|
+
# - The optional "-x" flag closes the new window or tab
|
13
|
+
# after the executed command finishes.
|
14
|
+
# - The optional "-p" flag takes an argument of the form x,y (e.g. 40,50) and
|
15
|
+
# positions the terminal window to the indicated location on the screen
|
16
|
+
# - The optional "-s" flag takes an argument of the form w,h (e.g. 800,400) and
|
17
|
+
# resizes the terminal window to the indicated width and height in pixels.
|
18
|
+
#
|
19
|
+
# Written by Marc Liyanage <http://www.entropy.ch>
|
20
|
+
#
|
21
|
+
# Version 2.1
|
22
|
+
#
|
23
|
+
|
24
|
+
set -e
|
25
|
+
|
26
|
+
while getopts xtrp:s: OPTION; do
|
27
|
+
[ $OPTION = "x" ] && { EXIT='; exit'; }
|
28
|
+
[ $OPTION = "t" ] && { TAB=1; }
|
29
|
+
[ $OPTION = "p" ] && { POSITION="set position of window 1 to {$OPTARG}"; }
|
30
|
+
[ $OPTION = "s" ] && { SIZE="set size of window 1 to {$OPTARG}"; }
|
31
|
+
[ $OPTION = "r" ] && { RETURN=1; }
|
32
|
+
done
|
33
|
+
|
34
|
+
for (( $OPTIND; $OPTIND-1; OPTIND=$OPTIND-1 )); do shift; done
|
35
|
+
|
36
|
+
if [[ -d "$1" ]]; then WD=$(cd "$1"; pwd); shift; else WD=$PWD; fi
|
37
|
+
|
38
|
+
|
39
|
+
COMMAND="cd '$WD' && echo -n \$'\\\\ec';"
|
40
|
+
for i in "$@"; do
|
41
|
+
COMMAND="$COMMAND '$i'"
|
42
|
+
done
|
43
|
+
|
44
|
+
if [ $TAB ]; then
|
45
|
+
|
46
|
+
osascript 2>/dev/null <<EOF
|
47
|
+
tell application "System Events"
|
48
|
+
tell process "Terminal" to keystroke "t" using command down
|
49
|
+
end
|
50
|
+
tell application "Terminal"
|
51
|
+
activate
|
52
|
+
do script with command "$COMMAND $EXIT" in window 1
|
53
|
+
$POSITION
|
54
|
+
$SIZE
|
55
|
+
end tell
|
56
|
+
EOF
|
57
|
+
|
58
|
+
if [ $RETURN ]; then
|
59
|
+
osascript 2>/dev/null <<EOF
|
60
|
+
tell application "Terminal"
|
61
|
+
activate
|
62
|
+
tell application "System Events"
|
63
|
+
keystroke (ASCII character 28) using {command down, option down}
|
64
|
+
end tell
|
65
|
+
end tell
|
66
|
+
EOF
|
67
|
+
fi
|
68
|
+
|
69
|
+
else
|
70
|
+
|
71
|
+
osascript <<EOF
|
72
|
+
tell application "Terminal"
|
73
|
+
activate
|
74
|
+
do script with command "$COMMAND $EXIT"
|
75
|
+
$POSITION
|
76
|
+
$SIZE
|
77
|
+
end tell
|
78
|
+
EOF
|
79
|
+
|
80
|
+
fi
|
@@ -0,0 +1,52 @@
|
|
1
|
+
focus_terminal_window() {
|
2
|
+
local search_string=$1
|
3
|
+
|
4
|
+
local focus_script="
|
5
|
+
tell application \"Terminal\"
|
6
|
+
repeat with w in windows
|
7
|
+
if custom title of w contains \"$search_string\" then
|
8
|
+
set frontmost of w to true
|
9
|
+
end if
|
10
|
+
end repeat
|
11
|
+
end tell
|
12
|
+
"
|
13
|
+
osascript -e "$focus_script"
|
14
|
+
}
|
15
|
+
|
16
|
+
move_front_window() {
|
17
|
+
local app=$1
|
18
|
+
local location=$2
|
19
|
+
|
20
|
+
if [ "$location" == "Second Monitor" ]; then
|
21
|
+
# Make sure window is on primary monitor to begin with
|
22
|
+
move_front_window_to_primary_monitor "$app"
|
23
|
+
location="Prev Monitor"
|
24
|
+
fi
|
25
|
+
|
26
|
+
osascript -e "
|
27
|
+
tell application \"$app\" to activate
|
28
|
+
tell application \"System Events\"
|
29
|
+
tell application \"SizeUp\" to do action $location
|
30
|
+
end tell
|
31
|
+
"
|
32
|
+
}
|
33
|
+
|
34
|
+
move_front_window_to_primary_monitor() {
|
35
|
+
local app=$1
|
36
|
+
osascript -e "tell application \"$app\" to set bounds of front window to {0,0,500,500}" &> /dev/null || true
|
37
|
+
}
|
38
|
+
|
39
|
+
zoom() {
|
40
|
+
local app=$1
|
41
|
+
local zoom_applescript="tell application \"$app\" to activate
|
42
|
+
tell application \"System Events\"
|
43
|
+
tell process \"$app\"
|
44
|
+
tell menu bar 1
|
45
|
+
tell menu \"Window\"
|
46
|
+
click menu item \"Zoom\"
|
47
|
+
end tell
|
48
|
+
end tell
|
49
|
+
end tell
|
50
|
+
end tell"
|
51
|
+
osascript -e "$zoom_applescript"
|
52
|
+
}
|
data/bin/work.sh
ADDED
@@ -0,0 +1,143 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
#
|
3
|
+
# work.sh
|
4
|
+
# Leon Miller-Out - leon@singlebrook.com
|
5
|
+
#
|
6
|
+
# Fires up everything I need to work on a Rails app.
|
7
|
+
#
|
8
|
+
# SETUP
|
9
|
+
# - put Pivotal Tracker project ID in .pivotal_tracker_id
|
10
|
+
#
|
11
|
+
# DEPENDENCIES
|
12
|
+
# - OS X
|
13
|
+
# - SizeUp (optional - you have to run "workon set move_windows=yes")
|
14
|
+
# - Sublime Text 2 (optional - defaults to RubyMine, you can run "workon set editor=st")
|
15
|
+
# - bundle command in your path
|
16
|
+
# - git command in your path
|
17
|
+
# - term script (included in distribution)
|
18
|
+
#
|
19
|
+
# TODO
|
20
|
+
# * Project-specific TCP ports
|
21
|
+
# * Use user's default browser instead of Chrome. It's hard to figure out what the
|
22
|
+
# default browser is on OS X. We have the workaround of setting BROWSER in the
|
23
|
+
# env, but it doesn't work properly with Firefox.
|
24
|
+
# /Applications/Firefox.app/Contents/MacOS/firefox-bin <url> will open in Firefox, so that
|
25
|
+
# may be a workaround, except how to position the window?
|
26
|
+
|
27
|
+
set -e
|
28
|
+
|
29
|
+
# Detect paths and set up variables for various commands
|
30
|
+
CMD_BIN=`echo $0`
|
31
|
+
echo $CMD_BIN
|
32
|
+
CMD_PATH=`dirname $CMD_BIN`
|
33
|
+
TERM=$CMD_PATH/term
|
34
|
+
|
35
|
+
if [ "$WORKON_MOVE_WINDOWS" == "yes" ]; then
|
36
|
+
source $CMD_PATH/window_funcs.inc
|
37
|
+
fi
|
38
|
+
|
39
|
+
if [ "$WORKON_BROWSER" == "" ]; then
|
40
|
+
WORKON_BROWSER="Google Chrome"
|
41
|
+
fi
|
42
|
+
|
43
|
+
BROWSER_CMD='open'
|
44
|
+
# if [[ "$WORKON_BROWSER" == 'Firefox' ]]; then
|
45
|
+
# BROWSER_CMD='/Applications/Firefox.app/Contents/MacOS/firefox-bin'
|
46
|
+
# fi
|
47
|
+
|
48
|
+
if [ -f Gemfile ]; then
|
49
|
+
echo "Checking gem dependencies"
|
50
|
+
bundle check
|
51
|
+
if [ $? -ne 0 ]; then
|
52
|
+
bundle
|
53
|
+
fi
|
54
|
+
fi
|
55
|
+
|
56
|
+
# Find an available port
|
57
|
+
PORT=3000
|
58
|
+
while [[ PORT -lt 3010 ]]; do
|
59
|
+
PORT_IN_USE=`netstat -an | grep LISTEN | grep $PORT | wc -l`
|
60
|
+
if [[ PORT_IN_USE -eq 0 ]]; then
|
61
|
+
# Port is available
|
62
|
+
break
|
63
|
+
fi
|
64
|
+
PORT=`expr $PORT + 1`
|
65
|
+
done
|
66
|
+
if [[ $PORT -eq 3010 ]]; then
|
67
|
+
echo "No ports between 3000 and 3010 available"
|
68
|
+
exit 1
|
69
|
+
fi
|
70
|
+
if [ -f Procfile ]; then
|
71
|
+
echo "Starting Foreman"
|
72
|
+
RAILS_CMD="env PORT=$PORT foreman start"
|
73
|
+
elif [ -f script/server ]; then
|
74
|
+
echo "Starting Rails 2"
|
75
|
+
RAILS_CMD="bundle exec script/server -p $PORT"
|
76
|
+
else
|
77
|
+
echo "Starting Rails"
|
78
|
+
RAILS_CMD="bundle exec rails server -p $PORT"
|
79
|
+
fi
|
80
|
+
$TERM -r -t $RAILS_CMD > /dev/null
|
81
|
+
|
82
|
+
# GIT WINDOW POSITION
|
83
|
+
if [[ "$WORKON_MOVE_WINDOWS" == "yes" ]]; then
|
84
|
+
move_front_window "Terminal" "Second Monitor"
|
85
|
+
move_front_window "Terminal" "Lower Right"
|
86
|
+
fi
|
87
|
+
|
88
|
+
if [ -f Guardfile ]; then
|
89
|
+
echo "Starting Guard"
|
90
|
+
$TERM -r -t bundle exec guard -c > /dev/null
|
91
|
+
if [[ "$WORKON_MOVE_WINDOWS" == "yes" ]]; then
|
92
|
+
move_front_window "Terminal" "Second Monitor"
|
93
|
+
move_front_window "Terminal" "Upper Left"
|
94
|
+
fi
|
95
|
+
fi
|
96
|
+
|
97
|
+
echo "Opening project in RubyMine"
|
98
|
+
$WORKON_EDITOR .
|
99
|
+
sleep 1
|
100
|
+
if [[ "$WORKON_MOVE_WINDOWS" == "yes" ]]; then
|
101
|
+
move_front_window "Sublime Text 2" "Second Monitor"
|
102
|
+
move_front_window "Sublime Text 2" "Upper Right"
|
103
|
+
fi
|
104
|
+
|
105
|
+
# Make sure we've got a browser window on the current desktop
|
106
|
+
osascript -e "tell application \"$WORKON_BROWSER\" to make new window" > /dev/null
|
107
|
+
if [ "$WORKON_MOVE_WINDOWS" == "yes" ]; then
|
108
|
+
move_front_window_to_primary_monitor "$BROWSER"
|
109
|
+
move_front_window "$BROWSER" "Full Screen"
|
110
|
+
fi
|
111
|
+
|
112
|
+
# Open AC page for project
|
113
|
+
if [[ "$WORKON_AC_URL" != "" && "$WORKON_AC" !="" ]]; then
|
114
|
+
echo "Opening ActiveCollab project"
|
115
|
+
$BROWSER_CMD https://$WORKON_AC_URL/projects/$WORKON_AC/tasks
|
116
|
+
fi
|
117
|
+
|
118
|
+
if [[ "$WORKON_TRACKER_ID" != "" ]]; then
|
119
|
+
echo "Opening Tracker project"
|
120
|
+
$BROWSER_CMD https://www.pivotaltracker.com/projects/$WORKON_TRACKER_ID
|
121
|
+
fi
|
122
|
+
|
123
|
+
if [[ "$GITHUB_REPO" != "" ]]; then
|
124
|
+
echo "Opening Github repo"
|
125
|
+
$BROWSER_CMD https://github.com/$GITHUB_REPO
|
126
|
+
fi
|
127
|
+
|
128
|
+
osascript -e "tell application \"Terminal\" to activate"
|
129
|
+
|
130
|
+
echo "Waiting for local site to come up..."
|
131
|
+
|
132
|
+
# Open the local site once it's up and running
|
133
|
+
SITE_AVAILABLE=0
|
134
|
+
while [[ SITE_AVAILABLE -eq 0 ]]; do
|
135
|
+
SITE_AVAILABLE=`netstat -an | grep LISTEN | grep $PORT | wc -l`
|
136
|
+
sleep 1
|
137
|
+
done
|
138
|
+
echo "Opening local site"
|
139
|
+
PROJECT_FOLDER=`pwd | sed 's:.*/::' | sed 's/_//g'`
|
140
|
+
$BROWSER_CMD http://$WORKON_DOMAIN:$PORT
|
141
|
+
|
142
|
+
# Clean up that empty browser tab
|
143
|
+
osascript -e "tell application \"$WORKON_BROWSER\" to close first tab of front window"
|
data/bin/workon
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
#!/usr/bin/env ruby_noexec_wrapper
|
2
|
+
|
3
|
+
require 'yaml'
|
4
|
+
|
5
|
+
def write_config(file, config)
|
6
|
+
File.open(file, 'w+') do |file|
|
7
|
+
file.write config.to_yaml
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def run_command(cmd, config={})
|
12
|
+
config.each do |key, value|
|
13
|
+
ENV["WORKON_#{key.upcase}"] = value
|
14
|
+
end
|
15
|
+
path = File.dirname __FILE__
|
16
|
+
cmd = File.join path, cmd
|
17
|
+
puts "Executing #{cmd}"
|
18
|
+
system cmd
|
19
|
+
end
|
20
|
+
|
21
|
+
def start_working(config)
|
22
|
+
run_command 'work.sh', config
|
23
|
+
end
|
24
|
+
|
25
|
+
dot_file_name = '.workon'
|
26
|
+
if File.exists?(dot_file_name)
|
27
|
+
config = YAML::load File.open(dot_file_name).read
|
28
|
+
else
|
29
|
+
config = { 'editor' => 'mine' }
|
30
|
+
config['domain'] = "#{`pwd`.strip.split('/').last}.test"
|
31
|
+
write_config(dot_file_name, config)
|
32
|
+
end
|
33
|
+
|
34
|
+
|
35
|
+
command = ARGV.shift
|
36
|
+
|
37
|
+
if command
|
38
|
+
case command
|
39
|
+
when 'help'
|
40
|
+
puts "Workon Command Help"
|
41
|
+
puts "workon : Starts your project for editing.\n"
|
42
|
+
puts "workon start : Also starts your project.\n"
|
43
|
+
puts "workon set editor=mine : sets your editor to RubyMine. Any valid editor command will do.\n"
|
44
|
+
puts "workon set domain=mysite.test : tells workon what page to open in the browser to start your project\n"
|
45
|
+
puts "workon set tracker_id=TRACKER_ID\n"
|
46
|
+
puts "workon set github=GITHUB_REPO : i.e. singlebrook/project\n"
|
47
|
+
puts "workon set ac_url=support.gorges.us : set only if you use ActiveCollab\n"
|
48
|
+
puts "workon set ac=my-project-name : tells workon the project URL part on ActiveCollab\n"
|
49
|
+
puts "workon config : show config vars\n"
|
50
|
+
puts "workon set browser='Firefox'\n" # Doesn't have any effect yet.
|
51
|
+
puts "workon set move_windows=yes : tells workon to move the project windows. Depends on SizeUp\n"
|
52
|
+
when 'set'
|
53
|
+
settable = ARGV.shift
|
54
|
+
if settable
|
55
|
+
key, value = settable.split('=')
|
56
|
+
unless key and value
|
57
|
+
puts "Both config var and value need to be specified.\n"
|
58
|
+
Kernel.exit
|
59
|
+
end
|
60
|
+
unless %w{editor domain ac ac_url browser move_windows tracker_id github_repo}.include?(key)
|
61
|
+
puts "Invalid config var."
|
62
|
+
Kernel.exit
|
63
|
+
end
|
64
|
+
config.merge! key => value
|
65
|
+
write_config(dot_file_name, config)
|
66
|
+
else
|
67
|
+
puts "You need to specify which config var to set."
|
68
|
+
Kernel.exit
|
69
|
+
end
|
70
|
+
when 'config'
|
71
|
+
config.each do |key,value|
|
72
|
+
line = key.dup
|
73
|
+
0.upto(20-key.length) { line << ' ' }
|
74
|
+
line << ": #{value}\n"
|
75
|
+
puts line
|
76
|
+
end
|
77
|
+
when 'start'
|
78
|
+
start_working(config)
|
79
|
+
when 'fix'
|
80
|
+
ENV['CMD_PATH'] = path = File.dirname __FILE__
|
81
|
+
ENV['APP_NAME'] = `basename $PWD`
|
82
|
+
run_command 'fix_windows.sh'
|
83
|
+
end
|
84
|
+
else
|
85
|
+
start_working(config)
|
86
|
+
end
|
data/lib/workon_rails.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'workon_rails/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "workon_rails"
|
8
|
+
spec.version = WorkonRails::VERSION
|
9
|
+
spec.authors = ["David Furber", "Leon Miller-Out"]
|
10
|
+
spec.email = ["furberd@gmail.com"]
|
11
|
+
spec.description = %q{Opens project in RubyMine, starts guard, starts Rails server.}
|
12
|
+
spec.summary = %q{Go to your project folder and type workon.}
|
13
|
+
spec.homepage = ""
|
14
|
+
spec.license = "MIT"
|
15
|
+
spec.executables = ["workon", "fix_windows.sh", "term", "work.sh"]
|
16
|
+
|
17
|
+
spec.files = `git ls-files`.split($/)
|
18
|
+
spec.require_paths = ["lib"]
|
19
|
+
|
20
|
+
spec.add_dependency "foreman"
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,104 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: workon_rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- David Furber
|
8
|
+
- Leon Miller-Out
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-11-08 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: foreman
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - '>='
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '0'
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - '>='
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '0'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: bundler
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ~>
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '1.3'
|
35
|
+
type: :development
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ~>
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '1.3'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: rake
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - '>='
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
type: :development
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - '>='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
description: Opens project in RubyMine, starts guard, starts Rails server.
|
57
|
+
email:
|
58
|
+
- furberd@gmail.com
|
59
|
+
executables:
|
60
|
+
- workon
|
61
|
+
- fix_windows.sh
|
62
|
+
- term
|
63
|
+
- work.sh
|
64
|
+
extensions: []
|
65
|
+
extra_rdoc_files: []
|
66
|
+
files:
|
67
|
+
- .gitignore
|
68
|
+
- Gemfile
|
69
|
+
- LICENSE.txt
|
70
|
+
- README.md
|
71
|
+
- Rakefile
|
72
|
+
- bin/fix_windows.sh
|
73
|
+
- bin/term
|
74
|
+
- bin/window_funcs.inc
|
75
|
+
- bin/work.sh
|
76
|
+
- bin/workon
|
77
|
+
- lib/workon_rails.rb
|
78
|
+
- lib/workon_rails/version.rb
|
79
|
+
- workon_rails.gemspec
|
80
|
+
homepage: ''
|
81
|
+
licenses:
|
82
|
+
- MIT
|
83
|
+
metadata: {}
|
84
|
+
post_install_message:
|
85
|
+
rdoc_options: []
|
86
|
+
require_paths:
|
87
|
+
- lib
|
88
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
|
+
- - '>='
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '0'
|
93
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - '>='
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
98
|
+
requirements: []
|
99
|
+
rubyforge_project:
|
100
|
+
rubygems_version: 2.0.3
|
101
|
+
signing_key:
|
102
|
+
specification_version: 4
|
103
|
+
summary: Go to your project folder and type workon.
|
104
|
+
test_files: []
|