public
Description: i like robots
Clone URL: git://github.com/relevance/robotics.git
stuff
rsanheim (author)
Sat Apr 26 22:39:15 -0700 2008
commit  05beaf54b803d326033d1eca00717d1f28ec7c8b
tree    186eae29dd1933526baa77eb482ac5fb8e84fcf3
parent  9b29da8d5996b5da2dd1c2b1e86537c5c945b072
...
1
 
 
 
2
3
4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
 
1
2
3
4
 
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
0
@@ -1,3 +1,21 @@
0
-class Robotics
0
+require 'sinatra'
0
+require File.join(File.dirname(__FILE__), *%w[.. vendor github_hook lib github_hook])
0
+module Robotics
0
   VERSION = '1.0.0'
0
-end
0
\ No newline at end of file
0
+
0
+ post "/push" do
0
+ @hook = GithubHook.new(params[:payload])
0
+ Bulder.new(@hook)
0
+ end
0
+
0
+ class Builder
0
+ attr_reader
0
+ def initialize(hook)
0
+ @hook = hook
0
+
0
+ end
0
+
0
+ end
0
+
0
+end
0
+
...
 
 
 
 
 
 
 
 
 
 
 
 
 
0
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
0
@@ -0,0 +1,13 @@
0
+require File.join(File.dirname(__FILE__), *%w[helper])
0
+
0
+describe "Robotics" do
0
+ it "wraps the json payload" do
0
+ GithubHook.expects(:new).with("{'foo':'bar'}")
0
+ post_it '/push', 'payload' => "{'foo':'bar'}"
0
+ end
0
+
0
+ it "processes the hook" do
0
+ Robotics::Builder.expects(:new).with(GithubHook.new(%[{ "hello" : "world" }]))
0
+ post_it '/push', 'payload' => %[{ "hello" : "world" }]
0
+ end
0
+end
0
\ No newline at end of file

Comments

    No one has commented yet.