From 2b951aec0df3f49f1492f397fca6e483a1027492 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Sat, 1 Sep 2012 16:12:02 -0500 Subject: [PATCH] * getting ready to create a easy websocket starter mechanism that starts websocket whenever you run jam-web --- .gitignore | 1 + app/views/jam_ruby/users/_user.html.erb | 8 ++++++++ config/application.rb | 3 +++ config/initializers/websocket_gateway.rb | 7 +++++++ 4 files changed, 19 insertions(+) create mode 100644 app/views/jam_ruby/users/_user.html.erb create mode 100644 config/initializers/websocket_gateway.rb diff --git a/.gitignore b/.gitignore index 23fdadbbc..c1acccabb 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ doc/ .project .DS_Store .idea +*.iml diff --git a/app/views/jam_ruby/users/_user.html.erb b/app/views/jam_ruby/users/_user.html.erb new file mode 100644 index 000000000..25a8cbb95 --- /dev/null +++ b/app/views/jam_ruby/users/_user.html.erb @@ -0,0 +1,8 @@ +
  • + <%= gravatar_for user, size: 52 %> + <%= link_to user.name, user %> + <% if current_user.admin? && !current_user?(user) %> + | <%= link_to "delete", user, method: :delete, + data: { confirm: "You sure?" } %> + <% end %> +
  • \ No newline at end of file diff --git a/config/application.rb b/config/application.rb index deabca282..d2d80d14c 100644 --- a/config/application.rb +++ b/config/application.rb @@ -64,5 +64,8 @@ module SampleApp # Version of your assets, change this if you want to expire all your assets config.assets.version = '1.0' + + # Runs the websocket gateway within the web app + config.run_websocket_gateway = true end end diff --git a/config/initializers/websocket_gateway.rb b/config/initializers/websocket_gateway.rb new file mode 100644 index 000000000..74553e483 --- /dev/null +++ b/config/initializers/websocket_gateway.rb @@ -0,0 +1,7 @@ + +# if we are instructed to start the websocket gateway, do so +if Rails.application.config.run_websocket_gateway + puts "starting websocket gateway..." + + puts "not really..." +end