whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sam Ruby <ru...@apache.org>
Subject [whimsy.git] [1/2] Commit f22dfc1: Facilitate local testing
Date Sat, 13 Feb 2016 14:26:26 GMT
Commit f22dfc1c7361fcf4de7626db33591e4518db7620:
    Facilitate local testing


Branch: refs/heads/master
Author: Sam Ruby <rubys@intertwingly.net>
Committer: Sam Ruby <rubys@intertwingly.net>
Pusher: rubys <rubys@apache.org>

------------------------------------------------------------
www/roster/Gemfile                                           | ++++ ----
www/roster/README                                            | +++ 
www/roster/Rakefile                                          | +++++++++++++ 
------------------------------------------------------------
37 changes: 33 additions, 4 deletions.
------------------------------------------------------------


diff --git a/www/roster/Gemfile b/www/roster/Gemfile
index 60444fc..d7127d4 100644
--- a/www/roster/Gemfile
+++ b/www/roster/Gemfile
@@ -16,9 +16,9 @@ gem 'wunderbar', '>= 1.0.0'
 gem 'ruby2js', '>= 2.0.0'
 gem 'sinatra'
 gem 'nokogumbo'
-gem 'execjs', ('<2.5.1' if RUBY_VERSION =~ /^1/)
-gem 'listen', ('~> 2.10' if RUBY_VERSION =~ /^1/)
+gem 'execjs'
 
-group :demo do
-  gem 'puma'
+group :development do
+  gem 'passenger'
+  gem 'listen'
 end
diff --git a/www/roster/README b/www/roster/README
new file mode 100644
index 0000000..578fec1
--- /dev/null
+++ b/www/roster/README
@@ -0,0 +1,3 @@
+To test locally, run:
+
+    rake server
diff --git a/www/roster/Rakefile b/www/roster/Rakefile
new file mode 100644
index 0000000..323029b
--- /dev/null
+++ b/www/roster/Rakefile
@@ -0,0 +1,26 @@
+require 'bundler'
+Bundler.require(:default, :development)
+
+task :server => :listen do
+  ENV['RACK_ENV']='development'
+  sh 'passenger start'
+end
+
+task :listen do
+  dirs = [
+    File.expand_path('..', File.realpath(__FILE__)),
+    File.expand_path('../../../lib', File.realpath(__FILE__))
+  ]
+
+  listener = Listen.to(*dirs) do |modified, added, removed|
+    puts "detected update: #{(modified + added + removed).join(', ')}"
+    FileUtils.touch "#{dirs.first}/tmp/restart.txt"
+  end
+
+  listener.ignore /~$/
+  listener.ignore /^\..*\.sw\w$/
+  listener.ignore /passenger.\d+\.(log|pid(\.lock)?)$/
+
+  listener.start
+end
+

Mime
View raw message