Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: ruseel/rboard
base: 191ac4f834
...
head fork: ruseel/rboard
compare: 89d63a2231
  • 5 commits
  • 100 files changed
  • 0 commit comments
  • 1 contributor
Commits on Nov 24, 2012
@ruseel copied from newly generated directory. b823f3d
Commits on Nov 26, 2012
@ruseel remove 'Xyz' constant. a71d589
@ruseel enginfy
- wrap controller, model with module scope
- remove many files in /config
- add lib/rboard/{engine,version}.rb
- rboard.gemspec
598f744
@ruseel html and twitter-bootstrap arrage for enginefy 39bce07
@ruseel remove residues. 89d63a2
Showing with 929 additions and 592 deletions.
  1. +1 −0  .gitignore
  2. +8 −6 Gemfile
  3. +8 −0 Gemfile.lock
  4. +37 −4 Rakefile
  5. +0 −3  app/assets/stylesheets/comments.css.scss
  6. 0  app/assets/stylesheets/{ → rboard}/application.css
  7. 0  app/assets/stylesheets/{ → rboard}/rboard.css.scss
  8. +0 −83 app/controllers/boards_controller.rb
  9. +0 −49 app/controllers/comments_controller.rb
  10. +5 −0 app/controllers/rboard/application_controller.rb
  11. +85 −0 app/controllers/rboard/boards_controller.rb
  12. +51 −0 app/controllers/rboard/comments_controller.rb
  13. +65 −0 app/controllers/rboard/topics_controller.rb
  14. +0 −61 app/controllers/topics_controller.rb
  15. +0 −8 app/models/admin.rb
  16. +0 −5 app/models/board.rb
  17. +0 −9 app/models/comment.rb
  18. +10 −0 app/models/rboard/admin.rb
  19. +7 −0 app/models/rboard/board.rb
  20. +11 −0 app/models/rboard/comment.rb
  21. +48 −0 app/models/rboard/topic.rb
  22. +0 −46 app/models/topic.rb
  23. +1 −0  app/views/layouts/{ → rboard}/application.html.erb
  24. 0  app/views/{ → rboard}/boards/_form.html.erb
  25. 0  app/views/{ → rboard}/boards/edit.html.erb
  26. 0  app/views/{ → rboard}/boards/index.html.erb
  27. 0  app/views/{ → rboard}/boards/new.html.erb
  28. 0  app/views/{ → rboard}/boards/show.html.erb
  29. 0  app/views/{ → rboard}/comments/_form.html.erb
  30. 0  app/views/{ → rboard}/comments/create.html.erb
  31. 0  app/views/{ → rboard}/comments/destroy.html.erb
  32. 0  app/views/{ → rboard}/comments/edit.html.erb
  33. 0  app/views/{ → rboard}/comments/index.html.erb
  34. 0  app/views/{ → rboard}/comments/new.html.erb
  35. 0  app/views/{ → rboard}/comments/show.html.erb
  36. 0  app/views/{ → rboard}/comments/update.html.erb
  37. 0  app/views/{ → rboard}/topics/_form.html.erb
  38. 0  app/views/{ → rboard}/topics/create.html.erb
  39. 0  app/views/{ → rboard}/topics/destroy.html.erb
  40. 0  app/views/{ → rboard}/topics/edit.html.erb
  41. 0  app/views/{ → rboard}/topics/index.html.erb
  42. 0  app/views/{ → rboard}/topics/new.html.erb
  43. +1 −1  app/views/{ → rboard}/topics/show.html.erb
  44. +0 −6 config/boot.rb
  45. +0 −10 config/initializers/kaminari_config.rb
  46. +0 −142 config/initializers/simple_form.rb
  47. +0 −45 config/initializers/simple_form_bootstrap.rb
  48. +0 −26 config/locales/simple_form.en.yml
  49. +1 −58 config/routes.rb
  50. +2 −2 db/migrate/{20121108081931_create_admins.rb → 20121108081931_create_rboard_admins.rb}
  51. +2 −2 db/migrate/{20121109051941_create_topics.rb → 20121109051941_create_rboard_topics.rb}
  52. +2 −2 db/migrate/{20121114072129_create_comments.rb → 20121114072129_create_rboard_comments.rb}
  53. +2 −2 db/migrate/{20121121022941_create_boards.rb → 20121121022941_create_rboard_boards.rb}
  54. +5 −0 db/migrate/20121121023435_add_board_id_to_rboard_topic.rb
  55. +0 −5 db/migrate/20121121023435_add_board_id_to_topic.rb
  56. +4 −0 lib/rboard.rb
  57. +5 −0 lib/rboard/engine.rb
  58. +3 −0  lib/rboard/version.rb
  59. +24 −0 rboard.gemspec
  60. +5 −3 script/rails
  61. +15 −0 test/dummy/.gitignore
  62. +261 −0 test/dummy/README.rdoc
  63. +7 −0 test/dummy/Rakefile
  64. +15 −0 test/dummy/app/assets/javascripts/application.js
  65. +13 −0 test/dummy/app/assets/stylesheets/application.css
  66. 0  { → test/dummy}/app/assets/stylesheets/bootstrap_and_overrides.css.less
  67. 0  { → test/dummy}/app/controllers/application_controller.rb
  68. +2 −0  test/dummy/app/helpers/application_helper.rb
  69. 0  test/dummy/app/mailers/.gitkeep
  70. 0  test/dummy/app/models/.gitkeep
  71. +8 −0 test/dummy/app/views/layouts/application.html.erb
  72. +4 −0 test/dummy/config.ru
  73. +4 −7 { → test/dummy}/config/application.rb
  74. +10 −0 test/dummy/config/boot.rb
  75. 0  { → test/dummy}/config/database.yml
  76. +1 −1  { → test/dummy}/config/environment.rb
  77. +1 −1  { → test/dummy}/config/environments/development.rb
  78. +1 −1  { → test/dummy}/config/environments/production.rb
  79. +1 −1  { → test/dummy}/config/environments/test.rb
  80. 0  { → test/dummy}/config/initializers/backtrace_silencers.rb
  81. 0  { → test/dummy}/config/initializers/inflections.rb
  82. 0  { → test/dummy}/config/initializers/mime_types.rb
  83. +1 −1  { → test/dummy}/config/initializers/secret_token.rb
  84. +2 −2 { → test/dummy}/config/initializers/session_store.rb
  85. 0  { → test/dummy}/config/initializers/wrap_parameters.rb
  86. 0  { → test/dummy}/config/locales/en.yml
  87. +4 −0 test/dummy/config/routes.rb
  88. +12 −0 test/dummy/db/migrate/20121126025656_create_rboard_admins.rboard.rb
  89. +13 −0 test/dummy/db/migrate/20121126025657_create_rboard_topics.rboard.rb
  90. +11 −0 test/dummy/db/migrate/20121126025658_create_rboard_comments.rboard.rb
  91. +12 −0 test/dummy/db/migrate/20121126025659_create_rboard_boards.rboard.rb
  92. +6 −0 test/dummy/db/migrate/20121126025660_add_board_id_to_rboard_topic.rboard.rb
  93. +49 −0 test/dummy/db/schema.rb
  94. 0  test/dummy/lib/assets/.gitkeep
  95. 0  test/dummy/log/.gitkeep
  96. +26 −0 test/dummy/public/404.html
  97. +26 −0 test/dummy/public/422.html
  98. +25 −0 test/dummy/public/500.html
  99. 0  test/dummy/public/favicon.ico
  100. +6 −0 test/dummy/script/rails
View
1  .gitignore
@@ -13,3 +13,4 @@
# Ignore all logfiles and tempfiles.
/log/*.log
/tmp
+.sass-cache
View
14 Gemfile
@@ -1,5 +1,7 @@
source 'https://rubygems.org'
+gemspec
+
gem 'rails', '3.2.8'
# Bundle edge Rails instead:
@@ -15,13 +17,7 @@ group :assets do
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
- gem 'therubyracer', :platforms => :ruby
- gem "less-rails" #Sprockets (what Rails 3.1 uses for its asset pipeline) supports LESS
- gem "twitter-bootstrap-rails"
-
gem 'uglifier', '>= 1.0.3'
- gem 'twitter-bootstrap-rails'
- gem 'kaminari-bootstrap'
end
gem 'jquery-rails'
@@ -41,5 +37,11 @@ gem 'bcrypt-ruby', '~> 3.0.0'
# To use debugger
# gem 'debugger'
+gem 'therubyracer'
+gem 'less-rails'
+gem 'twitter-bootstrap-rails'
+
gem 'kaminari'
+gem 'kaminari-bootstrap'
+
gem 'simple_form'
View
8 Gemfile.lock
@@ -1,3 +1,10 @@
+PATH
+ remote: .
+ specs:
+ rboard (0.0.1)
+ kaminari
+ rails (~> 3.2.8)
+
GEM
remote: https://rubygems.org/
specs:
@@ -133,6 +140,7 @@ DEPENDENCIES
kaminari-bootstrap
less-rails
rails (= 3.2.8)
+ rboard!
sass-rails (~> 3.2.3)
simple_form
sqlite3
View
41 Rakefile
@@ -1,7 +1,40 @@
#!/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.
+begin
+ require 'bundler/setup'
+rescue LoadError
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
+end
+begin
+ require 'rdoc/task'
+rescue LoadError
+ require 'rdoc/rdoc'
+ require 'rake/rdoctask'
+ RDoc::Task = Rake::RDocTask
+end
-require File.expand_path('../config/application', __FILE__)
+RDoc::Task.new(:rdoc) do |rdoc|
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = 'Xyz'
+ rdoc.options << '--line-numbers'
+ rdoc.rdoc_files.include('README.rdoc')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+end
-Rboard::Application.load_tasks
+APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
+load 'rails/tasks/engine.rake'
+
+
+
+Bundler::GemHelper.install_tasks
+
+require 'rake/testtask'
+
+Rake::TestTask.new(:test) do |t|
+ t.libs << 'lib'
+ t.libs << 'test'
+ t.pattern = 'test/**/*_test.rb'
+ t.verbose = false
+end
+
+
+task :default => :test
View
3  app/assets/stylesheets/comments.css.scss
@@ -1,3 +0,0 @@
-// Place all the styles related to the comments controller here.
-// They will automatically be included in application.css.
-// You can use Sass (SCSS) here: http://sass-lang.com/
View
0  app/assets/stylesheets/application.css → ...assets/stylesheets/rboard/application.css
File renamed without changes
View
0  app/assets/stylesheets/rboard.css.scss → ...assets/stylesheets/rboard/rboard.css.scss
File renamed without changes
View
83 app/controllers/boards_controller.rb
@@ -1,83 +0,0 @@
-class BoardsController < ApplicationController
- # GET /boards
- # GET /boards.json
- def index
- @boards = Board.all
-
- respond_to do |format|
- format.html # index.html.erb
- format.json { render json: @boards }
- end
- end
-
- # GET /boards/1
- # GET /boards/1.json
- def show
- @board = Board.find(params[:id])
-
- respond_to do |format|
- format.html # show.html.erb
- format.json { render json: @board }
- end
- end
-
- # GET /boards/new
- # GET /boards/new.json
- def new
- @board = Board.new
-
- respond_to do |format|
- format.html # new.html.erb
- format.json { render json: @board }
- end
- end
-
- # GET /boards/1/edit
- def edit
- @board = Board.find(params[:id])
- end
-
- # POST /boards
- # POST /boards.json
- def create
- @board = Board.new(params[:board])
-
- respond_to do |format|
- if @board.save
- format.html { redirect_to @board, notice: 'Board was successfully created.' }
- format.json { render json: @board, status: :created, location: @board }
- else
- format.html { render action: "new" }
- format.json { render json: @board.errors, status: :unprocessable_entity }
- end
- end
- end
-
- # PUT /boards/1
- # PUT /boards/1.json
- def update
- @board = Board.find(params[:id])
-
- respond_to do |format|
- if @board.update_attributes(params[:board])
- format.html { redirect_to @board, notice: 'Board was successfully updated.' }
- format.json { head :no_content }
- else
- format.html { render action: "edit" }
- format.json { render json: @board.errors, status: :unprocessable_entity }
- end
- end
- end
-
- # DELETE /boards/1
- # DELETE /boards/1.json
- def destroy
- @board = Board.find(params[:id])
- @board.destroy
-
- respond_to do |format|
- format.html { redirect_to boards_url }
- format.json { head :no_content }
- end
- end
-end
View
49 app/controllers/comments_controller.rb
@@ -1,49 +0,0 @@
-# vim: set fileencoding=utf-8 :
-class CommentsController < ApplicationController
-
- before_filter :set_board
-
- def set_board
- @board = Board.where(id: params[:board_id]).first
- end
-
-
- def show
- @comment = Comment.find(params[:id])
- end
-
- def create
- @topic = Topic.find(params[:topic_id])
- @board = @topic.board
-
- @comment = Comment.new(params[:comment])
- @comment.topic = @topic
- if @topic && @comment.save
- redirect_to [@topic.board, @topic]
- else
- flash[:notice] = "empty body"
- @comments = @topic.comments
- render "topics/show"
- end
- end
-
- def update
- @comment = Comment.find(params[:id])
- if @comment.update_attributes(params[:comment])
- redirect_to @comment.topic
- else
- render action: "edit"
- end
- end
-
- def edit
-
- end
-
- def destroy
- @comment = Comment.find(params[:id])
- @comment.destroy
-
- redirect_to @comment.topic
- end
-end
View
5 app/controllers/rboard/application_controller.rb
@@ -0,0 +1,5 @@
+module Rboard
+ class ApplicationController < ActionController::Base
+ protect_from_forgery
+ end
+end
View
85 app/controllers/rboard/boards_controller.rb
@@ -0,0 +1,85 @@
+module Rboard
+ class BoardsController < ApplicationController
+ # GET /boards
+ # GET /boards.json
+ def index
+ @boards = Board.all
+
+ respond_to do |format|
+ format.html # index.html.erb
+ format.json { render json: @boards }
+ end
+ end
+
+ # GET /boards/1
+ # GET /boards/1.json
+ def show
+ @board = Board.find(params[:id])
+
+ respond_to do |format|
+ format.html # show.html.erb
+ format.json { render json: @board }
+ end
+ end
+
+ # GET /boards/new
+ # GET /boards/new.json
+ def new
+ @board = Board.new
+
+ respond_to do |format|
+ format.html # new.html.erb
+ format.json { render json: @board }
+ end
+ end
+
+ # GET /boards/1/edit
+ def edit
+ @board = Board.find(params[:id])
+ end
+
+ # POST /boards
+ # POST /boards.json
+ def create
+ @board = Board.new(params[:board])
+
+ respond_to do |format|
+ if @board.save
+ format.html { redirect_to @board, notice: 'Board was successfully created.' }
+ format.json { render json: @board, status: :created, location: @board }
+ else
+ format.html { render action: "new" }
+ format.json { render json: @board.errors, status: :unprocessable_entity }
+ end
+ end
+ end
+
+ # PUT /boards/1
+ # PUT /boards/1.json
+ def update
+ @board = Board.find(params[:id])
+
+ respond_to do |format|
+ if @board.update_attributes(params[:board])
+ format.html { redirect_to @board, notice: 'Board was successfully updated.' }
+ format.json { head :no_content }
+ else
+ format.html { render action: "edit" }
+ format.json { render json: @board.errors, status: :unprocessable_entity }
+ end
+ end
+ end
+
+ # DELETE /boards/1
+ # DELETE /boards/1.json
+ def destroy
+ @board = Board.find(params[:id])
+ @board.destroy
+
+ respond_to do |format|
+ format.html { redirect_to boards_url }
+ format.json { head :no_content }
+ end
+ end
+ end
+end
View
51 app/controllers/rboard/comments_controller.rb
@@ -0,0 +1,51 @@
+# vim: set fileencoding=utf-8 :
+module Rboard
+ class CommentsController < ApplicationController
+
+ before_filter :set_board
+
+ def set_board
+ @board = Board.where(id: params[:board_id]).first
+ end
+
+
+ def show
+ @comment = Comment.find(params[:id])
+ end
+
+ def create
+ @topic = Topic.find(params[:topic_id])
+ @board = @topic.board
+
+ @comment = Comment.new(params[:comment])
+ @comment.topic = @topic
+ if @topic && @comment.save
+ redirect_to [@topic.board, @topic]
+ else
+ flash[:notice] = "empty body"
+ @comments = @topic.comments
+ render "topics/show"
+ end
+ end
+
+ def update
+ @comment = Comment.find(params[:id])
+ if @comment.update_attributes(params[:comment])
+ redirect_to @comment.topic
+ else
+ render action: "edit"
+ end
+ end
+
+ def edit
+
+ end
+
+ def destroy
+ @comment = Comment.find(params[:id])
+ @comment.destroy
+
+ redirect_to @comment.topic
+ end
+ end
+end
View
65 app/controllers/rboard/topics_controller.rb
@@ -0,0 +1,65 @@
+module Rboard
+ class TopicsController < ApplicationController
+ helper_method :depth_mark
+
+ before_filter :set_board
+
+ def set_board
+ @board = Board.where(id: params[:board_id]).first
+ end
+
+
+ def index
+ @topics = @board.topics.page(params[:page])
+ end
+
+ def show
+ @topic = Topic.find(params[:id])
+ @comment = Comment.new(topic: @topic)
+ @comments = @topic.comments
+ end
+
+ def new
+ @topic = Topic.new
+ end
+
+ def create
+ @topic = Topic.new(params[:topic])
+ @topic.board = @board
+ if params[:parent_id].present?
+ @topic.parent = Topic.find(params[:parent_id])
+ end
+
+ if @topic.save
+ redirect_to [@board, @topic], notice: 'Topic was created'
+ else
+ render action: "new"
+ end
+ end
+
+ def edit
+ @topic = Topic.find(params[:id])
+ end
+
+ def update
+ @topic = Topic.find(params[:id])
+ if @topic.update_attributes(params[:topic])
+ redirect_to [@board, @topic], notice: 'Topic was successfuly updated.'
+ else
+ render action: 'edit'
+ end
+ end
+
+ def destroy
+ @topic = Topic.find(params[:id])
+ @topic.destroy
+
+ redirect_to board_topics_url(@board)
+ end
+
+ private
+ def depth_mark(depth)
+ ("&#x21aa;" * depth).html_safe
+ end
+ end
+end
View
61 app/controllers/topics_controller.rb
@@ -1,61 +0,0 @@
-class TopicsController < ApplicationController
- helper_method :depth_mark
-
- before_filter :set_board
-
- def set_board
- @board = Board.where(id: params[:board_id]).first
- end
-
-
- def index
- @topics = @board.topics.page(params[:page])
- end
-
- def show
- @topic = Topic.find(params[:id])
- @comment = Comment.new(topic: @topic)
- @comments = @topic.comments
- end
-
- def new
- @topic = Topic.new
- end
-
- def create
- @topic = Topic.new(params[:topic])
- @topic.board = @board
- if params[:parent_id].present?
- @topic.parent = Topic.find(params[:parent_id])
- end
-
- if @topic.save
- redirect_to [@board, @topic], notice: 'Topic was created'
- end
- end
-
- def edit
- @topic = Topic.find(params[:id])
- end
-
- def update
- @topic = Topic.find(params[:id])
- if @topic.update_attributes(params[:topic])
- redirect_to [@board, @topic], notice: 'Topic was successfuly updated.'
- else
- render action: 'edit'
- end
- end
-
- def destroy
- @topic = Topic.find(params[:id])
- @topic.destroy
-
- redirect_to board_topics_url(@board)
- end
-
-private
- def depth_mark(depth)
- ("&#x21aa;" * depth).html_safe
- end
-end
View
8 app/models/admin.rb
@@ -1,8 +0,0 @@
-class Admin < ActiveRecord::Base
- has_secure_password
- has_many :topics
-
- attr_accessible :email, :name, :password, :password_confirmation
-
- validates :email, :uniqueness => true
-end
View
5 app/models/board.rb
@@ -1,5 +0,0 @@
-class Board < ActiveRecord::Base
- attr_accessible :acronym, :description, :name
-
- has_many :topics
-end
View
9 app/models/comment.rb
@@ -1,9 +0,0 @@
-class Comment < ActiveRecord::Base
- attr_accessible :body, :topic_id, :topic
-
- belongs_to :topic
-
- validates :topic, presence: true
- validates :body, presence: true
-
-end
View
10 app/models/rboard/admin.rb
@@ -0,0 +1,10 @@
+module Rboard
+ class Admin < ActiveRecord::Base
+ has_secure_password
+ has_many :topics
+
+ attr_accessible :email, :name, :password, :password_confirmation
+
+ validates :email, :uniqueness => true
+ end
+end
View
7 app/models/rboard/board.rb
@@ -0,0 +1,7 @@
+module Rboard
+ class Board < ActiveRecord::Base
+ attr_accessible :acronym, :description, :name
+
+ has_many :topics
+ end
+end
View
11 app/models/rboard/comment.rb
@@ -0,0 +1,11 @@
+module Rboard
+ class Comment < ActiveRecord::Base
+ attr_accessible :body, :topic_id, :topic
+
+ belongs_to :topic
+
+ validates :topic, presence: true
+ validates :body, presence: true
+
+ end
+end
View
48 app/models/rboard/topic.rb
@@ -0,0 +1,48 @@
+module Rboard
+ class Topic < ActiveRecord::Base
+ belongs_to :board
+ belongs_to :admin
+ has_many :comments
+
+ attr_accessible :body, :subject, :parent, :board
+ before_save :set_boardish
+
+ composed_of :boardish,
+ class_name: "Boardish", mapping: [%w(boardish raw)],
+ allow_nil: true,
+ converter: :to_i
+
+ validates :subject, presence: true, length: { minimum: 3, maximum: 50 }
+ validates :body, presence: true
+
+ default_scope { order("boardish desc") }
+
+ def parent=(p)
+ b = p.boardish.reply
+ while (prev = self.class.where(boardish: b).first).present?
+ b = b.inc_at_depth(b.depth)
+ end
+ self.boardish = b
+ end
+
+ def depth
+ self.boardish && self.boardish.depth || 0
+ end
+
+ private
+
+ def set_boardish
+ if self.boardish.nil?
+ t = self.class.last_root_topic
+ b = t && t.boardish || Boardish.new
+ self.boardish = b.inc_at_depth(0)
+ end
+ end
+
+ class << self
+ def last_root_topic
+ Topic.limit(1).first
+ end
+ end
+ end
+end
View
46 app/models/topic.rb
@@ -1,46 +0,0 @@
-class Topic < ActiveRecord::Base
- belongs_to :board
- belongs_to :admin
- has_many :comments
-
- attr_accessible :body, :subject, :parent, :board
- before_save :set_boardish
-
- composed_of :boardish,
- class_name: "Boardish", mapping: [%w(boardish raw)],
- allow_nil: true,
- converter: :to_i
-
- validates :subject, presence: true, length: { minimum: 3, maximum: 50 }
- validates :body, presence: true
-
- default_scope { order("boardish desc") }
-
- def parent=(p)
- b = p.boardish.reply
- while (prev = self.class.where(boardish: b).first).present?
- b = b.inc_at_depth(b.depth)
- end
- self.boardish = b
- end
-
- def depth
- self.boardish && self.boardish.depth || 0
- end
-
-private
-
- def set_boardish
- if self.boardish.nil?
- t = self.class.last_root_topic
- b = t && t.boardish || Boardish.new
- self.boardish = b.inc_at_depth(0)
- end
- end
-
- class << self
- def last_root_topic
- Topic.limit(1).first
- end
- end
-end
View
1  app/views/layouts/application.html.erb → ...views/layouts/rboard/application.html.erb
@@ -13,6 +13,7 @@
<![endif]-->
<%= stylesheet_link_tag "application", :media => "all" %>
+ <%= stylesheet_link_tag "rboard/rboard", :media => "all" %>
</head>
<body>
View
0  app/views/boards/_form.html.erb → app/views/rboard/boards/_form.html.erb
File renamed without changes
View
0  app/views/boards/edit.html.erb → app/views/rboard/boards/edit.html.erb
File renamed without changes
View
0  app/views/boards/index.html.erb → app/views/rboard/boards/index.html.erb
File renamed without changes
View
0  app/views/boards/new.html.erb → app/views/rboard/boards/new.html.erb
File renamed without changes
View
0  app/views/boards/show.html.erb → app/views/rboard/boards/show.html.erb
File renamed without changes
View
0  app/views/comments/_form.html.erb → app/views/rboard/comments/_form.html.erb
File renamed without changes
View
0  app/views/comments/create.html.erb → app/views/rboard/comments/create.html.erb
File renamed without changes
View
0  app/views/comments/destroy.html.erb → app/views/rboard/comments/destroy.html.erb
File renamed without changes
View
0  app/views/comments/edit.html.erb → app/views/rboard/comments/edit.html.erb
File renamed without changes
View
0  app/views/comments/index.html.erb → app/views/rboard/comments/index.html.erb
File renamed without changes
View
0  app/views/comments/new.html.erb → app/views/rboard/comments/new.html.erb
File renamed without changes
View
0  app/views/comments/show.html.erb → app/views/rboard/comments/show.html.erb
File renamed without changes
View
0  app/views/comments/update.html.erb → app/views/rboard/comments/update.html.erb
File renamed without changes
View
0  app/views/topics/_form.html.erb → app/views/rboard/topics/_form.html.erb
File renamed without changes
View
0  app/views/topics/create.html.erb → app/views/rboard/topics/create.html.erb
File renamed without changes
View
0  app/views/topics/destroy.html.erb → app/views/rboard/topics/destroy.html.erb
File renamed without changes
View
0  app/views/topics/edit.html.erb → app/views/rboard/topics/edit.html.erb
File renamed without changes
View
0  app/views/topics/index.html.erb → app/views/rboard/topics/index.html.erb
File renamed without changes
View
0  app/views/topics/new.html.erb → app/views/rboard/topics/new.html.erb
File renamed without changes
View
2  app/views/topics/show.html.erb → app/views/rboard/topics/show.html.erb
@@ -14,7 +14,7 @@
<div class="comments">
- <%= render partial: "comments/form", object: @new_comment %>
+ <%= render partial: "rboard/comments/form", object: @new_comment %>
<% flash.each do |k, v| %>
<div class="flash <%= k %>"><%= v %></div>
View
6 config/boot.rb
@@ -1,6 +0,0 @@
-require 'rubygems'
-
-# Set up gems listed in the Gemfile.
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
-
-require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
View
10 config/initializers/kaminari_config.rb
@@ -1,10 +0,0 @@
-Kaminari.configure do |config|
- config.default_per_page = 15
- # config.max_per_page = nil
- # config.window = 4
- # config.outer_window = 0
- # config.left = 0
- # config.right = 0
- # config.page_method_name = :page
- # config.param_name = :page
-end
View
142 config/initializers/simple_form.rb
@@ -1,142 +0,0 @@
-# Use this setup block to configure all options available in SimpleForm.
-SimpleForm.setup do |config|
- # Wrappers are used by the form builder to generate a
- # complete input. You can remove any component from the
- # wrapper, change the order or even add your own to the
- # stack. The options given below are used to wrap the
- # whole input.
- config.wrappers :default, :class => :input,
- :hint_class => :field_with_hint, :error_class => :field_with_errors do |b|
- ## Extensions enabled by default
- # Any of these extensions can be disabled for a
- # given input by passing: `f.input EXTENSION_NAME => false`.
- # You can make any of these extensions optional by
- # renaming `b.use` to `b.optional`.
-
- # Determines whether to use HTML5 (:email, :url, ...)
- # and required attributes
- b.use :html5
-
- # Calculates placeholders automatically from I18n
- # You can also pass a string as f.input :placeholder => "Placeholder"
- b.use :placeholder
-
- ## Optional extensions
- # They are disabled unless you pass `f.input EXTENSION_NAME => :lookup`
- # to the input. If so, they will retrieve the values from the model
- # if any exists. If you want to enable the lookup for any of those
- # extensions by default, you can change `b.optional` to `b.use`.
-
- # Calculates maxlength from length validations for string inputs
- b.optional :maxlength
-
- # Calculates pattern from format validations for string inputs
- b.optional :pattern
-
- # Calculates min and max from length validations for numeric inputs
- b.optional :min_max
-
- # Calculates readonly automatically from readonly attributes
- b.optional :readonly
-
- ## Inputs
- b.use :label_input
- b.use :hint, :wrap_with => { :tag => :span, :class => :hint }
- b.use :error, :wrap_with => { :tag => :span, :class => :error }
- end
-
- # The default wrapper to be used by the FormBuilder.
- config.default_wrapper = :default
-
- # Define the way to render check boxes / radio buttons with labels.
- # Defaults to :nested for bootstrap config.
- # :inline => input + label
- # :nested => label > input
- config.boolean_style = :nested
-
- # Default class for buttons
- config.button_class = 'btn'
-
- # Method used to tidy up errors. Specify any Rails Array method.
- # :first lists the first message for each field.
- # Use :to_sentence to list all errors for each field.
- # config.error_method = :first
-
- # Default tag used for error notification helper.
- config.error_notification_tag = :div
-
- # CSS class to add for error notification helper.
- config.error_notification_class = 'alert alert-error'
-
- # ID to add for error notification helper.
- # config.error_notification_id = nil
-
- # Series of attempts to detect a default label method for collection.
- # config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
-
- # Series of attempts to detect a default value method for collection.
- # config.collection_value_methods = [ :id, :to_s ]
-
- # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
- # config.collection_wrapper_tag = nil
-
- # You can define the class to use on all collection wrappers. Defaulting to none.
- # config.collection_wrapper_class = nil
-
- # You can wrap each item in a collection of radio/check boxes with a tag,
- # defaulting to :span. Please note that when using :boolean_style = :nested,
- # SimpleForm will force this option to be a label.
- # config.item_wrapper_tag = :span
-
- # You can define a class to use in all item wrappers. Defaulting to none.
- # config.item_wrapper_class = nil
-
- # How the label text should be generated altogether with the required text.
- # config.label_text = lambda { |label, required| "#{required} #{label}" }
-
- # You can define the class to use on all labels. Default is nil.
- config.label_class = 'control-label'
-
- # You can define the class to use on all forms. Default is simple_form.
- # config.form_class = :simple_form
-
- # You can define which elements should obtain additional classes
- # config.generate_additional_classes_for = [:wrapper, :label, :input]
-
- # Whether attributes are required by default (or not). Default is true.
- # config.required_by_default = true
-
- # Tell browsers whether to use default HTML5 validations (novalidate option).
- # Default is enabled.
- config.browser_validations = false
-
- # Collection of methods to detect if a file type was given.
- # config.file_methods = [ :mounted_as, :file?, :public_filename ]
-
- # Custom mappings for input types. This should be a hash containing a regexp
- # to match as key, and the input type that will be used when the field name
- # matches the regexp as value.
- # config.input_mappings = { /count/ => :integer }
-
- # Custom wrappers for input types. This should be a hash containing an input
- # type as key and the wrapper that will be used for all inputs with specified type.
- # config.wrapper_mappings = { :string => :prepend }
-
- # Default priority for time_zone inputs.
- # config.time_zone_priority = nil
-
- # Default priority for country inputs.
- # config.country_priority = nil
-
- # Default size for text inputs.
- # config.default_input_size = 50
-
- # When false, do not use translations for labels.
- # config.translate_labels = true
-
- # Automatically discover new inputs in Rails' autoload path.
- # config.inputs_discovery = true
-
- # Cache SimpleForm inputs discovery
- # config.cache_discovery = !Rails.env.development?
-end
View
45 config/initializers/simple_form_bootstrap.rb
@@ -1,45 +0,0 @@
-# Use this setup block to configure all options available in SimpleForm.
-SimpleForm.setup do |config|
- config.wrappers :bootstrap, :tag => 'div', :class => 'control-group', :error_class => 'error' do |b|
- b.use :html5
- b.use :placeholder
- b.use :label
- b.wrapper :tag => 'div', :class => 'controls' do |ba|
- ba.use :input
- ba.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
- ba.use :hint, :wrap_with => { :tag => 'p', :class => 'help-block' }
- end
- end
-
- config.wrappers :prepend, :tag => 'div', :class => "control-group", :error_class => 'error' do |b|
- b.use :html5
- b.use :placeholder
- b.use :label
- b.wrapper :tag => 'div', :class => 'controls' do |input|
- input.wrapper :tag => 'div', :class => 'input-prepend' do |prepend|
- prepend.use :input
- end
- input.use :hint, :wrap_with => { :tag => 'span', :class => 'help-block' }
- input.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
- end
- end
-
- config.wrappers :append, :tag => 'div', :class => "control-group", :error_class => 'error' do |b|
- b.use :html5
- b.use :placeholder
- b.use :label
- b.wrapper :tag => 'div', :class => 'controls' do |input|
- input.wrapper :tag => 'div', :class => 'input-append' do |append|
- append.use :input
- end
- input.use :hint, :wrap_with => { :tag => 'span', :class => 'help-block' }
- input.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
- end
- end
-
- # Wrappers for forms and inputs using the Twitter Bootstrap toolkit.
- # Check the Bootstrap docs (http://twitter.github.com/bootstrap)
- # to learn about the different styles for forms and inputs,
- # buttons and other elements.
- config.default_wrapper = :bootstrap
-end
View
26 config/locales/simple_form.en.yml
@@ -1,26 +0,0 @@
-en:
- simple_form:
- "yes": 'Yes'
- "no": 'No'
- required:
- text: 'required'
- mark: '*'
- # You can uncomment the line below if you need to overwrite the whole required html.
- # When using html, text and mark won't be used.
- # html: '<abbr title="required">*</abbr>'
- error_notification:
- default_message: "Please review the problems below:"
- # Labels and hints examples
- # labels:
- # defaults:
- # password: 'Password'
- # user:
- # new:
- # email: 'E-mail to sign in.'
- # edit:
- # email: 'E-mail.'
- # hints:
- # defaults:
- # username: 'User name to sign in.'
- # password: 'No special characters, please.'
-
View
59 config/routes.rb
@@ -1,65 +1,8 @@
-Rboard::Application.routes.draw do
+Rboard::Engine.routes.draw do
resources :boards do
resources :topics
end
resources :topics
resources :comments
-
- # The priority is based upon order of creation:
- # first created -> highest priority.
-
- # Sample of regular route:
- # match 'products/:id' => 'catalog#view'
- # Keep in mind you can assign values other than :controller and :action
-
- # Sample of named route:
- # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
- # This route can be invoked with purchase_url(:id => product.id)
-
- # Sample resource route (maps HTTP verbs to controller actions automatically):
- # resources :products
-
- # Sample resource route with options:
- # resources :products do
- # member do
- # get 'short'
- # post 'toggle'
- # end
- #
- # collection do
- # get 'sold'
- # end
- # end
-
- # Sample resource route with sub-resources:
- # resources :products do
- # resources :comments, :sales
- # resource :seller
- # end
-
- # Sample resource route with more complex sub-resources
- # resources :products do
- # resources :comments
- # resources :sales do
- # get 'recent', :on => :collection
- # end
- # end
-
- # Sample resource route within a namespace:
- # namespace :admin do
- # # Directs /admin/products/* to Admin::ProductsController
- # # (app/controllers/admin/products_controller.rb)
- # resources :products
- # end
-
- # You can have the root of your site routed with "root"
- # just remember to delete public/index.html.
- # root :to => 'welcome#index'
-
- # See how all your routes lay out with "rake routes"
-
- # This is a legacy wild controller route that's not recommended for RESTful applications.
- # Note: This route will make all actions in every controller accessible via GET requests.
- # match ':controller(/:action(/:id))(.:format)'
end
View
4 db/migrate/20121108081931_create_admins.rb → ...te/20121108081931_create_rboard_admins.rb
@@ -1,6 +1,6 @@
-class CreateAdmins < ActiveRecord::Migration
+class CreateRboardAdmins < ActiveRecord::Migration
def change
- create_table :admins do |t|
+ create_table :rboard_admins do |t|
t.string :email
t.string :password_digest
t.string :name
View
4 db/migrate/20121109051941_create_topics.rb → ...te/20121109051941_create_rboard_topics.rb
@@ -1,6 +1,6 @@
-class CreateTopics < ActiveRecord::Migration
+class CreateRboardTopics < ActiveRecord::Migration
def change
- create_table :topics do |t|
+ create_table :rboard_topics do |t|
t.integer :admin_id
t.string :subject
t.text :body
View
4 db/migrate/20121114072129_create_comments.rb → .../20121114072129_create_rboard_comments.rb
@@ -1,6 +1,6 @@
-class CreateComments < ActiveRecord::Migration
+class CreateRboardComments < ActiveRecord::Migration
def change
- create_table :comments do |t|
+ create_table :rboard_comments do |t|
t.string :topic_id
t.text :body
View
4 db/migrate/20121121022941_create_boards.rb → ...te/20121121022941_create_rboard_boards.rb
@@ -1,6 +1,6 @@
-class CreateBoards < ActiveRecord::Migration
+class CreateRboardBoards < ActiveRecord::Migration
def change
- create_table :boards do |t|
+ create_table :rboard_boards do |t|
t.string :name
t.string :acronym
t.text :description
View
5 db/migrate/20121121023435_add_board_id_to_rboard_topic.rb
@@ -0,0 +1,5 @@
+class AddBoardIdToRboardTopic < ActiveRecord::Migration
+ def change
+ add_column :rboard_topics, :board_id, :integer
+ end
+end
View
5 db/migrate/20121121023435_add_board_id_to_topic.rb
@@ -1,5 +0,0 @@
-class AddBoardIdToTopic < ActiveRecord::Migration
- def change
- add_column :topics, :board_id, :integer
- end
-end
View
4 lib/rboard.rb
@@ -0,0 +1,4 @@
+require "rboard/engine"
+
+module Rboard
+end
View
5 lib/rboard/engine.rb
@@ -0,0 +1,5 @@
+module Rboard
+ class Engine < ::Rails::Engine
+ isolate_namespace Rboard
+ end
+end
View
3  lib/rboard/version.rb
@@ -0,0 +1,3 @@
+module Rboard
+ VERSION = "0.0.1"
+end
View
24 rboard.gemspec
@@ -0,0 +1,24 @@
+$:.push File.expand_path("../lib", __FILE__)
+
+# Maintain your gem's version:
+require "rboard/version"
+
+# Describe your gem and declare its dependencies:
+Gem::Specification.new do |s|
+ s.name = "rboard"
+ s.version = Rboard::VERSION
+ s.authors = ["TODO: Your name"]
+ s.email = ["TODO: Your email"]
+ s.homepage = "TODO"
+ s.summary = "TODO: Summary of Xyz."
+ s.description = "TODO: Description of Xyz."
+
+ s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"]
+ s.test_files = Dir["test/**/*"]
+
+ s.add_dependency "rails", "~> 3.2.8"
+
+ s.add_dependency "kaminari"
+
+ s.add_development_dependency "sqlite3"
+end
View
8 script/rails
@@ -1,6 +1,8 @@
#!/usr/bin/env ruby
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
-APP_PATH = File.expand_path('../../config/application', __FILE__)
-require File.expand_path('../../config/boot', __FILE__)
-require 'rails/commands'
+ENGINE_ROOT = File.expand_path('../..', __FILE__)
+ENGINE_PATH = File.expand_path('../../lib/rboard/engine', __FILE__)
+
+require 'rails/all'
+require 'rails/engine/commands'
View
15 test/dummy/.gitignore
@@ -0,0 +1,15 @@
+# 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
View
261 test/dummy/README.rdoc
@@ -0,0 +1,261 @@
+== Welcome to Rails
+
+Rails is a web-application framework that includes everything needed to create
+database-backed web applications according to the Model-View-Control pattern.
+
+This pattern splits the view (also called the presentation) into "dumb"
+templates that are primarily responsible for inserting pre-built data in between
+HTML tags. The model contains the "smart" domain objects (such as Account,
+Product, Person, Post) that holds all the business logic and knows how to
+persist themselves to a database. The controller handles the incoming requests
+(such as Save New Account, Update Product, Show Post) by manipulating the model
+and directing data to the view.
+
+In Rails, the model is handled by what's called an object-relational mapping
+layer entitled Active Record. This layer allows you to present the data from
+database rows as objects and embellish these data objects with business logic
+methods. You can read more about Active Record in
+link:files/vendor/rails/activerecord/README.html.
+
+The controller and view are handled by the Action Pack, which handles both
+layers by its two parts: Action View and Action Controller. These two layers
+are bundled in a single package due to their heavy interdependence. This is
+unlike the relationship between the Active Record and Action Pack that is much
+more separate. Each of these packages can be used independently outside of
+Rails. You can read more about Action Pack in
+link:files/vendor/rails/actionpack/README.html.
+
+
+== Getting Started
+
+1. At the command prompt, create a new Rails application:
+ <tt>rails new myapp</tt> (where <tt>myapp</tt> is the application name)
+
+2. Change directory to <tt>myapp</tt> and start the web server:
+ <tt>cd myapp; rails server</tt> (run with --help for options)
+
+3. Go to http://localhost:3000/ and you'll see:
+ "Welcome aboard: You're riding Ruby on Rails!"
+
+4. Follow the guidelines to start developing your application. You can find
+the following resources handy:
+
+* The Getting Started Guide: http://guides.rubyonrails.org/getting_started.html
+* Ruby on Rails Tutorial Book: http://www.railstutorial.org/
+
+
+== Debugging Rails
+
+Sometimes your application goes wrong. Fortunately there are a lot of tools that
+will help you debug it and get it back on the rails.
+
+First area to check is the application log files. Have "tail -f" commands
+running on the server.log and development.log. Rails will automatically display
+debugging and runtime information to these files. Debugging info will also be
+shown in the browser on requests from 127.0.0.1.
+
+You can also log your own messages directly into the log file from your code
+using the Ruby logger class from inside your controllers. Example:
+
+ class WeblogController < ActionController::Base
+ def destroy
+ @weblog = Weblog.find(params[:id])
+ @weblog.destroy
+ logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!")
+ end
+ end
+
+The result will be a message in your log file along the lines of:
+
+ Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1!
+
+More information on how to use the logger is at http://www.ruby-doc.org/core/
+
+Also, Ruby documentation can be found at http://www.ruby-lang.org/. There are
+several books available online as well:
+
+* Programming Ruby: http://www.ruby-doc.org/docs/ProgrammingRuby/ (Pickaxe)
+* Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide)
+
+These two books will bring you up to speed on the Ruby language and also on
+programming in general.
+
+
+== Debugger
+
+Debugger support is available through the debugger command when you start your
+Mongrel or WEBrick server with --debugger. This means that you can break out of
+execution at any point in the code, investigate and change the model, and then,
+resume execution! You need to install ruby-debug to run the server in debugging
+mode. With gems, use <tt>sudo gem install ruby-debug</tt>. Example:
+
+ class WeblogController < ActionController::Base
+ def index
+ @posts = Post.all
+ debugger
+ end
+ end
+
+So the controller will accept the action, run the first line, then present you
+with a IRB prompt in the server window. Here you can do things like:
+
+ >> @posts.inspect
+ => "[#<Post:0x14a6be8
+ @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>,
+ #<Post:0x14a6620
+ @attributes={"title"=>"Rails", "body"=>"Only ten..", "id"=>"2"}>]"
+ >> @posts.first.title = "hello from a debugger"
+ => "hello from a debugger"
+
+...and even better, you can examine how your runtime objects actually work:
+
+ >> f = @posts.first
+ => #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
+ >> f.
+ Display all 152 possibilities? (y or n)
+
+Finally, when you're ready to resume execution, you can enter "cont".
+
+
+== Console
+
+The console is a Ruby shell, which allows you to interact with your
+application's domain model. Here you'll have all parts of the application
+configured, just like it is when the application is running. You can inspect
+domain models, change values, and save to the database. Starting the script
+without arguments will launch it in the development environment.
+
+To start the console, run <tt>rails console</tt> from the application
+directory.
+
+Options:
+
+* Passing the <tt>-s, --sandbox</tt> argument will rollback any modifications
+ made to the database.
+* Passing an environment name as an argument will load the corresponding
+ environment. Example: <tt>rails console production</tt>.
+
+To reload your controllers and models after launching the console run
+<tt>reload!</tt>
+
+More information about irb can be found at:
+link:http://www.rubycentral.org/pickaxe/irb.html
+
+
+== dbconsole
+
+You can go to the command line of your database directly through <tt>rails
+dbconsole</tt>. You would be connected to the database with the credentials
+defined in database.yml. Starting the script without arguments will connect you
+to the development database. Passing an argument will connect you to a different
+database, like <tt>rails dbconsole production</tt>. Currently works for MySQL,
+PostgreSQL and SQLite 3.
+
+== Description of Contents
+
+The default directory structure of a generated Ruby on Rails application:
+
+ |-- app
+ | |-- assets
+ | |-- images
+ | |-- javascripts
+ | `-- stylesheets
+ | |-- controllers
+ | |-- helpers
+ | |-- mailers
+ | |-- models
+ | `-- views
+ | `-- layouts
+ |-- config
+ | |-- environments
+ | |-- initializers
+ | `-- locales
+ |-- db
+ |-- doc
+ |-- lib
+ | `-- tasks
+ |-- log
+ |-- public
+ |-- script
+ |-- test
+ | |-- fixtures
+ | |-- functional
+ | |-- integration
+ | |-- performance
+ | `-- unit
+ |-- tmp
+ | |-- cache
+ | |-- pids
+ | |-- sessions
+ | `-- sockets
+ `-- vendor
+ |-- assets
+ `-- stylesheets
+ `-- plugins
+
+app
+ Holds all the code that's specific to this particular application.
+
+app/assets
+ Contains subdirectories for images, stylesheets, and JavaScript files.
+
+app/controllers
+ Holds controllers that should be named like weblogs_controller.rb for
+ automated URL mapping. All controllers should descend from
+ ApplicationController which itself descends from ActionController::Base.
+
+app/models
+ Holds models that should be named like post.rb. Models descend from
+ ActiveRecord::Base by default.
+
+app/views
+ Holds the template files for the view that should be named like
+ weblogs/index.html.erb for the WeblogsController#index action. All views use
+ eRuby syntax by default.
+
+app/views/layouts
+ Holds the template files for layouts to be used with views. This models the
+ common header/footer method of wrapping views. In your views, define a layout
+ using the <tt>layout :default</tt> and create a file named default.html.erb.
+ Inside default.html.erb, call <% yield %> to render the view using this
+ layout.
+
+app/helpers
+ Holds view helpers that should be named like weblogs_helper.rb. These are
+ generated for you automatically when using generators for controllers.
+ Helpers can be used to wrap functionality for your views into methods.
+
+config
+ Configuration files for the Rails environment, the routing map, the database,
+ and other dependencies.
+
+db
+ Contains the database schema in schema.rb. db/migrate contains all the
+ sequence of Migrations for your schema.
+
+doc
+ This directory is where your application documentation will be stored when
+ generated using <tt>rake doc:app</tt>
+
+lib
+ Application specific libraries. Basically, any kind of custom code that
+ doesn't belong under controllers, models, or helpers. This directory is in
+ the load path.
+
+public
+ The directory available for the web server. Also contains the dispatchers and the
+ default HTML files. This should be set as the DOCUMENT_ROOT of your web
+ server.
+
+script
+ Helper scripts for automation and generation.
+
+test
+ Unit and functional tests along with fixtures. When using the rails generate
+ command, template test files will be generated for you and placed in this
+ directory.
+
+vendor
+ External libraries that the application depends on. Also includes the plugins
+ subdirectory. If the app has frozen rails, those gems also go here, under
+ vendor/rails/. This directory is in the load path.
View
7 test/dummy/Rakefile
@@ -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__)
+
+Dummy::Application.load_tasks
View
15 test/dummy/app/assets/javascripts/application.js
@@ -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 .
View
13 test/dummy/app/assets/stylesheets/application.css
@@ -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 .
+ */
View
0  ...lesheets/bootstrap_and_overrides.css.less → ...lesheets/bootstrap_and_overrides.css.less
File renamed without changes
View
0  app/controllers/application_controller.rb → ...app/controllers/application_controller.rb
File renamed without changes
View
2  test/dummy/app/helpers/application_helper.rb
@@ -0,0 +1,2 @@
+module ApplicationHelper
+end
View
0  test/dummy/app/mailers/.gitkeep
No changes.
View
0  test/dummy/app/models/.gitkeep
No changes.
View
8 test/dummy/app/views/layouts/application.html.erb
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ </head>
+ <body>
+ <%= yield %>
+ </body>
+</html>
View
4 test/dummy/config.ru
@@ -0,0 +1,4 @@
+# This file is used by Rack-based servers to start the application.
+
+require ::File.expand_path('../config/environment', __FILE__)
+run Dummy::Application
View
11 config/application.rb → test/dummy/config/application.rb
@@ -2,14 +2,10 @@
require 'rails/all'
-if defined?(Bundler)
- # If you precompile assets before deploying to production, use this line
- Bundler.require(*Rails.groups(:assets => %w(development test)))
- # If you want your assets lazily compiled in production, use this line
- # Bundler.require(:default, :assets, Rails.env)
-end
+Bundler.require
+require "rboard"
-module Rboard
+module Dummy
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
@@ -60,3 +56,4 @@ class Application < Rails::Application
config.assets.version = '1.0'
end
end
+
View
10 test/dummy/config/boot.rb
@@ -0,0 +1,10 @@
+require 'rubygems'
+gemfile = File.expand_path('../../../../Gemfile', __FILE__)
+
+if File.exist?(gemfile)
+ ENV['BUNDLE_GEMFILE'] = gemfile
+ require 'bundler'
+ Bundler.setup
+end
+
+$:.unshift File.expand_path('../../../../lib', __FILE__)
View
0  config/database.yml → test/dummy/config/database.yml
File renamed without changes
View
2  config/environment.rb → test/dummy/config/environment.rb
@@ -2,4 +2,4 @@
require File.expand_path('../application', __FILE__)
# Initialize the rails application
-Rboard::Application.initialize!
+Dummy::Application.initialize!
View
2  config/environments/development.rb → .../dummy/config/environments/development.rb
@@ -1,4 +1,4 @@
-Rboard::Application.configure do
+Dummy::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# In the development environment your application's code is reloaded on
View
2  config/environments/production.rb → test/dummy/config/environments/production.rb
@@ -1,4 +1,4 @@
-Rboard::Application.configure do
+Dummy::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# Code is not reloaded between requests
View
2  config/environments/test.rb → test/dummy/config/environments/test.rb
@@ -1,4 +1,4 @@
-Rboard::Application.configure do
+Dummy::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# The test environment is used exclusively to run your application's
View
0  config/initializers/backtrace_silencers.rb → ...onfig/initializers/backtrace_silencers.rb
File renamed without changes
View
0  config/initializers/inflections.rb → .../dummy/config/initializers/inflections.rb
File renamed without changes
View
0  config/initializers/mime_types.rb → test/dummy/config/initializers/mime_types.rb
File renamed without changes
View
2  config/initializers/secret_token.rb → ...dummy/config/initializers/secret_token.rb
@@ -4,4 +4,4 @@
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
-Rboard::Application.config.secret_token = '179ff827c38bf6bd6dc279d41445d07eefcfe64888300979c6817b4a253bbfcd883cfb4697231edf0aee2ad3fb8995e24d5e734c8236c183bb64373a5aa69ee8'
+Dummy::Application.config.secret_token = '3812a78cf30f506e3f8bc816d737570c45d2fb365928afb705ce01737ed0a45072ddd89f6094b6713604ffbd777c88cda96463d2ec121ea070acd1b2a15d5ea3'
View
4 config/initializers/session_store.rb → ...ummy/config/initializers/session_store.rb
@@ -1,8 +1,8 @@
# Be sure to restart your server when you modify this file.
-Rboard::Application.config.session_store :cookie_store, key: '_rboard_session'
+Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rails generate session_migration")
-# Rboard::Application.config.session_store :active_record_store
+# Dummy::Application.config.session_store :active_record_store
View
0  config/initializers/wrap_parameters.rb → ...my/config/initializers/wrap_parameters.rb
File renamed without changes
View
0  config/locales/en.yml → test/dummy/config/locales/en.yml
File renamed without changes
View
4 test/dummy/config/routes.rb
@@ -0,0 +1,4 @@
+Rails.application.routes.draw do
+
+ mount Rboard::Engine => "/rboard"
+end
View
12 test/dummy/db/migrate/20121126025656_create_rboard_admins.rboard.rb
@@ -0,0 +1,12 @@
+# This migration comes from rboard (originally 20121108081931)
+class CreateRboardAdmins < ActiveRecord::Migration
+ def change
+ create_table :rboard_admins do |t|
+ t.string :email
+ t.string :password_digest
+ t.string :name
+
+ t.timestamps
+ end
+ end
+end
View
13 test/dummy/db/migrate/20121126025657_create_rboard_topics.rboard.rb
@@ -0,0 +1,13 @@
+# This migration comes from rboard (originally 20121109051941)
+class CreateRboardTopics < ActiveRecord::Migration
+ def change
+ create_table :rboard_topics do |t|
+ t.integer :admin_id
+ t.string :subject
+ t.text :body
+ t.integer :boardish
+
+ t.timestamps
+ end
+ end
+end
View
11 test/dummy/db/migrate/20121126025658_create_rboard_comments.rboard.rb
@@ -0,0 +1,11 @@
+# This migration comes from rboard (originally 20121114072129)
+class CreateRboardComments < ActiveRecord::Migration
+ def change
+ create_table :rboard_comments do |t|
+ t.string :topic_id
+ t.text :body
+
+ t.timestamps
+ end
+ end
+end
View
12 test/dummy/db/migrate/20121126025659_create_rboard_boards.rboard.rb
@@ -0,0 +1,12 @@
+# This migration comes from rboard (originally 20121121022941)
+class CreateRboardBoards < ActiveRecord::Migration
+ def change
+ create_table :rboard_boards do |t|
+ t.string :name
+ t.string :acronym
+ t.text :description
+
+ t.timestamps
+ end
+ end
+end
View
6 test/dummy/db/migrate/20121126025660_add_board_id_to_rboard_topic.rboard.rb
@@ -0,0 +1,6 @@
+# This migration comes from rboard (originally 20121121023435)
+class AddBoardIdToRboardTopic < ActiveRecord::Migration
+ def change
+ add_column :rboard_topics, :board_id, :integer
+ end
+end
View
49 test/dummy/db/schema.rb
@@ -0,0 +1,49 @@
+# encoding: UTF-8
+# This file is auto-generated from the current state of the database. Instead
+# of editing this file, please use the migrations feature of Active Record to
+# incrementally modify your database, and then regenerate this schema definition.
+#
+# Note that this schema.rb definition is the authoritative source for your
+# database schema. If you need to create the application database on another
+# system, you should be using db:schema:load, not running all the migrations
+# from scratch. The latter is a flawed and unsustainable approach (the more migrations
+# you'll amass, the slower it'll run and the greater likelihood for issues).
+#
+# It's strongly recommended to check this file into your version control system.
+
+ActiveRecord::Schema.define(:version => 20121126025660) do
+
+ create_table "rboard_admins", :force => true do |t|
+ t.string "email"
+ t.string "password_digest"
+ t.string "name"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "rboard_boards", :force => true do |t|
+ t.string "name"
+ t.string "acronym"
+ t.text "description"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "rboard_comments", :force => true do |t|
+ t.string "topic_id"
+ t.text "body"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "rboard_topics", :force => true do |t|
+ t.integer "admin_id"
+ t.string "subject"
+ t.text "body"
+ t.integer "boardish"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.integer "board_id"
+ end
+
+end
View
0  test/dummy/lib/assets/.gitkeep
No changes.
View
0  test/dummy/log/.gitkeep
No changes.
View
26 test/dummy/public/404.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>The page you were looking for doesn't exist (404)</title>
+ <style type="text/css">
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
+ div.dialog {
+ width: 25em;
+ padding: 0 4em;
+ margin: 4em auto 0 auto;
+ border: 1px solid #ccc;
+ border-right-color: #999;
+ border-bottom-color: #999;
+ }
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
+ </style>
+</head>
+
+<body>
+ <!-- This file lives in public/404.html -->
+ <div class="dialog">
+ <h1>The page you were looking for doesn't exist.</h1>
+ <p>You may have mistyped the address or the page may have moved.</p>
+ </div>
+</body>
+</html>
View
26 test/dummy/public/422.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>The change you wanted was rejected (422)</title>
+ <style type="text/css">
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
+ div.dialog {
+ width: 25em;
+ padding: 0 4em;
+ margin: 4em auto 0 auto;
+ border: 1px solid #ccc;
+ border-right-color: #999;
+ border-bottom-color: #999;
+ }
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
+ </style>
+</head>
+
+<body>
+ <!-- This file lives in public/422.html -->
+ <div class="dialog">
+ <h1>The change you wanted was rejected.</h1>
+ <p>Maybe you tried to change something you didn't have access to.</p>
+ </div>
+</body>
+</html>
View
25 test/dummy/public/500.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>We're sorry, but something went wrong (500)</title>
+ <style type="text/css">
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
+ div.dialog {
+ width: 25em;
+ padding: 0 4em;
+ margin: 4em auto 0 auto;
+ border: 1px solid #ccc;
+ border-right-color: #999;
+ border-bottom-color: #999;
+ }
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
+ </style>
+</head>
+
+<body>
+ <!-- This file lives in public/500.html -->
+ <div class="dialog">
+ <h1>We're sorry, but something went wrong.</h1>
+ </div>
+</body>
+</html>
View
0  test/dummy/public/favicon.ico
No changes.
View
6 test/dummy/script/rails
@@ -0,0 +1,6 @@
+#!/usr/bin/env ruby
+# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
+
+APP_PATH = File.expand_path('../../config/application', __FILE__)
+require File.expand_path('../../config/boot', __FILE__)
+require 'rails/commands'

No commit comments for this range

Something went wrong with that request. Please try again.