forem 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. data/.gitignore +8 -0
  2. data/Gemfile +13 -0
  3. data/Gemfile.lock +166 -0
  4. data/MIT-LICENSE +20 -0
  5. data/Rakefile +33 -0
  6. data/app/controllers/forem/application_controller.rb +13 -0
  7. data/app/controllers/forem/forums_controler.rb +11 -0
  8. data/app/controllers/forem/posts_controller.rb +26 -0
  9. data/app/controllers/forem/topics_controller.rb +35 -0
  10. data/app/helpers/forem/application_helper.rb +4 -0
  11. data/app/models/forem/forum.rb +4 -0
  12. data/app/models/forem/post.rb +11 -0
  13. data/app/models/forem/topic.rb +17 -0
  14. data/app/views/forem/forums/index.html.erb +13 -0
  15. data/app/views/forem/forums/show.html.erb +3 -0
  16. data/app/views/forem/posts/_form.html.erb +4 -0
  17. data/app/views/forem/posts/_post.html.erb +20 -0
  18. data/app/views/forem/posts/new.html.erb +6 -0
  19. data/app/views/forem/topics/_form.html.erb +9 -0
  20. data/app/views/forem/topics/new.html.erb +3 -0
  21. data/app/views/forem/topics/show.html.erb +6 -0
  22. data/config/locales/en.yml +23 -0
  23. data/config/routes.rb +9 -0
  24. data/db/migrate/20110214221555_create_forums.rb +13 -0
  25. data/db/migrate/20110221092741_create_topics.rb +11 -0
  26. data/db/migrate/20110221094502_create_posts.rb +11 -0
  27. data/db/migrate/20110228084940_add_reply_to_to_posts.rb +5 -0
  28. data/forem.gemspec +16 -0
  29. data/lib/forem.rb +4 -0
  30. data/lib/forem/engine.rb +13 -0
  31. data/lib/rack/utils_monkey_patch.rb +9 -0
  32. data/lib/tasks/forem_tasks.rake +4 -0
  33. data/public/javascripts/application.js +2 -0
  34. data/public/javascripts/controls.js +965 -0
  35. data/public/javascripts/dragdrop.js +974 -0
  36. data/public/javascripts/effects.js +1123 -0
  37. data/public/javascripts/prototype.js +6082 -0
  38. data/public/javascripts/rails.js +192 -0
  39. data/public/stylesheets/.gitkeep +0 -0
  40. data/script/rails +6 -0
  41. data/spec/dummy/Rakefile +7 -0
  42. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  43. data/spec/dummy/app/controllers/fake_controller.rb +5 -0
  44. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  45. data/spec/dummy/app/models/user.rb +6 -0
  46. data/spec/dummy/app/views/fake/sign_in.html.erb +7 -0
  47. data/spec/dummy/app/views/layouts/application.html.erb +17 -0
  48. data/spec/dummy/config.ru +4 -0
  49. data/spec/dummy/config/application.rb +43 -0
  50. data/spec/dummy/config/boot.rb +10 -0
  51. data/spec/dummy/config/database.yml +16 -0
  52. data/spec/dummy/config/environment.rb +5 -0
  53. data/spec/dummy/config/environments/development.rb +26 -0
  54. data/spec/dummy/config/environments/production.rb +49 -0
  55. data/spec/dummy/config/environments/test.rb +35 -0
  56. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  57. data/spec/dummy/config/initializers/inflections.rb +10 -0
  58. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  59. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  60. data/spec/dummy/config/initializers/session_store.rb +8 -0
  61. data/spec/dummy/config/locales/en.yml +5 -0
  62. data/spec/dummy/config/routes.rb +4 -0
  63. data/spec/dummy/db/migrate/001_create_users.rb +8 -0
  64. data/spec/dummy/db/schema.rb +43 -0
  65. data/spec/dummy/public/404.html +26 -0
  66. data/spec/dummy/public/422.html +26 -0
  67. data/spec/dummy/public/500.html +26 -0
  68. data/spec/dummy/public/favicon.ico +0 -0
  69. data/spec/dummy/public/javascripts/application.js +2 -0
  70. data/spec/dummy/public/javascripts/controls.js +965 -0
  71. data/spec/dummy/public/javascripts/dragdrop.js +974 -0
  72. data/spec/dummy/public/javascripts/effects.js +1123 -0
  73. data/spec/dummy/public/javascripts/prototype.js +6082 -0
  74. data/spec/dummy/public/javascripts/rails.js +192 -0
  75. data/spec/dummy/public/stylesheets/.gitkeep +0 -0
  76. data/spec/dummy/script/rails +6 -0
  77. data/spec/integration/forums_spec.rb +22 -0
  78. data/spec/integration/posts_spec.rb +36 -0
  79. data/spec/integration/topics_spec.rb +71 -0
  80. data/spec/models/post_spec.rb +16 -0
  81. data/spec/spec_helper.rb +15 -0
  82. data/spec/support/capybara.rb +6 -0
  83. data/spec/support/capybara_ext.rb +47 -0
  84. data/spec/support/dummy_login.rb +33 -0
  85. data/spec/support/factories.rb +45 -0
  86. data/spec/support/factories/forums.rb +4 -0
  87. data/spec/support/factories/topics.rb +4 -0
  88. data/spec/support/routes.rb +5 -0
  89. metadata +221 -0
@@ -0,0 +1,45 @@
1
+ def create_forum!(extra_attributes={})
2
+ attributes = {
3
+ :title => "Welcome to Forem!",
4
+ :description => "A placeholder forum."
5
+ }.merge!(extra_attributes)
6
+
7
+ @forum = Forem::Forum.create!(attributes)
8
+ end
9
+
10
+ def create_topic!(extra_attributes={})
11
+ attributes = { :subject => "FIRST TOPIC",
12
+ :posts_attributes => {
13
+ "0" => {
14
+ :text => "omgomgomg",
15
+ :user => User.first
16
+ }
17
+ }
18
+ }.merge!(extra_attributes)
19
+
20
+ create_forum! unless @forum
21
+ @topic = @forum.topics.create(attributes)
22
+ @post = @topic.posts.first
23
+ @post.user = @user || create_user!
24
+ @post.save!
25
+
26
+ @topic
27
+ end
28
+
29
+ def create_user!(extra_attributes={})
30
+ attributes = {
31
+ :login => "forem_user"
32
+ }.merge!(extra_attributes)
33
+
34
+ User.create!(attributes)
35
+ end
36
+
37
+ def create_post!(extra_attributes={})
38
+ attributes = {
39
+ :text => "This is a brand new post!",
40
+ :user => @user || create_user!
41
+ }.merge!(extra_attributes)
42
+
43
+ create_topic! unless @topic
44
+ @post = @topic.posts.create!(attributes)
45
+ end
@@ -0,0 +1,4 @@
1
+ # Factory.define(:forum) do |f|
2
+ # f.title "Welcome to Forem!"
3
+ # f.description "This is the first forum"
4
+ # end
@@ -0,0 +1,4 @@
1
+ # Factory.define(:topic) do |t|
2
+ # t.subject "FIRST POST"
3
+ # # t.posts { |p| [p.association(:post)] }
4
+ # end
@@ -0,0 +1,5 @@
1
+ # This will include the routing helpers in the specs so that we can use
2
+ # forum_path, forum_topic_path and so on to get to the routes.
3
+ RSpec.configure do |c|
4
+ c.include Forem::Engine.routes.url_helpers
5
+ end
metadata ADDED
@@ -0,0 +1,221 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: forem
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 1
9
+ version: 0.0.1
10
+ platform: ruby
11
+ authors: []
12
+
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2011-03-03 00:00:00 +11:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: launchy
22
+ requirement: &id001 !ruby/object:Gem::Requirement
23
+ none: false
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
29
+ version: "0"
30
+ type: :development
31
+ prerelease: false
32
+ version_requirements: *id001
33
+ - !ruby/object:Gem::Dependency
34
+ name: rspec-rails
35
+ requirement: &id002 !ruby/object:Gem::Requirement
36
+ none: false
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ segments:
41
+ - 2
42
+ - 5
43
+ version: "2.5"
44
+ type: :development
45
+ prerelease: false
46
+ version_requirements: *id002
47
+ - !ruby/object:Gem::Dependency
48
+ name: capybara
49
+ requirement: &id003 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ segments:
55
+ - 0
56
+ version: "0"
57
+ type: :development
58
+ prerelease: false
59
+ version_requirements: *id003
60
+ - !ruby/object:Gem::Dependency
61
+ name: sqlite3-ruby
62
+ requirement: &id004 !ruby/object:Gem::Requirement
63
+ none: false
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ segments:
68
+ - 0
69
+ version: "0"
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: *id004
73
+ - !ruby/object:Gem::Dependency
74
+ name: simple_form
75
+ requirement: &id005 !ruby/object:Gem::Requirement
76
+ none: false
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ segments:
81
+ - 0
82
+ version: "0"
83
+ type: :runtime
84
+ prerelease: false
85
+ version_requirements: *id005
86
+ description: The best Rails 3 forum engine in the world.
87
+ email:
88
+ executables: []
89
+
90
+ extensions: []
91
+
92
+ extra_rdoc_files: []
93
+
94
+ files:
95
+ - .gitignore
96
+ - .rvmrc
97
+ - Gemfile
98
+ - Gemfile.lock
99
+ - MIT-LICENSE
100
+ - Rakefile
101
+ - app/controllers/forem/application_controller.rb
102
+ - app/controllers/forem/forums_controler.rb
103
+ - app/controllers/forem/posts_controller.rb
104
+ - app/controllers/forem/topics_controller.rb
105
+ - app/helpers/forem/application_helper.rb
106
+ - app/models/forem/forum.rb
107
+ - app/models/forem/post.rb
108
+ - app/models/forem/topic.rb
109
+ - app/views/forem/forums/index.html.erb
110
+ - app/views/forem/forums/show.html.erb
111
+ - app/views/forem/posts/_form.html.erb
112
+ - app/views/forem/posts/_post.html.erb
113
+ - app/views/forem/posts/new.html.erb
114
+ - app/views/forem/topics/_form.html.erb
115
+ - app/views/forem/topics/new.html.erb
116
+ - app/views/forem/topics/show.html.erb
117
+ - config/locales/en.yml
118
+ - config/routes.rb
119
+ - db/migrate/20110214221555_create_forums.rb
120
+ - db/migrate/20110221092741_create_topics.rb
121
+ - db/migrate/20110221094502_create_posts.rb
122
+ - db/migrate/20110228084940_add_reply_to_to_posts.rb
123
+ - forem.gemspec
124
+ - lib/forem.rb
125
+ - lib/forem/engine.rb
126
+ - lib/rack/utils_monkey_patch.rb
127
+ - lib/tasks/forem_tasks.rake
128
+ - public/javascripts/application.js
129
+ - public/javascripts/controls.js
130
+ - public/javascripts/dragdrop.js
131
+ - public/javascripts/effects.js
132
+ - public/javascripts/prototype.js
133
+ - public/javascripts/rails.js
134
+ - public/stylesheets/.gitkeep
135
+ - script/rails
136
+ - spec/dummy/Rakefile
137
+ - spec/dummy/app/controllers/application_controller.rb
138
+ - spec/dummy/app/controllers/fake_controller.rb
139
+ - spec/dummy/app/helpers/application_helper.rb
140
+ - spec/dummy/app/models/user.rb
141
+ - spec/dummy/app/views/fake/sign_in.html.erb
142
+ - spec/dummy/app/views/layouts/application.html.erb
143
+ - spec/dummy/config.ru
144
+ - spec/dummy/config/application.rb
145
+ - spec/dummy/config/boot.rb
146
+ - spec/dummy/config/database.yml
147
+ - spec/dummy/config/environment.rb
148
+ - spec/dummy/config/environments/development.rb
149
+ - spec/dummy/config/environments/production.rb
150
+ - spec/dummy/config/environments/test.rb
151
+ - spec/dummy/config/initializers/backtrace_silencers.rb
152
+ - spec/dummy/config/initializers/inflections.rb
153
+ - spec/dummy/config/initializers/mime_types.rb
154
+ - spec/dummy/config/initializers/secret_token.rb
155
+ - spec/dummy/config/initializers/session_store.rb
156
+ - spec/dummy/config/locales/en.yml
157
+ - spec/dummy/config/routes.rb
158
+ - spec/dummy/db/development.sqlite3
159
+ - spec/dummy/db/migrate/001_create_users.rb
160
+ - spec/dummy/db/schema.rb
161
+ - spec/dummy/log/development.log
162
+ - spec/dummy/public/404.html
163
+ - spec/dummy/public/422.html
164
+ - spec/dummy/public/500.html
165
+ - spec/dummy/public/favicon.ico
166
+ - spec/dummy/public/javascripts/application.js
167
+ - spec/dummy/public/javascripts/controls.js
168
+ - spec/dummy/public/javascripts/dragdrop.js
169
+ - spec/dummy/public/javascripts/effects.js
170
+ - spec/dummy/public/javascripts/prototype.js
171
+ - spec/dummy/public/javascripts/rails.js
172
+ - spec/dummy/public/stylesheets/.gitkeep
173
+ - spec/dummy/script/rails
174
+ - spec/integration/forums_spec.rb
175
+ - spec/integration/posts_spec.rb
176
+ - spec/integration/topics_spec.rb
177
+ - spec/models/post_spec.rb
178
+ - spec/spec_helper.rb
179
+ - spec/support/capybara.rb
180
+ - spec/support/capybara_ext.rb
181
+ - spec/support/dummy_login.rb
182
+ - spec/support/factories.rb
183
+ - spec/support/factories/forums.rb
184
+ - spec/support/factories/topics.rb
185
+ - spec/support/routes.rb
186
+ has_rdoc: true
187
+ homepage:
188
+ licenses: []
189
+
190
+ post_install_message:
191
+ rdoc_options: []
192
+
193
+ require_paths:
194
+ - lib
195
+ required_ruby_version: !ruby/object:Gem::Requirement
196
+ none: false
197
+ requirements:
198
+ - - ">="
199
+ - !ruby/object:Gem::Version
200
+ hash: 4438804547321452149
201
+ segments:
202
+ - 0
203
+ version: "0"
204
+ required_rubygems_version: !ruby/object:Gem::Requirement
205
+ none: false
206
+ requirements:
207
+ - - ">="
208
+ - !ruby/object:Gem::Version
209
+ hash: 4438804547321452149
210
+ segments:
211
+ - 0
212
+ version: "0"
213
+ requirements: []
214
+
215
+ rubyforge_project:
216
+ rubygems_version: 1.3.7
217
+ signing_key:
218
+ specification_version: 3
219
+ summary: The best Rails 3 forum engine in the world.
220
+ test_files: []
221
+