-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
24 lines (21 loc) · 909 Bytes
/
Rakefile
File metadata and controls
24 lines (21 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# This is to simplfy app development
# Note: guard-process does not work reliably on newer bundler and the autoreload in shiny is very fast so
# using that and just helping with the guard to touch app.R for a full reload of the app sources
# Installation:
# - check for Ruby: ruby --version
# - install Bundler: gem install bundler
# - install Gems: bundle install
# How to use:
# - start 2 terminals
# - terminal 1: rake dev
# - terminal 2: rake guard
desc "run the shiny app in development mode"
task :dev do
puts "*** REMEMBER to start `rake guard` in a separate terminal for auto-reload"
cmd = "rm(list = ls()); Sys.setenv('LOG_LEVEL' = 'DEBUG'); shiny::devmode(TRUE); options(shiny.autoreload.pattern = 'app.R'); shiny::runApp('app.R', port = 4444)"
sh "R -e \"#{cmd}\""
end
desc "watch for source changes to trigger shiny's auto-reload"
task :guard do
sh "bundle exec guard"
end