ticketee-forem 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. data/.gitignore +6 -0
  2. data/Gemfile +6 -0
  3. data/Gemfile.lock +144 -0
  4. data/MIT-LICENSE +20 -0
  5. data/README.rdoc +3 -0
  6. data/Rakefile +17 -0
  7. data/app/assets/images/.gitkeep +0 -0
  8. data/app/assets/javascripts/application.js +11 -0
  9. data/app/assets/javascripts/forem/posts.js +2 -0
  10. data/app/assets/javascripts/forem/topics.js +2 -0
  11. data/app/assets/stylesheets/application.css +7 -0
  12. data/app/assets/stylesheets/forem/posts.css +4 -0
  13. data/app/assets/stylesheets/forem/topics.css +4 -0
  14. data/app/controllers/forem/application_controller.rb +12 -0
  15. data/app/controllers/forem/posts_controller.rb +23 -0
  16. data/app/controllers/forem/topics_controller.rb +24 -0
  17. data/app/helpers/forem/application_helper.rb +4 -0
  18. data/app/helpers/forem/posts_helper.rb +4 -0
  19. data/app/helpers/forem/topics_helper.rb +4 -0
  20. data/app/models/forem/post.rb +5 -0
  21. data/app/models/forem/topic.rb +15 -0
  22. data/app/views/forem/posts/_form.html.erb +4 -0
  23. data/app/views/forem/posts/_post.html.erb +6 -0
  24. data/app/views/forem/posts/new.html.erb +5 -0
  25. data/app/views/forem/topics/_form.html.erb +11 -0
  26. data/app/views/forem/topics/index.html.erb +28 -0
  27. data/app/views/forem/topics/new.html.erb +2 -0
  28. data/app/views/forem/topics/show.html.erb +6 -0
  29. data/bin/autospec +16 -0
  30. data/bin/edit_json.rb +16 -0
  31. data/bin/erubis +16 -0
  32. data/bin/htmldiff +16 -0
  33. data/bin/launchy +16 -0
  34. data/bin/ldiff +16 -0
  35. data/bin/nokogiri +16 -0
  36. data/bin/prettify_json.rb +16 -0
  37. data/bin/rackup +16 -0
  38. data/bin/rails +16 -0
  39. data/bin/rake +16 -0
  40. data/bin/rake2thor +16 -0
  41. data/bin/rspec +16 -0
  42. data/bin/run_celerity_server.rb +16 -0
  43. data/bin/thor +16 -0
  44. data/bin/tilt +16 -0
  45. data/bin/tt +16 -0
  46. data/config/routes.rb +5 -0
  47. data/db/migrate/20110607015955_create_forem_topics.rb +10 -0
  48. data/db/migrate/20110607021318_create_forem_posts.rb +11 -0
  49. data/db/migrate/20110607035012_add_posts_count_to_forem_topics.rb +5 -0
  50. data/lib/forem.rb +4 -0
  51. data/lib/forem/engine.rb +10 -0
  52. data/lib/forem/user_extension.rb +8 -0
  53. data/lib/tasks/forem_tasks.rake +4 -0
  54. data/script/rails +6 -0
  55. data/spec/dummy/Rakefile +7 -0
  56. data/spec/dummy/app/assets/javascripts/application.js +9 -0
  57. data/spec/dummy/app/assets/stylesheets/application.css +7 -0
  58. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  59. data/spec/dummy/app/controllers/fake_controller.rb +5 -0
  60. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  61. data/spec/dummy/app/mailers/.gitkeep +0 -0
  62. data/spec/dummy/app/models/.gitkeep +0 -0
  63. data/spec/dummy/app/models/user.rb +7 -0
  64. data/spec/dummy/app/views/layouts/application.html.erb +18 -0
  65. data/spec/dummy/config.ru +4 -0
  66. data/spec/dummy/config/application.rb +49 -0
  67. data/spec/dummy/config/boot.rb +10 -0
  68. data/spec/dummy/config/database.yml +11 -0
  69. data/spec/dummy/config/environment.rb +5 -0
  70. data/spec/dummy/config/environments/development.rb +24 -0
  71. data/spec/dummy/config/environments/production.rb +52 -0
  72. data/spec/dummy/config/environments/test.rb +39 -0
  73. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  74. data/spec/dummy/config/initializers/inflections.rb +10 -0
  75. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  76. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  77. data/spec/dummy/config/initializers/session_store.rb +8 -0
  78. data/spec/dummy/config/initializers/wrap_parameters.rb +12 -0
  79. data/spec/dummy/config/locales/en.yml +5 -0
  80. data/spec/dummy/config/routes.rb +4 -0
  81. data/spec/dummy/db/development.sqlite3 +0 -0
  82. data/spec/dummy/db/migrate/20110607020624_create_forem_topics.rb +10 -0
  83. data/spec/dummy/db/migrate/20110607021444_create_forem_posts.rb +11 -0
  84. data/spec/dummy/db/migrate/20110607035916_add_posts_count_to_forem_topics.rb +5 -0
  85. data/spec/dummy/db/migrate/20110607055250_create_users.rb +9 -0
  86. data/spec/dummy/db/schema.rb +37 -0
  87. data/spec/dummy/db/test.sqlite3 +0 -0
  88. data/spec/dummy/log/.gitkeep +0 -0
  89. data/spec/dummy/public/404.html +26 -0
  90. data/spec/dummy/public/422.html +26 -0
  91. data/spec/dummy/public/500.html +26 -0
  92. data/spec/dummy/public/favicon.ico +0 -0
  93. data/spec/dummy/script/rails +6 -0
  94. data/spec/dummy/test/fixtures/users.yml +7 -0
  95. data/spec/dummy/test/unit/user_test.rb +7 -0
  96. data/spec/integration/posts_spec.rb +63 -0
  97. data/spec/integration/topics_spec.rb +46 -0
  98. data/spec/spec_helper.rb +14 -0
  99. data/spec/support/capybara.rb +8 -0
  100. data/spec/support/dummy_login.rb +19 -0
  101. data/spec/support/load_routes.rb +6 -0
  102. data/ticketee-forem.gemspec +16 -0
  103. metadata +195 -0
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'edit_json.rb' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('json_pure', 'edit_json.rb')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'erubis' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('erubis', 'erubis')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'htmldiff' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('diff-lcs', 'htmldiff')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'launchy' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('launchy', 'launchy')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'ldiff' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('diff-lcs', 'ldiff')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'nokogiri' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('nokogiri', 'nokogiri')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'prettify_json.rb' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('json_pure', 'prettify_json.rb')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'rackup' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('rack', 'rackup')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'rails' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('rails', 'rails')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'rake' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('rake', 'rake')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'rake2thor' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('thor', 'rake2thor')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'rspec' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('rspec-core', 'rspec')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'run_celerity_server.rb' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('culerity', 'run_celerity_server.rb')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'thor' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('thor', 'thor')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'tilt' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('tilt', 'tilt')
data/bin/tt ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'tt' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('treetop', 'tt')
@@ -0,0 +1,5 @@
1
+ Forem::Engine.routes.draw do
2
+ resources :topics do
3
+ resources :posts
4
+ end
5
+ end
@@ -0,0 +1,10 @@
1
+ class CreateForemTopics < ActiveRecord::Migration
2
+ def change
3
+ create_table :forem_topics do |t|
4
+ t.text :subject
5
+ t.integer :user_id
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,11 @@
1
+ class CreateForemPosts < ActiveRecord::Migration
2
+ def change
3
+ create_table :forem_posts do |t|
4
+ t.integer :topic_id
5
+ t.text :text
6
+ t.integer :user_id
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,5 @@
1
+ class AddPostsCountToForemTopics < ActiveRecord::Migration
2
+ def change
3
+ add_column :forem_topics, :posts_count, :integer, :default => 0
4
+ end
5
+ end
@@ -0,0 +1,4 @@
1
+ require "forem/engine"
2
+
3
+ module Forem
4
+ end
@@ -0,0 +1,10 @@
1
+ module Forem
2
+ class Engine < Rails::Engine
3
+ isolate_namespace Forem
4
+
5
+ config.generators.integration_tool :rspec
6
+ config.generators.test_framework :rspec
7
+ end
8
+ end
9
+
10
+ require 'forem/user_extension'
@@ -0,0 +1,8 @@
1
+ module Forem
2
+ module UserExtensions
3
+ def self.included(base)
4
+ Forem::Topic.belongs_to :user, :class_name => base.to_s
5
+ Forem::Post.belongs_to :user, :class_name => base.to_s
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :forem do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ #!/usr/bin/env ruby
3
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
4
+
5
+ ENGINE_PATH = File.expand_path('../..', __FILE__)
6
+ load File.expand_path('../../spec/dummy/script/rails', __FILE__)
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env rake
2
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
3
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
4
+
5
+ require File.expand_path('../config/application', __FILE__)
6
+
7
+ Dummy::Application.load_tasks
@@ -0,0 +1,9 @@
1
+ // This is a manifest file that'll be compiled into including all the files listed below.
2
+ // Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
3
+ // be included in the compiled file accessible from http://example.com/assets/application.js
4
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
5
+ // the compiled file.
6
+ //
7
+ //= require jquery
8
+ //= require jquery_ujs
9
+ //= require_tree .
@@ -0,0 +1,7 @@
1
+ /*
2
+ * This is a manifest file that'll automatically include all the stylesheets available in this directory
3
+ * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
4
+ * the top of the compiled file, but it's generally better to create a new file per style scope.
5
+ *= require_self
6
+ *= require_tree .
7
+ */
@@ -0,0 +1,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery
3
+ end
@@ -0,0 +1,5 @@
1
+ class FakeController < ApplicationController
2
+ def sign_in
3
+ render :text => "Placeholder login page."
4
+ end
5
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
File without changes
File without changes
@@ -0,0 +1,7 @@
1
+ class User < ActiveRecord::Base
2
+ include Forem::UserExtensions
3
+
4
+ def to_s
5
+ login
6
+ end
7
+ end
@@ -0,0 +1,18 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= stylesheet_link_tag "application" %>
6
+ <%= javascript_include_tag "application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <% flash.each do |key, message| %>
12
+ <div id='flash_<%= key %>'><%= message %></div>
13
+ <% end %>
14
+
15
+ <%= yield %>
16
+
17
+ </body>
18
+ </html>
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Dummy::Application