Skip to content
This repository has been archived by the owner on Oct 5, 2023. It is now read-only.

Commit

Permalink
added foreman
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Bielohlawek committed Aug 21, 2012
1 parent 7b364af commit fcd83aa
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
@@ -1,3 +1,3 @@
rvm:
- 1.9.2
script: "bundle exec rake test"
script: "bundle exec rake spec"
3 changes: 3 additions & 0 deletions Gemfile
Expand Up @@ -2,3 +2,6 @@ source "http://rubygems.org"

# Specify your gem's dependencies in nabaztag_hack_kit.gemspec
gemspec

gem "foreman"
gem "heroku"
3 changes: 3 additions & 0 deletions Procfile
@@ -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
5 changes: 0 additions & 5 deletions Rakefile
Expand Up @@ -14,8 +14,3 @@ end

task :spec => [:unit]
task :default => :spec

desc "start server on port 9090"
task :run do
`rackup -p 9090`
end
6 changes: 3 additions & 3 deletions lib/nabaztag_hack_kit/server.rb
Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion spec/unit/server_spec.rb
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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.