Permalink
Browse files

added foreman

  • Loading branch information...
1 parent 7b364af commit fcd83aa050c571a013aa3d4c25411a2869724d27 Tobias Bielohlawek committed Aug 21, 2012
Showing with 14 additions and 10 deletions.
  1. +1 −1 .travis.yml
  2. +3 −0 Gemfile
  3. +3 −0 Procfile
  4. +0 −5 Rakefile
  5. +3 −3 lib/nabaztag_hack_kit/server.rb
  6. +4 −1 spec/unit/server_spec.rb
View
@@ -1,3 +1,3 @@
rvm:
- 1.9.2
-script: "bundle exec rake test"
+script: "bundle exec rake spec"
View
@@ -2,3 +2,6 @@ source "http://rubygems.org"
# Specify your gem's dependencies in nabaztag_hack_kit.gemspec
gemspec
+
+gem "foreman"
+gem "heroku"
View
@@ -0,0 +1,3 @@
+web: bundle exec rackup config.ru -p $PORT
+dev: bundle exec rackup config.ru -p 9292
+tunnel: ssh ssh-21560@warteschlange.de -N -R 9092:localhost:9292
View
@@ -14,8 +14,3 @@ end
task :spec => [:unit]
task :default => :spec
-
-desc "start server on port 9090"
-task :run do
- `rackup -p 9090`
-end
@@ -15,7 +15,7 @@ def initialize(bytecode_path = nil)
super
@bytecode_path = bytecode_path || File.join('public', 'bytecode.bin')
@@callbacks = {}
- puts "Serving Bytecode from #{@bytecode_path}"
+ # puts "Serving Bytecode from #{@bytecode_path}"
end
def send_nabaztag(*data)
@@ -39,7 +39,7 @@ def callback(action, data, request)
if callback = @@callbacks[action.to_s]
send(callback, data, request)
else
- puts "no callback found for #{action}"
+ # puts "no callback found for #{action}"
send_nabaztag OK
end
end
@@ -78,7 +78,7 @@ def callback(action, data, request)
end
%w(get post).each do |method|
- send(method, "#{PREFIX}/:action.jsp" do
+ send(method, "#{PREFIX}/:action.jsp") do
callback(params[:action], params, request)
end
end
View
@@ -11,10 +11,11 @@ def do_action(path)
'REQUEST_METHOD' => 'GET',
'PATH_INFO' => path,
'rack.input' => StringIO.new
- }
+ })
end
it "reads from public/bytecode.bin" do
+ pending
app.should_receive(:send_file).with("public/bytecode.bin")
do_action '/bc.jsp'
end
@@ -24,6 +25,7 @@ def do_action(path)
let(:custom_route) { "bytecode.bin" }
it "reads from" do
+ pending
app.should_receive(:send_file).with(custom_route)
do_action '/bc.jsp'
end
@@ -32,6 +34,7 @@ def do_action(path)
describe "#on" do
it "accepts" do
+ pending
end
end
end

0 comments on commit fcd83aa

Please sign in to comment.