Skip to content

Commit

Permalink
Add GPIO gem and embed iframe for webcam.
Browse files Browse the repository at this point in the history
  • Loading branch information
pivotal committed Feb 25, 2013
1 parent ffbc537 commit e9abdc0
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ source :rubygems

gem 'sinatra'
gem 'haml'
gem 'gpio'

group :test do
gem 'rspec'
Expand Down
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ GEM
remote: http://rubygems.org/
specs:
diff-lcs (1.1.3)
gpio (0.0.6)
haml (4.0.0)
tilt
rack (1.5.2)
Expand All @@ -25,6 +26,7 @@ PLATFORMS
ruby

DEPENDENCIES
gpio
haml
rspec
sinatra
8 changes: 7 additions & 1 deletion app/door_buzzer_server.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
require 'sinatra'
require 'gpio'

#TODO: parse webcam url from config.yml
get '/' do

haml :index
end

get '/buzz' do
GPIO::Pin.new(pin: 22)
end
7 changes: 7 additions & 0 deletions app/views/index.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
%h1
Pivotal Door buzzer

%iframe{:src => locals.webcam_url, :style => "width: 100%; height:700px;" }

%a{:href => '/buzz'}
Buzz Me in!
1 change: 0 additions & 1 deletion spec/door_buzzer_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@

describe 'The most awesomest door buzzing app EVAAARRRRR' do
it 'should buzz me in' do

end
end

0 comments on commit e9abdc0

Please sign in to comment.