Permalink
Browse files

Remove trailing whitespace.

  • Loading branch information...
jcoglan committed Dec 22, 2012
1 parent 4d5d7af commit 59e520558fb798b0769b7aef796f1ea6d8619d2c
Showing with 2,155 additions and 2,155 deletions.
  1. +2 −2 examples/automate.rb
  2. +6 −6 examples/node/benchmark.js
  3. +2 −2 examples/node/client.js
  4. +3 −3 examples/node/server.js
  5. +6 −6 examples/ruby/benchmark.rb
  6. +4 −4 examples/ruby/client.rb
  7. +3 −3 examples/ruby/cluster.rb
  8. +3 −3 examples/ruby/pingpong.rb
  9. +1 −1 examples/ruby/server.rb
  10. +8 −8 examples/shared/public/index.html
  11. +14 −14 examples/shared/public/soapbox.js
  12. +50 −50 javascript/adapters/node_adapter.js
  13. +9 −9 javascript/adapters/static_server.js
  14. +8 −8 javascript/engines/connection.js
  15. +19 −19 javascript/engines/memory.js
  16. +18 −18 javascript/engines/proxy.js
  17. +2 −2 javascript/error.js
  18. +20 −20 javascript/faye.js
  19. +8 −8 javascript/mixins/deferrable.js
  20. +7 −7 javascript/mixins/logging.js
  21. +8 −8 javascript/mixins/publisher.js
  22. +1 −1 javascript/mixins/timeouts.js
  23. +22 −22 javascript/protocol/channel.js
  24. +68 −68 javascript/protocol/client.js
  25. +5 −5 javascript/protocol/extensible.js
  26. +5 −5 javascript/protocol/grammar.js
  27. +57 −57 javascript/protocol/server.js
  28. +2 −2 javascript/protocol/socket.js
  29. +2 −2 javascript/protocol/subscription.js
  30. +9 −9 javascript/transport/cors.js
  31. +11 −11 javascript/transport/event_source.js
  32. +7 −7 javascript/transport/jsonp.js
  33. +10 −10 javascript/transport/node_http.js
  34. +1 −1 javascript/transport/node_local.js
  35. +15 −15 javascript/transport/transport.js
  36. +18 −18 javascript/transport/web_socket.js
  37. +10 −10 javascript/transport/xhr.js
  38. +7 −7 javascript/util/browser/event.js
  39. +11 −11 javascript/util/browser/uri.js
  40. +4 −4 javascript/util/class.js
  41. +3 −3 javascript/util/namespace.js
  42. +6 −6 javascript/util/set.js
  43. +20 −20 lib/faye.rb
  44. +43 −43 lib/faye/adapters/rack_adapter.rb
  45. +11 −11 lib/faye/adapters/static_server.rb
  46. +13 −13 lib/faye/engines/connection.rb
  47. +21 −21 lib/faye/engines/memory.rb
  48. +23 −23 lib/faye/engines/proxy.rb
  49. +6 −6 lib/faye/error.rb
  50. +12 −12 lib/faye/mixins/logging.rb
  51. +6 −6 lib/faye/mixins/publisher.rb
  52. +1 −1 lib/faye/mixins/timeouts.rb
  53. +24 −24 lib/faye/protocol/channel.rb
  54. +68 −68 lib/faye/protocol/client.rb
  55. +7 −7 lib/faye/protocol/extensible.rb
  56. +13 −13 lib/faye/protocol/grammar.rb
  57. +57 −57 lib/faye/protocol/server.rb
  58. +4 −4 lib/faye/protocol/socket.rb
  59. +4 −4 lib/faye/protocol/subscription.rb
  60. +13 −13 lib/faye/transport/http.rb
  61. +5 −5 lib/faye/transport/local.rb
  62. +19 −19 lib/faye/transport/transport.rb
  63. +20 −20 lib/faye/transport/web_socket.rb
  64. +4 −4 lib/faye/util/namespace.rb
  65. +2 −2 site/src/layouts/application.haml
  66. +31 −31 site/src/pages/architecture.haml
  67. +31 −31 site/src/pages/browser.haml
  68. +7 −7 site/src/pages/browser/extensions.haml
  69. +9 −9 site/src/pages/browser/publishing.haml
  70. +14 −14 site/src/pages/browser/subscribing.haml
  71. +7 −7 site/src/pages/browser/transport.haml
  72. +14 −14 site/src/pages/download.haml
  73. +9 −9 site/src/pages/index.haml
  74. +13 −13 site/src/pages/node.haml
  75. +7 −7 site/src/pages/node/clients.haml
  76. +46 −46 site/src/pages/node/engines.haml
  77. +25 −25 site/src/pages/node/extensions.haml
  78. +17 −17 site/src/pages/node/monitoring.haml
  79. +3 −3 site/src/pages/node/websockets.haml
  80. +17 −17 site/src/pages/ruby.haml
  81. +13 −13 site/src/pages/ruby/clients.haml
  82. +45 −45 site/src/pages/ruby/engines.haml
  83. +24 −24 site/src/pages/ruby/extensions.haml
  84. +17 −17 site/src/pages/ruby/monitoring.haml
  85. +3 −3 site/src/pages/ruby/websockets.haml
  86. +88 −88 site/src/pages/security.haml
  87. +3 −3 site/src/partials/browser_navigation.haml
  88. +3 −3 site/src/partials/node_navigation.haml
  89. +4 −4 site/src/partials/ruby_navigation.haml
  90. +19 −19 site/src/stylesheets/main.sass
  91. +5 −5 spec/browser.html
  92. +3 −3 spec/javascript/channel_spec.js
  93. +87 −87 spec/javascript/client_spec.js
  94. +1 −1 spec/javascript/engine/memory_spec.js
  95. +70 −70 spec/javascript/engine_spec.js
  96. +6 −6 spec/javascript/faye_spec.js
  97. +12 −12 spec/javascript/grammar_spec.js
  98. +46 −46 spec/javascript/node_adapter_spec.js
  99. +4 −4 spec/javascript/publisher_spec.js
  100. +21 −21 spec/javascript/server/connect_spec.js
  101. +15 −15 spec/javascript/server/disconnect_spec.js
  102. +6 −6 spec/javascript/server/extensions_spec.js
  103. +18 −18 spec/javascript/server/handshake_spec.js
  104. +23 −23 spec/javascript/server/integration_spec.js
  105. +9 −9 spec/javascript/server/publish_spec.js
  106. +30 −30 spec/javascript/server/subscribe_spec.js
  107. +30 −30 spec/javascript/server/unsubscribe_spec.js
  108. +15 −15 spec/javascript/server_spec.js
  109. +19 −19 spec/javascript/transport_spec.js
  110. +2 −2 spec/node.js
  111. +2 −2 spec/ruby/channel_spec.rb
  112. +82 −82 spec/ruby/client_spec.rb
  113. +51 −51 spec/ruby/engine_examples.rb
  114. +5 −5 spec/ruby/faye_spec.rb
  115. +12 −12 spec/ruby/grammar_spec.rb
  116. +4 −4 spec/ruby/publisher_spec.rb
  117. +34 −34 spec/ruby/rack_adapter_spec.rb
  118. +22 −22 spec/ruby/server/connect_spec.rb
  119. +16 −16 spec/ruby/server/disconnect_spec.rb
  120. +8 −8 spec/ruby/server/extensions_spec.rb
  121. +19 −19 spec/ruby/server/handshake_spec.rb
  122. +22 −22 spec/ruby/server/integration_spec.rb
  123. +9 −9 spec/ruby/server/publish_spec.rb
  124. +31 −31 spec/ruby/server/subscribe_spec.rb
  125. +31 −31 spec/ruby/server/unsubscribe_spec.rb
  126. +17 −17 spec/ruby/server_spec.rb
  127. +22 −22 spec/ruby/transport_spec.rb
  128. +1 −1 spec/testswarm
  129. +5 −5 spec/thin_proxy.rb
View
@@ -48,11 +48,11 @@
BROWSERS.each do |name, sender|
BROWSERS.each do |at, target|
next if at == name
-
+
Terminus.browser = sender
fill_in 'message', :with => "@#{at} Hello, world!"
click_button 'Send'
-
+
Terminus.browser = target
unless page.has_content?("#{name}: @#{at} Hello, world!")
Terminus.return_to_dock
View
@@ -1,5 +1,5 @@
var faye = require('../../build/node/faye-node'),
-
+
port = process.argv[2] || 8000,
path = process.argv[3] || 'bayeux',
scheme = process.argv[4] === 'ssl' ? 'https' : 'http';
@@ -9,25 +9,25 @@ var A = new faye.Client(scheme + '://localhost:' + port + '/' + path),
A.connect(function() {
B.connect(function() {
-
+
var time = new Date().getTime(),
MAX = 1000;
-
+
var stop = function() {
console.log(new Date().getTime() - time);
process.exit();
};
-
+
var handle = function(client, channel) {
return function(n) {
if (n === MAX) return stop();
client.publish(channel, n + 1);
};
};
-
+
var subA = A.subscribe('/chat/a', handle(A, '/chat/b')),
subB = B.subscribe('/chat/b', handle(B, '/chat/a'));
-
+
subA.callback(function() {
subB.callback(function() {
console.log('START');
View
@@ -8,7 +8,7 @@
// connected users.
var faye = require('../../build/node/faye-node'),
-
+
port = process.argv[2] || 8000,
path = process.argv[3] || 'bayeux',
scheme = process.argv[4] === 'ssl' ? 'https' : 'http',
@@ -19,7 +19,7 @@ var client = new faye.Client(endpoint);
var subscription = client.subscribe('/chat/*', function(message) {
var user = message.user;
-
+
var publication = client.publish('/members/' + user, {
user: 'node-logger',
message: ' Got your message, ' + user + '!'
View
@@ -8,19 +8,19 @@ var fs = require('fs'),
var SHARED_DIR = path.dirname(__filename) + '/../shared',
PUBLIC_DIR = SHARED_DIR + '/public',
-
+
bayeux = new faye.NodeAdapter({mount: '/bayeux', timeout: 20}),
port = process.argv[2] || '8000',
secure = process.argv[3] === 'ssl',
-
+
sslOpts = {
key: fs.readFileSync(SHARED_DIR + '/server.key'),
cert: fs.readFileSync(SHARED_DIR + '/server.crt')
};
var handleRequest = function(request, response) {
var path = (request.url === '/') ? '/index.html' : request.url;
-
+
fs.readFile(PUBLIC_DIR + path, function(err, content) {
var status = err ? 404 : 200;
response.writeHead(status, {'Content-Type': 'text/html'});
View
@@ -8,18 +8,18 @@
EM.run {
A = Faye::Client.new("#{scheme}://localhost:#{port}/#{path}")
B = Faye::Client.new("#{scheme}://localhost:#{port}/#{path}")
-
+
A.connect do
B.connect do
-
+
time = Time.now.to_f * 1000
MAX = 1000
-
+
stop = lambda do
puts Time.now.to_f * 1000 - time
EM.stop
end
-
+
handle = lambda do |client, channel|
lambda do |n|
if n == MAX
@@ -29,10 +29,10 @@
end
end
end
-
+
sub_a = A.subscribe('/chat/a', &handle.call(A, '/chat/b'))
sub_b = B.subscribe('/chat/b', &handle.call(B, '/chat/a'))
-
+
sub_a.callback do
sub_b.callback do
puts 'START'
View
@@ -18,10 +18,10 @@
EM.run {
puts "Connecting to #{endpoint}"
client = Faye::Client.new(endpoint)
-
+
subscription = client.subscribe '/chat/*' do |message|
user = message['user']
-
+
publication = client.publish("/members/#{ user }", {
"user" => "ruby-logger",
"message" => "Got your message, #{ user }!"
@@ -33,14 +33,14 @@
puts "[PUBLISH FAILED] #{error.inspect}"
end
end
-
+
subscription.callback do
puts "[SUBSCRIBE SUCCEEDED]"
end
subscription.errback do |error|
puts "[SUBSCRIBE FAILED] #{error.inspect}"
end
-
+
client.bind 'transport:down' do
puts "[CONNECTION DOWN]"
end
View
@@ -13,15 +13,15 @@
server = servers[:ruby]
client_a = Faye::Client.new("http://localhost:#{server[:ports][0]}/#{server[:path]}")
client_b = Faye::Client.new("http://localhost:#{server[:ports][1]}/#{server[:path]}")
-
+
time = nil
-
+
sub = client_a.subscribe '/chat/foo' do |message|
puts Time.now.to_f * 1000 - time
puts message['text']
EM.stop
end
-
+
sub.callback do
client_b.connect do
time = Time.now.to_f * 1000
@@ -4,19 +4,19 @@
EM.run {
ENDPOINT = 'http://localhost:9292/bayeux'
puts 'Connecting to ' + ENDPOINT
-
+
ping = Faye::Client.new(ENDPOINT)
ping.subscribe('/ping') do
puts 'PING'
EM.add_timer(1) { ping.publish('/pong', {}) }
end
-
+
pong = Faye::Client.new(ENDPOINT)
pong.subscribe('/pong') do
puts 'PONG'
EM.add_timer(1) { ping.publish('/ping', {}) }
end
-
+
EM.add_timer(0.5) { ping.publish('/pong', {}) }
}
View
@@ -30,7 +30,7 @@ def response(env)
EM.run {
thin = Rack::Handler.get('thin')
thin.run(App, :Port => port) do |s|
-
+
if secure
s.ssl = true
s.ssl_options = {
@@ -12,40 +12,40 @@
</head>
<body>
<div class="container">
-
+
<h1><em>Soapbox</em> | a Twitter-style chat app</h1>
-
+
<form id="enterUsername">
<label for="username">Pick a username</label>
<input type="text" name="username" id="username">
<input type="submit" value="Go">
</form>
-
+
<div id="app">
<form id="addFollowee">
<label for="followee">Follow</label>
<input type="text" name="followee" id="followee">
<input type="submit" value="Follow">
</form>
-
+
<form id="postMessage">
<label for="message">Post a message</label><br>
<textarea name="message" id="message" rows="3" cols="40"></textarea>
<input type="submit" value="Send">
</form>
-
+
<ul id="stream">
</ul>
</div>
-
+
<script type="text/javascript">
Faye.Logging.logLevel = 'debug';
-
+
var scheme = window.location.protocol,
host = location.hostname,
port = location.port,
path = '/bayeux';
-
+
Bayeux = new Faye.Client(scheme + '//' + host + (port ? ':' + port : '') + path);
Soapbox.init(Bayeux);
</script>
@@ -7,23 +7,23 @@ Soapbox = {
init: function(bayeux) {
var self = this;
this._bayeux = bayeux;
-
+
this._login = $('#enterUsername');
this._app = $('#app');
this._follow = $('#addFollowee');
this._post = $('#postMessage');
this._stream = $('#stream');
-
+
this._app.hide();
-
+
// When the user enters a username, store it and start the app
this._login.submit(function() {
self._username = $('#username').val();
self.launch();
return false;
});
},
-
+
/**
* Starts the application after a username has been entered. A subscription is
* made to receive messages that mention this user, and forms are set up to
@@ -32,31 +32,31 @@ Soapbox = {
launch: function() {
var self = this;
this._bayeux.subscribe('/members/' + this._username, this.accept, this);
-
+
// Hide login form, show main application UI
this._login.fadeOut('slow', function() {
self._app.fadeIn('slow');
});
-
+
// When we add a follower, subscribe to a channel to which the followed user
// will publish messages
this._follow.submit(function() {
var follow = $('#followee'),
name = follow.val();
-
+
self._bayeux.subscribe('/chat/' + name, self.accept, self);
follow.val('');
return false;
});
-
+
// When we enter a message, send it and clear the message field.
this._post.submit(function() {
var msg = $('#message');
self.post(msg.val());
msg.val('');
return false;
});
-
+
// Detect network problems and disable the form when offline
this._bayeux.bind('transport:down', function() {
this._post.find('textarea,input').attr('disabled', true);
@@ -65,7 +65,7 @@ Soapbox = {
this._post.find('textarea,input').attr('disabled', false);
}, this);
},
-
+
/**
* Sends messages that the user has entered. The message is scanned for
* @reply-style mentions of other users, and the message is sent to those
@@ -76,25 +76,25 @@ Soapbox = {
words = message.split(/\s+/),
self = this,
pattern = /\@[a-z0-9]+/i;
-
+
// Extract @replies from the message
$.each(words, function(i, word) {
if (!pattern.test(word)) return;
word = word.replace(/[^a-z0-9]/ig, '');
if (word !== self._username) mentions.push(word);
});
-
+
// Message object to transmit over Bayeux channels
message = {user: this._username, message: message};
-
+
// Publish to this user's 'from' channel, and to channels for any @replies
// found in the message
this._bayeux.publish('/chat/' + this._username, message);
$.each(mentions, function(i, name) {
self._bayeux.publish('/members/' + name, message);
});
},
-
+
/**
* Handler for messages received over subscribed channels. Takes the message
* object sent by the post() method and displays it in the user's message list.
Oops, something went wrong.

0 comments on commit 59e5205

Please sign in to comment.