forked from hybridgroup/kidsruby
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce Guard, hook up buttons to ace editor, style buttons.
- Loading branch information
Showing
9 changed files
with
117 additions
and
28 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ tmp | |
nbproject | ||
.DS_Store | ||
*.swp | ||
kidsruby.pid |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,33 @@ | ||
GEM | ||
remote: http://rubygems.org/ | ||
specs: | ||
ffi (1.0.10) | ||
guard (0.8.7) | ||
thor (~> 0.14.6) | ||
htmlentities (4.2.3) | ||
mime-types (1.16) | ||
mocha (0.9.10) | ||
rake | ||
qtbindings (4.6.3.4) | ||
rake (0.8.7) | ||
rb-fchange (0.0.5) | ||
ffi | ||
rb-fsevent (0.4.3.1) | ||
rb-inotify (0.8.8) | ||
ffi (>= 0.5.0) | ||
rest-client (1.6.1) | ||
mime-types (>= 1.16) | ||
thor (0.14.6) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
guard | ||
htmlentities | ||
mocha | ||
qtbindings | ||
rb-fchange | ||
rb-fsevent | ||
rb-inotify | ||
rest-client |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# A sample Guardfile | ||
# More info at https://github.com/guard/guard#readme | ||
|
||
# Add files and commands to this file, like the example: | ||
# watch('file/path') { `command(s)` } | ||
# | ||
guard 'shell' do | ||
watch(%r{app/}) { restart_kidsruby } | ||
watch(%r{lib/}) { restart_kidsruby } | ||
watch(%r{public/}) { restart_kidsruby } | ||
watch('main.rb') { restart_kidsruby } | ||
|
||
def restart_kidsruby | ||
stop_kidsruby | ||
start_kidsruby | ||
end | ||
|
||
def stop_kidsruby | ||
kill_kidsruby | ||
cleanup_pid_file | ||
end | ||
|
||
def kill_kidsruby | ||
Process.kill("HUP", pid.to_i) | ||
end | ||
|
||
def cleanup_pid_file | ||
File.delete(pid_file) if File.exists?(pid_file) | ||
end | ||
|
||
def start_kidsruby | ||
store_pid(kidsruby_process) | ||
end | ||
|
||
def store_pid(process) | ||
File.open(pid_file, 'w+') { |f| f.puts process.pid } | ||
end | ||
|
||
def kidsruby_process | ||
IO.popen('ruby main.rb', 'r') | ||
end | ||
|
||
def pid | ||
File.read(pid_file) if File.exists?(pid_file) | ||
end | ||
|
||
def pid_file | ||
'./tmp/kidsruby.pid' | ||
end | ||
|
||
at_exit { cleanup_pid_file } | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
class Runner < Qt::Process | ||
def initialize(main) | ||
super | ||
|
||
@main_widget = main | ||
end | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,4 +46,4 @@ def initialize(r) | |
def valid? | ||
@error == false | ||
end | ||
end | ||
end |
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
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
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