Permalink
Browse files

run-hobo

OUTPUT_FILE: agility.markdown

## Before you start

You'll need a working Ruby on Rails setup. We're assuming you know at
least the basics of Rails. If not, you should probably work through a
Rails tutorial before attempting this one.

## Create the application with Hobo gem

Although Hobo is in fact a group of Rails plugins, it is also
available as a gem which gives you the useful `hobo` command:

    $ gem install hobo --pre

The `hobo` command is like the `rails` command, it can create a new
blank Rails app that is set-up for Hobo, as well as performing several
other tasks.  When you run the command, it will ask you many
questions.   For now, answer exactly as we do.

    $ hobo new agility
    Hobo Command Line Interface 2.0.0.pre8
    Generating Rails infrastructure...
          create
          create  README.rdoc
          create  Rakefile

... snip ...

     Hobo Setup Wizard
      Do you want to start the Setup Wizard now?
    (Choose 'n' if you need to manually customize any file before running the Wizard.
    You can run it later with `hobo g setup_wizard` from the application root dir.) [y|n]

Choose yes here to pull in Hobo.

     User Resource
    Choose a name for the user resource: [<enter>=user|<custom_name>]

Press enter to leave the name of the user model as `user`.

    Do you want to send an activation email to activate the user? [y|n] y

Press `y` here because that's a useful feature we'll use.

     Invite Only Option
    Do you want to add the features for an invite only website? [y|n] n

We're not building an invite-only website, so we'll press `n` here.


     Templates Option
    Will your application use only hobo/dryml web page templates?
    (Choose 'n' only if you also plan to use plain rails/erb web page templates) [y|n] y

Press `y` here because we're building a pure Hobo application.

     Test Framework
    Do you want to customize the test_framework? [y|n] n

Choose no -- we'll use the default test framework, Test::Unit.  It's easy enough to select a different test framework later if you change your mind.

     Front Controller
    Choose a name for the front controller: [<enter>=front|<custom_name>]

Press enter to leave the default front controller name as `front`.


     Front Theme
    The currently available themes are clean, clean_admin, clean_sidemenu and bootstrap.
    Choose a theme for the front site: [<enter>=bootstrap|<custom_name>]

Press enter to choose the default Hobo theme, bootstrap.

     Front jQuery-UI Theme
    The currently available jQuery-UI themes are listed here: https://github.com/fatdude/jquery-ui-themes-rails/blob/master/README.markdown
    Choose a jQuery-UI theme for the front site: [<enter>=redmond|<custom_name>]

Press enter to select the default jQuery-UI theme, redmond.  jQuery-UI is not used very much with the bootstrap theme and may be [removed later](http://hobocentral.net/blog/2012/12/21/using-hobo-2-0-without-jquery-ui/).

     Admin Subsite
    Do you want an admin subsite? [y|n] n

A subsite in Hobo is a separate collection of views and controllers routed independently.  Each subsite can have a different theme.   They're easy enough to add later via the [admin_subsite](/manual/generators/admin_subsite) or [subsite](/manual/generators/subsite) generators so we won't add one now.

     DB Migration
    Initial Migration: [s]kip, [g]enerate migration file only, generate and [m]igrate: [s|g|m] m

Press `m` here.   There's a lot going on underneath the hood here, but
we'll get to that later.

     I18n
    The Hobo supported locales are de en es fr it nb pt-PT ru (please, contribute to more translations)
    Type the locales (space separated) you want to add to your application or <enter> for 'en':

Press enter here to choose English.

      => "en"

     Git Repository
    Do you want to initialize a git repository now? [y|n] y
    Do you want git to ignore the auto-generated files?
    (Choose 'n' only if you are planning to deploy on a read-only File System like Heroku) [y|n] y

Choose `y` to both of these questions to put your project into Git.
Even if you don't know git you can still say "yes" here -- maybe
you'll find it useful in the future.

## Run the app

You should now have a complete bare bones application.   Fire it up
and give it a try!

    $ cd agility
    $ rails server
  • Loading branch information...
bryanlarsen authored and iox committed Jun 3, 2013
1 parent 5928b5e commit 6c148d33e3953aea7ea95890205a455a332d9b82
Showing with 1,344 additions and 23 deletions.
  1. +17 −0 .gitignore
  2. +48 −0 Gemfile
  3. +168 −0 Gemfile.lock
  4. +0 −23 README
  5. +7 −0 Rakefile
  6. BIN app/assets/images/rails.png
  7. +11 −0 app/assets/javascripts/application.js
  8. +15 −0 app/assets/javascripts/application.js.orig
  9. 0 app/assets/javascripts/application/.gitkeep
  10. +16 −0 app/assets/javascripts/front.js
  11. 0 app/assets/javascripts/front/.gitkeep
  12. +13 −0 app/assets/stylesheets/application.css.orig
  13. +9 −0 app/assets/stylesheets/application.scss
  14. 0 app/assets/stylesheets/application/.gitkeep
  15. +16 −0 app/assets/stylesheets/front.scss
  16. 0 app/assets/stylesheets/front/.gitkeep
  17. +3 −0 app/controllers/application_controller.rb
  18. +19 −0 app/controllers/front_controller.rb
  19. +20 −0 app/controllers/users_controller.rb
  20. +2 −0 app/helpers/front_helper.rb
  21. 0 app/mailers/.gitkeep
  22. +17 −0 app/mailers/user_mailer.rb
  23. 0 app/models/.gitkeep
  24. +7 −0 app/models/guest.rb
  25. +77 −0 app/models/user.rb
  26. +30 −0 app/views/front/index.dryml
  27. +3 −0 app/views/taglibs/application.dryml
  28. +17 −0 app/views/taglibs/front_site.dryml
  29. +9 −0 app/views/user_mailer/activation.erb
  30. +10 −0 app/views/user_mailer/forgot_password.erb
  31. +4 −0 config.ru
  32. +68 −0 config/application.rb
  33. +6 −0 config/boot.rb
  34. +25 −0 config/database.yml
  35. +5 −0 config/environment.rb
  36. +39 −0 config/environments/development.rb
  37. +67 −0 config/environments/production.rb
  38. +37 −0 config/environments/test.rb
  39. +7 −0 config/initializers/backtrace_silencers.rb
  40. +1 −0 config/initializers/dryml_taglibs.rb
  41. +15 −0 config/initializers/inflections.rb
  42. +5 −0 config/initializers/mime_types.rb
  43. +7 −0 config/initializers/secret_token.rb
  44. +8 −0 config/initializers/session_store.rb
  45. +14 −0 config/initializers/wrap_parameters.rb
  46. +25 −0 config/locales/app.en.yml
  47. +195 −0 config/locales/hobo.en.yml
  48. +70 −0 config/routes.rb
  49. +22 −0 db/migrate/20130108212536_initial_migration.rb
  50. +32 −0 db/schema.rb
  51. +7 −0 db/seeds.rb
  52. +2 −0 doc/README_FOR_APP
  53. 0 lib/assets/.gitkeep
  54. 0 lib/tasks/.gitkeep
  55. 0 log/.gitkeep
  56. +26 −0 public/404.html
  57. +26 −0 public/422.html
  58. +25 −0 public/500.html
  59. 0 public/favicon.ico
  60. +5 −0 public/robots.txt
  61. +6 −0 script/rails
  62. 0 test/fixtures/.gitkeep
  63. +11 −0 test/fixtures/users.yml
  64. 0 test/functional/.gitkeep
  65. +7 −0 test/functional/front_controller_test.rb
  66. +7 −0 test/functional/user_mailer_test.rb
  67. 0 test/integration/.gitkeep
  68. +12 −0 test/performance/browsing_test.rb
  69. +13 −0 test/test_helper.rb
  70. 0 test/unit/.gitkeep
  71. +4 −0 test/unit/helpers/front_helper_test.rb
  72. +7 −0 test/unit/user_test.rb
  73. 0 vendor/assets/javascripts/.gitkeep
  74. 0 vendor/assets/stylesheets/.gitkeep
  75. 0 vendor/plugins/.gitkeep
View
@@ -0,0 +1,17 @@
+# See http://help.github.com/ignore-files/ for more about ignoring files.
+#
+# If you find yourself ignoring temporary files generated by your text editor
+# or operating system, you probably want to add a global ignore instead:
+# git config --global core.excludesfile ~/.gitignore_global
+
+# Ignore bundler config
+/.bundle
+
+# Ignore the default SQLite database.
+/db/*.sqlite3
+
+# Ignore all logfiles and tempfiles.
+/log/*.log
+/tmp
+app/views/taglibs/auto/**/*
+config/hobo_routes.rb
View
48 Gemfile
@@ -0,0 +1,48 @@
+source 'https://rubygems.org'
+
+gem 'rails', '3.2.11'
+
+# Bundle edge Rails instead:
+# gem 'rails', :git => 'git://github.com/rails/rails.git'
+
+gem 'sqlite3'
+
+
+# Gems used only for assets and not required
+# in production environments by default.
+group :assets do
+ gem 'sass-rails', '~> 3.2.3'
+ gem 'coffee-rails', '~> 3.2.1'
+
+ # See https://github.com/sstephenson/execjs#readme for more supported runtimes
+ # gem 'therubyracer', :platforms => :ruby
+
+ gem 'uglifier', '>= 1.0.3'
+end
+
+gem 'jquery-rails'
+
+# To use ActiveModel has_secure_password
+# gem 'bcrypt-ruby', '~> 3.0.0'
+
+# To use Jbuilder templates for JSON
+# gem 'jbuilder'
+
+# Use unicorn as the app server
+# gem 'unicorn'
+
+# Deploy with Capistrano
+# gem 'capistrano'
+
+# To use debugger
+# gem 'debugger'
+
+gem "hobo", "= 2.0.0.pre8"
+# Hobo has a lot of assets. Stop cluttering the log in development mode.
+gem "quiet_assets", :group => :development
+# Hobo's version of will_paginate is required.
+gem "will_paginate", :git => "git://github.com/Hobo/will_paginate.git"
+gem "hobo_bootstrap", "2.0.0.pre8"
+gem "hobo_jquery_ui", "2.0.0.pre8"
+gem "hobo_bootstrap_ui", "2.0.0.pre8"
+gem "jquery-ui-themes", "~> 0.0.4"
View
@@ -0,0 +1,168 @@
+GIT
+ remote: git://github.com/Hobo/will_paginate.git
+ revision: cc7ef01551b94fe4f607e38929037234dc70bb62
+ specs:
+ will_paginate (3.0.4.hobo)
+
+GEM
+ remote: https://rubygems.org/
+ specs:
+ actionmailer (3.2.11)
+ actionpack (= 3.2.11)
+ mail (~> 2.4.4)
+ actionpack (3.2.11)
+ activemodel (= 3.2.11)
+ activesupport (= 3.2.11)
+ builder (~> 3.0.0)
+ erubis (~> 2.7.0)
+ journey (~> 1.0.4)
+ rack (~> 1.4.0)
+ rack-cache (~> 1.2)
+ rack-test (~> 0.6.1)
+ sprockets (~> 2.2.1)
+ activemodel (3.2.11)
+ activesupport (= 3.2.11)
+ builder (~> 3.0.0)
+ activerecord (3.2.11)
+ activemodel (= 3.2.11)
+ activesupport (= 3.2.11)
+ arel (~> 3.0.2)
+ tzinfo (~> 0.3.29)
+ activeresource (3.2.11)
+ activemodel (= 3.2.11)
+ activesupport (= 3.2.11)
+ activesupport (3.2.11)
+ i18n (~> 0.6)
+ multi_json (~> 1.0)
+ arel (3.0.2)
+ bootstrap-datepicker-rails (0.6.35)
+ railties (>= 3.0)
+ bootstrap-sass (2.2.2.0)
+ sass (~> 3.2)
+ builder (3.0.4)
+ coffee-rails (3.2.2)
+ coffee-script (>= 2.2.0)
+ railties (~> 3.2.0)
+ coffee-script (2.2.0)
+ coffee-script-source
+ execjs
+ coffee-script-source (1.4.0)
+ dryml (2.0.0.pre8)
+ actionpack (~> 3.2.0)
+ hobo_support (= 2.0.0.pre8)
+ erubis (2.7.0)
+ execjs (1.4.0)
+ multi_json (~> 1.0)
+ hike (1.2.1)
+ hobo (2.0.0.pre8)
+ dryml (= 2.0.0.pre8)
+ hobo_fields (= 2.0.0.pre8)
+ hobo_support (= 2.0.0.pre8)
+ will_paginate (~> 3.0.0)
+ hobo_bootstrap (2.0.0.pre8)
+ bootstrap-sass (~> 2.1)
+ hobo (~> 2.0.0.pre6)
+ hobo_jquery (~> 2.0.0.pre6)
+ will_paginate-bootstrap (~> 0.2.1)
+ hobo_bootstrap_ui (2.0.0.pre8)
+ bootstrap-datepicker-rails
+ hobo_bootstrap (~> 2.0.0.pre1)
+ hobo_fields (2.0.0.pre8)
+ hobo_support (= 2.0.0.pre8)
+ hobo_jquery (2.0.0.pre8)
+ hobo_rapid (= 2.0.0.pre8)
+ jquery-rails (~> 2.0)
+ hobo_jquery_ui (2.0.0.pre8)
+ hobo (= 2.0.0.pre8)
+ hobo_jquery (= 2.0.0.pre8)
+ jquery-ui-themes (~> 0.0.4)
+ hobo_rapid (2.0.0.pre8)
+ hobo (= 2.0.0.pre8)
+ hobo_support (2.0.0.pre8)
+ rails (~> 3.2.0)
+ httparty (0.9.0)
+ multi_json (~> 1.0)
+ multi_xml
+ i18n (0.6.1)
+ journey (1.0.4)
+ jquery-rails (2.1.4)
+ railties (>= 3.0, < 5.0)
+ thor (>= 0.14, < 2.0)
+ jquery-ui-themes (0.0.8)
+ httparty
+ json (1.7.6)
+ mail (2.4.4)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.19)
+ multi_json (1.5.0)
+ multi_xml (0.5.1)
+ polyglot (0.3.3)
+ quiet_assets (1.0.1)
+ railties (~> 3.1)
+ rack (1.4.3)
+ rack-cache (1.2)
+ rack (>= 0.4)
+ rack-ssl (1.3.2)
+ rack
+ rack-test (0.6.2)
+ rack (>= 1.0)
+ rails (3.2.11)
+ actionmailer (= 3.2.11)
+ actionpack (= 3.2.11)
+ activerecord (= 3.2.11)
+ activeresource (= 3.2.11)
+ activesupport (= 3.2.11)
+ bundler (~> 1.0)
+ railties (= 3.2.11)
+ railties (3.2.11)
+ actionpack (= 3.2.11)
+ activesupport (= 3.2.11)
+ rack-ssl (~> 1.3.2)
+ rake (>= 0.8.7)
+ rdoc (~> 3.4)
+ thor (>= 0.14.6, < 2.0)
+ rake (10.0.3)
+ rdoc (3.12)
+ json (~> 1.4)
+ sass (3.2.5)
+ sass-rails (3.2.5)
+ railties (~> 3.2.0)
+ sass (>= 3.1.10)
+ tilt (~> 1.3)
+ sprockets (2.2.2)
+ hike (~> 1.2)
+ multi_json (~> 1.0)
+ rack (~> 1.0)
+ tilt (~> 1.1, != 1.3.0)
+ sqlite3 (1.3.6)
+ thor (0.16.0)
+ tilt (1.3.3)
+ treetop (1.4.12)
+ polyglot
+ polyglot (>= 0.3.1)
+ tzinfo (0.3.35)
+ uglifier (1.3.0)
+ execjs (>= 0.3.0)
+ multi_json (~> 1.0, >= 1.0.2)
+ will_paginate-bootstrap (0.2.2)
+ will_paginate (>= 3.0.3)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ coffee-rails (~> 3.2.1)
+ hobo (= 2.0.0.pre8)
+ hobo_bootstrap (= 2.0.0.pre8)
+ hobo_bootstrap_ui (= 2.0.0.pre8)
+ hobo_jquery_ui (= 2.0.0.pre8)
+ jquery-rails
+ jquery-ui-themes (~> 0.0.4)
+ quiet_assets
+ rails (= 3.2.11)
+ sass-rails (~> 3.2.3)
+ sqlite3
+ uglifier (>= 1.0.3)
+ will_paginate!
View
23 README
@@ -1,23 +0,0 @@
-# Agility
-
-This is the source code to accompany the [Agility gitorial for
-Hobo](http://cookbook.hobocentral.net/tutorials/agility).
-
-Agility is a simple "Agile Development" application – Agility. The
-application tracks projects which consist of a number of user
-stories. Stories have a status (e.g. accepted, under development…) as
-well as a number of associated tasks. Tasks can be assigned to users,
-and each user can see a heads-up of all the tasks they’ve been
-assigned to on their home page.
-
-To keep the gitorial clean, updates to the gitorial **rewrite
-history**. That means that you cannot `git pull`. If you wish to
-update to a later version, you must `git clone` the repository again
-and move any changes you have made from your old clone to the new one.
-
-The "real" history is kept in our [source
-repository](http://github.com/Hobo/agility-gitorial-patches/tree/master).
-
-There is an [older version of
-agility](http://github.com/tablatom/agility/tree/master) that is not
-in gitorial format. That tree is mainly used for integration testing Hobo.
View
@@ -0,0 +1,7 @@
+#!/usr/bin/env rake
+# Add your own tasks in files placed in lib/tasks ending in .rake,
+# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
+
+require File.expand_path('../config/application', __FILE__)
+
+Agility::Application.load_tasks
View
Binary file not shown.
@@ -0,0 +1,11 @@
+// This file is included in all sites and subsites. This is a
+// manifest file that'll be compiled into including all the files
+// listed below. Add new JavaScript/Coffee code in separate files in
+// the application directory and they'll automatically be included.
+// It's not advisable to add code directly here, but if you do, it'll
+// appear at the bottom of the the compiled file.
+//
+//= require jquery
+//= require jquery_ujs
+//= require jquery-ui
+//= require_tree ./application
@@ -0,0 +1,15 @@
+// This is a manifest file that'll be compiled into application.js, which will include all the files
+// listed below.
+//
+// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
+// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
+//
+// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
+// the compiled file.
+//
+// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
+// GO AFTER THE REQUIRES BELOW.
+//
+//= require jquery
+//= require jquery_ujs
+//= require_tree .
@@ -0,0 +1,16 @@
+// This is a manifest file for the front subsite (which is your whole
+// application if you don't have any subsites). It will be compiled
+// into including all the files listed below. Add new
+// JavaScript/Coffee code in separate files in the front directory and
+// they'll automatically be included in the compiled file accessible
+// from http://example.com/assets/front.js It's not advisable to add
+// code directly here, but if you do, it'll appear at the bottom of
+// the the compiled file.
+//
+//= require application
+//= require hobo_rapid
+//= require hobo_jquery
+//= require hobo_bootstrap
+//= require hobo_jquery_ui
+//= require hobo_bootstrap_ui
+//= require_tree ./front
No changes.
@@ -0,0 +1,13 @@
+/*
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
+ * listed below.
+ *
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
+ *
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
+ * compiled file, but it's generally better to create a new file per style scope.
+ *
+ *= require_self
+ *= require_tree .
+ */
@@ -0,0 +1,9 @@
+/*
+ * This is the global stylesheet manifest file. Files or plugins
+ * referenced from here or placed in the application/ directory will be
+ * included in all subsites. This file is included by front.css and all
+ * subsites.
+ *
+ *= require_self
+ *= require_tree ./application
+*/
@@ -0,0 +1,16 @@
+/*
+ * This is the stylesheet manifest file for the front subsite (which
+ * is your whole application if you don't have any subsites). Files
+ * or plugins referenced from here or placed in the front/ directory
+ * will be included.
+ *
+ *= require_self
+ *= require application
+ *= require hobo_rapid
+ *= require hobo_jquery
+ *= require hobo_bootstrap
+ *= require hobo_jquery_ui
+ *= require hobo_bootstrap_ui
+ *= require jquery-ui/redmond
+ *= require_tree ./front
+*/
No changes.
@@ -0,0 +1,3 @@
+class ApplicationController < ActionController::Base
+ protect_from_forgery
+end
@@ -0,0 +1,19 @@
+class FrontController < ApplicationController
+
+ hobo_controller
+
+ def index; end
+
+ def summary
+ if !current_user.administrator?
+ redirect_to user_login_path
+ end
+ end
+
+ def search
+ if params[:query]
+ site_search(params[:query])
+ end
+ end
+
+end
@@ -0,0 +1,20 @@
+class UsersController < ApplicationController
+
+ hobo_user_controller
+
+ auto_actions :all, :except => [ :index, :new, :create ]
+
+ # Normally, users should be created via the user lifecycle, except
+ # for the initial user created via the form on the front screen on
+ # first run. This method creates the initial user.
+ def create
+ hobo_create do
+ if valid?
+ self.current_user = this
+ flash[:notice] = t("hobo.messages.you_are_site_admin", :default=>"You are now the site administrator")
+ redirect_to home_page
+ end
+ end
+ end
+
+end
Oops, something went wrong.

0 comments on commit 6c148d3

Please sign in to comment.