Skip to content

Commit be1158d

Browse files
committed
Add some badges & convenience methods.
1 parent 3511199 commit be1158d

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Zhong
1+
# Zhong [![Build Status](https://travis-ci.org/nickelser/zhong.svg?branch=master)](https://travis-ci.org/nickelser/zhong) [![Code Climate](https://codeclimate.com/github/nickelser/zhong/badges/gpa.svg)](https://codeclimate.com/github/nickelser/zhong) [![Test Coverage](https://codeclimate.com/github/nickelser/zhong/badges/coverage.svg)](https://codeclimate.com/github/nickelser/zhong) [![Gem Version](https://badge.fury.io/rb/zhong.svg)](http://badge.fury.io/rb/zhong)
22

33
Useful, reliable distributed cron. Tired of your cron-like scheduler running key jobs twice? Would you like to be able to run your cron server on multiple machines and have it "just work"? Have we got the gem for you.
44

lib/zhong/web.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ class Web < Sinatra::Base
1616
end
1717
end
1818

19+
if ENV["RACK_ENV"] == "development"
20+
before do
21+
STDERR.puts "[params] #{params}" unless params.empty?
22+
end
23+
end
24+
1925
set :root, File.expand_path(File.dirname(__FILE__) + "/../../web")
2026
set :public_folder, proc { "#{root}/assets" }
2127
set :views, proc { "#{root}/views" }
@@ -67,7 +73,6 @@ def safe_mget(keys)
6773
{}
6874
end
6975
end
70-
7176
end
7277
end
7378

test/scheduler_test.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ def test_scheduler
2020
every(3.seconds, "test_two") { test_two_counter += 1 }
2121
end
2222

23-
Thread.new { Zhong.start }
23+
t = Thread.new { Zhong.start }
2424
sleep(7)
2525
Zhong.stop
26+
t.join
2627
assert_equal 1, test_one_counter
2728
assert_equal 3, test_two_counter
2829
end

0 commit comments

Comments
 (0)