Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Starting content

Added some starting content, as well as removing unnecessary method definitions in Rocket::Controller.
  • Loading branch information...
commit 714869508873057e8e5aac1887e8524858a9d904 1 parent 253e9c4
Michael Tomer authored
2  Rakefile
View
@@ -18,7 +18,7 @@ Jeweler::Tasks.new do |gem|
gem.homepage = "http://github.com/actsasbuffoon/rocket-io"
gem.license = "MIT"
gem.summary = %Q{Realtime web application framework}
- gem.description = %Q{Realtime web applicatioin framework that uses Web Sockets for (nearly) everything}
+ gem.description = %Q{Realtime web application framework that uses Web Sockets for (nearly) everything}
gem.email = "michaeltomer@gmail.com"
gem.authors = ["Michael Tomer"]
# dependencies defined in Gemfile
2  bin/rocket
View
@@ -21,7 +21,6 @@ class RocketSetup
def create_dirs
FileUtils.mkdir_p File.join(@opts[:n], "app", "controllers")
FileUtils.mkdir_p File.join(@opts[:n], "app", "models")
- FileUtils.mkdir_p File.join(@opts[:n], "app", "views")
FileUtils.mkdir_p File.join(@opts[:n], "config", "initializers")
FileUtils.mkdir_p File.join(@opts[:n], "lib")
FileUtils.mkdir_p File.join(@opts[:n], "public", "stylesheets")
@@ -31,6 +30,7 @@ class RocketSetup
end
def copy_files
+ FileUtils.cp_r(File.join(LIB_DIR, "app"), File.join(CURRENT_DIR, @opts[:n]))
FileUtils.cp(File.join(LIB_DIR, "lib", "rocket.rb"), File.join(CURRENT_DIR, @opts[:n], "lib"))
FileUtils.cp_r(File.join(LIB_DIR, "public", "javascripts"), File.join(CURRENT_DIR, @opts[:n], "public"))
File.open(File.join(CURRENT_DIR, @opts[:n], "config", "config.rb"), "w") {|f| f.write "APP_NAME = '#{@opts[:n]}'"}
1  lib/app/views/app/layout.jade
View
@@ -0,0 +1 @@
+h1 Content coming soon
11 lib/lib/rocket/controller.rb
View
@@ -15,10 +15,14 @@ module Controller
# This callback adds the new class to the controller hash. It strips "Controller" off
# the end of the class name in order to simplify the API. This way you can call
# "rocket('User.Show': {id: 1})" rather than "rocket('UserController.Show': {id: 1})".
- # It also sets up an attr_accessor for args, params, and current_user.
+ # It also sets up an attr_accessor for args, params, and current_user, as well as a
+ # class attr_reader for storing the controller actions.
def self.bolted(other)
Rocket.controllers[other.to_s.sub(/Controller$/, "").to_sym] = other
other.send :attr_accessor, :args, :params, :current_user
+ class << other
+ attr_reader :actions
+ end
end
module ClassMethods
@@ -35,11 +39,6 @@ def define_action(name, &blk)
@actions[name.to_sym] = blk
end
- # Allows you to access the class instance variable, which is tricky otherwise.
- def actions
- @actions
- end
-
# This is a controller helper that sets you with with a "File First" upload.
# It defines two controller actions for the user. Note that the "Simple Upload"
# does not need a controller action, as everything happens client side.
2  lib/public/javascripts/app.js
View
@@ -17,5 +17,5 @@ Rocket.onmessage = function() {
// Runs the first time a user connects to the web socket server.
Rocket.first_connect = function() {
-
+ $("body").html(templates.app.layout())
}
Please sign in to comment.
Something went wrong with that request. Please try again.