Skip to content

Commit e3c42fe

Browse files
unknownunknown
unknown
authored and
unknown
committed
Add sample Sinatra robot as sample
1 parent 5b993ff commit e3c42fe

File tree

4 files changed

+17
-42
lines changed

4 files changed

+17
-42
lines changed

README

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ Status:
55

66
* Unit tests pass.
77

8-
* samples and robot.rb not yet ported from Python to Ruby.
9-
108
* Instructions for use with Sinatra + JRuby + AppEngine:
119
http://blog.inigral.com/2009/06/07/a-google-wave-robot-container-in-sinatra/
1210

samples

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
require 'lib/waveapi/init'
2+
3+
class Robot < AbstractRobot
4+
set_name "Sinatra Bot"
5+
add_cron :clock, 20
6+
7+
def DOCUMENT_CHANGED(properties, context)
8+
wavelet = context.GetWavelets[0]
9+
blip = context.GetBlipById(wavelet.GetRootBlipId())
10+
blip.GetDocument.SetText('Only I get to edit the top blip!')
11+
end
12+
def clock(event, context)
13+
wavelet = context.GetWavelets[0]
14+
blip = context.GetBlipById(wavelet.GetRootBlipId())
15+
blip.GetDocument.SetText("It's " + Time.now.to_s)
16+
end
17+
end

samples/dummy/app.yaml

Lines changed: 0 additions & 9 deletions
This file was deleted.

samples/dummy/dummy.rb

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)