lib/sinatra-websocketio/application.rb in sinatra-websocketio-0.1.0 vs lib/sinatra-websocketio/application.rb in sinatra-websocketio-0.1.1
- old
+ new
@@ -1,29 +1,13 @@
module Sinatra
module WebSocketIO
- def websocketio=(options)
- WebSocketIO.options = options
- end
-
- def websocketio
- WebSocketIO.options
- end
-
def self.registered(app)
app.helpers Sinatra::WebSocketIO::Helpers
app.get '/websocketio/websocketio.js' do
content_type 'application/javascript'
- @js ||= (
- js = ''
- Dir.glob(File.expand_path '../js/*.js', File.dirname(__FILE__)).each do |i|
- File.open(i) do |f|
- js += f.read
- end
- end
- ERB.new(js).result(binding)
- )
+ @js ||= ERB.new(Sinatra::WebSocketIO.javascript).result(binding)
end
end
end
end