Sha256: e0f294745ce8c70064eaca91150ff78f691362bf246b42cb345a9f4138d0bd7f

Contents?: true

Size: 361 Bytes

Versions: 28

Compression:

Stored size: 361 Bytes

Contents

module Sinatra
  module WebSocketIO

    def self.javascript(*js_file_names)
      js_file_names = ['websocketio.js', 'event_emitter.js'] if js_file_names.empty?
      js = ''
      js_file_names.each do |i|
        File.open(File.expand_path "../js/#{i}", File.dirname(__FILE__)) do |f|
          js += f.read
        end
      end
      js
    end

  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
sinatra-websocketio-0.2.0 lib/sinatra-websocketio/javascript.rb
sinatra-websocketio-0.1.7 lib/sinatra-websocketio/javascript.rb
sinatra-websocketio-0.1.6 lib/sinatra-websocketio/javascript.rb
sinatra-websocketio-0.1.5 lib/sinatra-websocketio/javascript.rb
sinatra-websocketio-0.1.4 lib/sinatra-websocketio/javascript.rb
sinatra-websocketio-0.1.3 lib/sinatra-websocketio/javascript.rb
sinatra-websocketio-0.1.2 lib/sinatra-websocketio/javascript.rb
sinatra-websocketio-0.1.1 lib/sinatra-websocketio/javascript.rb