Browse files

Starting content

Added some starting content, as well as removing unnecessary method definitions in Rocket::Controller.
  • Loading branch information...
1 parent 253e9c4 commit 714869508873057e8e5aac1887e8524858a9d904 @actsasbuffoon committed Sep 21, 2011
Showing with 9 additions and 9 deletions.
  1. +1 −1 Rakefile
  2. +1 −1 bin/rocket
  3. +1 −0 lib/app/views/app/layout.jade
  4. +5 −6 lib/lib/rocket/controller.rb
  5. +1 −1 lib/public/javascripts/app.js
View
2 Rakefile
@@ -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
View
2 bin/rocket
@@ -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]}'"}
View
1 lib/app/views/app/layout.jade
@@ -0,0 +1 @@
+h1 Content coming soon
View
11 lib/lib/rocket/controller.rb
@@ -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.
View
2 lib/public/javascripts/app.js
@@ -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())
}

0 comments on commit 7148695

Please sign in to comment.