blogmodule 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.rdoc +3 -0
  3. data/Rakefile +39 -0
  4. data/app/assets/javascripts/categories.js +2 -0
  5. data/app/assets/javascripts/posts.js +2 -0
  6. data/app/assets/stylesheets/categories.css +4 -0
  7. data/app/assets/stylesheets/scaffold.css +56 -0
  8. data/app/controllers/categories_controller.rb +77 -0
  9. data/app/controllers/posts_controller.rb +94 -0
  10. data/app/controllers/posts_controller.rb~ +92 -0
  11. data/app/helpers/categories_helper.rb +2 -0
  12. data/app/helpers/posts_helper.rb +2 -0
  13. data/app/models/category.rb +4 -0
  14. data/app/models/category.rb~ +3 -0
  15. data/app/models/post.rb +14 -0
  16. data/app/models/post.rb~ +12 -0
  17. data/app/views/categories/_form.html.erb +21 -0
  18. data/app/views/categories/edit.html.erb +6 -0
  19. data/app/views/categories/index.html.erb +14 -0
  20. data/app/views/categories/new.html.erb +5 -0
  21. data/app/views/categories/show.html.erb +7 -0
  22. data/app/views/posts/_categories.html.erb +5 -0
  23. data/app/views/posts/_categories.html.erb~ +5 -0
  24. data/app/views/posts/_form.html.erb +42 -0
  25. data/app/views/posts/_form.html.erb~ +40 -0
  26. data/app/views/posts/edit.html.erb +6 -0
  27. data/app/views/posts/index.html.erb +17 -0
  28. data/app/views/posts/index.html.erb~ +20 -0
  29. data/app/views/posts/new.html.erb +5 -0
  30. data/app/views/posts/show.html.erb +27 -0
  31. data/app/views/posts/show.html.erb~ +30 -0
  32. data/config/routes.rb +6 -0
  33. data/db/migrate/20111231175637_create_categories.rb +13 -0
  34. data/db/migrate/20111231175637_create_categories.rb~ +9 -0
  35. data/db/migrate/20111231181111_create_posts.rb +17 -0
  36. data/db/migrate/20111231181111_create_posts.rb~ +17 -0
  37. data/db/migrate/20111231183528_add_categories_to_post.rb~ +7 -0
  38. data/db/migrate/20111231183528_create_categories_posts.rb +12 -0
  39. data/db/migrate/20111231183528_create_categories_posts.rb~ +7 -0
  40. data/lib/blogmodule.rb +4 -0
  41. data/lib/blogmodule/engine.rb +4 -0
  42. data/lib/blogmodule/version.rb +3 -0
  43. data/lib/tasks/blogmodule_tasks.rake +4 -0
  44. data/test/blogmodule_test.rb +7 -0
  45. data/test/dummy/Rakefile +7 -0
  46. data/test/dummy/app/assets/javascripts/application.js +9 -0
  47. data/test/dummy/app/assets/stylesheets/application.css +7 -0
  48. data/test/dummy/app/controllers/application_controller.rb +3 -0
  49. data/test/dummy/app/helpers/application_helper.rb +2 -0
  50. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  51. data/test/dummy/config.ru +4 -0
  52. data/test/dummy/config/application.rb +45 -0
  53. data/test/dummy/config/boot.rb +10 -0
  54. data/test/dummy/config/database.yml +25 -0
  55. data/test/dummy/config/environment.rb +5 -0
  56. data/test/dummy/config/environments/development.rb +30 -0
  57. data/test/dummy/config/environments/production.rb +60 -0
  58. data/test/dummy/config/environments/test.rb +39 -0
  59. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  60. data/test/dummy/config/initializers/inflections.rb +10 -0
  61. data/test/dummy/config/initializers/mime_types.rb +5 -0
  62. data/test/dummy/config/initializers/secret_token.rb +7 -0
  63. data/test/dummy/config/initializers/session_store.rb +8 -0
  64. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  65. data/test/dummy/config/locales/en.yml +5 -0
  66. data/test/dummy/config/routes.rb +58 -0
  67. data/test/dummy/db/development.sqlite3 +0 -0
  68. data/test/dummy/db/schema.rb +37 -0
  69. data/test/dummy/log/development.log +10438 -0
  70. data/test/dummy/public/404.html +26 -0
  71. data/test/dummy/public/422.html +26 -0
  72. data/test/dummy/public/500.html +26 -0
  73. data/test/dummy/public/favicon.ico +0 -0
  74. data/test/dummy/script/rails +6 -0
  75. data/test/dummy/tmp/cache/assets/BAD/970/sprockets%2F9a5112306a4228313104b6e694330675 +378 -0
  76. data/test/dummy/tmp/cache/assets/CD1/FE0/sprockets%2Fa933373e0504e8cd28ab26932e144bb1 +9289 -0
  77. data/test/dummy/tmp/cache/assets/CD8/430/sprockets%2F2859ec948a5d3b35fed62400c142008c +0 -0
  78. data/test/dummy/tmp/cache/assets/CD8/710/sprockets%2F4597cff24032334bc3e3542f0754bac8 +395 -0
  79. data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +38 -0
  80. data/test/dummy/tmp/cache/assets/D54/ED0/sprockets%2F71c9fa01091d432b131da3bb73faf3d4 +10 -0
  81. data/test/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384 +9652 -0
  82. data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  83. data/test/dummy/tmp/cache/assets/E2C/A10/sprockets%2F9accda57c2c3dd81f1fadc6e19c55c90 +13 -0
  84. data/test/dummy/tmp/cache/assets/E3E/820/sprockets%2F5a1c7de58da1288fd9f29b75aeedf6ea +9272 -0
  85. data/test/fixtures/categories.yml +7 -0
  86. data/test/fixtures/posts.yml +15 -0
  87. data/test/functional/categories_controller_test.rb +49 -0
  88. data/test/functional/posts_controller_test.rb +49 -0
  89. data/test/integration/navigation_test.rb +10 -0
  90. data/test/test_helper.rb +10 -0
  91. data/test/unit/category_test.rb +7 -0
  92. data/test/unit/helpers/categories_helper_test.rb +4 -0
  93. data/test/unit/helpers/posts_helper_test.rb +4 -0
  94. data/test/unit/post_test.rb +7 -0
  95. metadata +212 -0
@@ -0,0 +1,7 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
+
3
+ one:
4
+ name: MyString
5
+
6
+ two:
7
+ name: MyString
@@ -0,0 +1,15 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
+
3
+ one:
4
+ indexpage: false
5
+ title: MyString
6
+ date: 2011-12-31 16:11:11
7
+ content: MyText
8
+ category:
9
+
10
+ two:
11
+ indexpage: false
12
+ title: MyString
13
+ date: 2011-12-31 16:11:11
14
+ content: MyText
15
+ category:
@@ -0,0 +1,49 @@
1
+ require 'test_helper'
2
+
3
+ class CategoriesControllerTest < ActionController::TestCase
4
+ setup do
5
+ @category = categories(:one)
6
+ end
7
+
8
+ test "should get index" do
9
+ get :index
10
+ assert_response :success
11
+ assert_not_nil assigns(:categories)
12
+ end
13
+
14
+ test "should get new" do
15
+ get :new
16
+ assert_response :success
17
+ end
18
+
19
+ test "should create category" do
20
+ assert_difference('Category.count') do
21
+ post :create, category: @category.attributes
22
+ end
23
+
24
+ assert_redirected_to category_path(assigns(:category))
25
+ end
26
+
27
+ test "should show category" do
28
+ get :show, id: @category.to_param
29
+ assert_response :success
30
+ end
31
+
32
+ test "should get edit" do
33
+ get :edit, id: @category.to_param
34
+ assert_response :success
35
+ end
36
+
37
+ test "should update category" do
38
+ put :update, id: @category.to_param, category: @category.attributes
39
+ assert_redirected_to category_path(assigns(:category))
40
+ end
41
+
42
+ test "should destroy category" do
43
+ assert_difference('Category.count', -1) do
44
+ delete :destroy, id: @category.to_param
45
+ end
46
+
47
+ assert_redirected_to categories_path
48
+ end
49
+ end
@@ -0,0 +1,49 @@
1
+ require 'test_helper'
2
+
3
+ class PostsControllerTest < ActionController::TestCase
4
+ setup do
5
+ @post = posts(:one)
6
+ end
7
+
8
+ test "should get index" do
9
+ get :index
10
+ assert_response :success
11
+ assert_not_nil assigns(:posts)
12
+ end
13
+
14
+ test "should get new" do
15
+ get :new
16
+ assert_response :success
17
+ end
18
+
19
+ test "should create post" do
20
+ assert_difference('Post.count') do
21
+ post :create, post: @post.attributes
22
+ end
23
+
24
+ assert_redirected_to post_path(assigns(:post))
25
+ end
26
+
27
+ test "should show post" do
28
+ get :show, id: @post.to_param
29
+ assert_response :success
30
+ end
31
+
32
+ test "should get edit" do
33
+ get :edit, id: @post.to_param
34
+ assert_response :success
35
+ end
36
+
37
+ test "should update post" do
38
+ put :update, id: @post.to_param, post: @post.attributes
39
+ assert_redirected_to post_path(assigns(:post))
40
+ end
41
+
42
+ test "should destroy post" do
43
+ assert_difference('Post.count', -1) do
44
+ delete :destroy, id: @post.to_param
45
+ end
46
+
47
+ assert_redirected_to posts_path
48
+ end
49
+ end
@@ -0,0 +1,10 @@
1
+ require 'test_helper'
2
+
3
+ class NavigationTest < ActionDispatch::IntegrationTest
4
+ fixtures :all
5
+
6
+ # test "the truth" do
7
+ # assert true
8
+ # end
9
+ end
10
+
@@ -0,0 +1,10 @@
1
+ # Configure Rails Environment
2
+ ENV["RAILS_ENV"] = "test"
3
+
4
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
+ require "rails/test_help"
6
+
7
+ Rails.backtrace_cleaner.remove_silencers!
8
+
9
+ # Load support files
10
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class CategoryTest < ActiveSupport::TestCase
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
@@ -0,0 +1,4 @@
1
+ require 'test_helper'
2
+
3
+ class CategoriesHelperTest < ActionView::TestCase
4
+ end
@@ -0,0 +1,4 @@
1
+ require 'test_helper'
2
+
3
+ class PostsHelperTest < ActionView::TestCase
4
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class PostTest < ActiveSupport::TestCase
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
metadata ADDED
@@ -0,0 +1,212 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: blogmodule
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Pedro H
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-01-01 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ requirement: &7814560 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 3.1.3
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *7814560
25
+ - !ruby/object:Gem::Dependency
26
+ name: sqlite3
27
+ requirement: &7813820 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: *7813820
36
+ description: Description of Blogmodule.
37
+ email:
38
+ - pedrohenriqueacruz@gmail.com
39
+ executables: []
40
+ extensions: []
41
+ extra_rdoc_files: []
42
+ files:
43
+ - app/views/categories/new.html.erb
44
+ - app/views/categories/show.html.erb
45
+ - app/views/categories/index.html.erb
46
+ - app/views/categories/edit.html.erb
47
+ - app/views/categories/_form.html.erb
48
+ - app/views/posts/new.html.erb
49
+ - app/views/posts/_form.html.erb~
50
+ - app/views/posts/show.html.erb~
51
+ - app/views/posts/index.html.erb~
52
+ - app/views/posts/show.html.erb
53
+ - app/views/posts/_categories.html.erb~
54
+ - app/views/posts/index.html.erb
55
+ - app/views/posts/edit.html.erb
56
+ - app/views/posts/_form.html.erb
57
+ - app/views/posts/_categories.html.erb
58
+ - app/helpers/categories_helper.rb
59
+ - app/helpers/posts_helper.rb
60
+ - app/models/category.rb
61
+ - app/models/category.rb~
62
+ - app/models/post.rb~
63
+ - app/models/post.rb
64
+ - app/assets/javascripts/categories.js
65
+ - app/assets/javascripts/posts.js
66
+ - app/assets/stylesheets/scaffold.css
67
+ - app/assets/stylesheets/categories.css
68
+ - app/controllers/posts_controller.rb~
69
+ - app/controllers/posts_controller.rb
70
+ - app/controllers/categories_controller.rb
71
+ - config/routes.rb
72
+ - db/migrate/20111231183528_create_categories_posts.rb
73
+ - db/migrate/20111231181111_create_posts.rb
74
+ - db/migrate/20111231181111_create_posts.rb~
75
+ - db/migrate/20111231183528_add_categories_to_post.rb~
76
+ - db/migrate/20111231183528_create_categories_posts.rb~
77
+ - db/migrate/20111231175637_create_categories.rb~
78
+ - db/migrate/20111231175637_create_categories.rb
79
+ - lib/blogmodule/engine.rb
80
+ - lib/blogmodule/version.rb
81
+ - lib/blogmodule.rb
82
+ - lib/tasks/blogmodule_tasks.rake
83
+ - MIT-LICENSE
84
+ - Rakefile
85
+ - README.rdoc
86
+ - test/integration/navigation_test.rb
87
+ - test/test_helper.rb
88
+ - test/unit/helpers/categories_helper_test.rb
89
+ - test/unit/helpers/posts_helper_test.rb
90
+ - test/unit/category_test.rb
91
+ - test/unit/post_test.rb
92
+ - test/dummy/config.ru
93
+ - test/dummy/db/schema.rb
94
+ - test/dummy/db/development.sqlite3
95
+ - test/dummy/config/initializers/secret_token.rb
96
+ - test/dummy/config/initializers/mime_types.rb
97
+ - test/dummy/config/initializers/inflections.rb
98
+ - test/dummy/config/initializers/wrap_parameters.rb
99
+ - test/dummy/config/initializers/backtrace_silencers.rb
100
+ - test/dummy/config/initializers/session_store.rb
101
+ - test/dummy/config/environment.rb
102
+ - test/dummy/config/locales/en.yml
103
+ - test/dummy/config/routes.rb
104
+ - test/dummy/config/environments/test.rb
105
+ - test/dummy/config/environments/production.rb
106
+ - test/dummy/config/environments/development.rb
107
+ - test/dummy/config/boot.rb
108
+ - test/dummy/config/application.rb
109
+ - test/dummy/config/database.yml
110
+ - test/dummy/script/rails
111
+ - test/dummy/log/development.log
112
+ - test/dummy/app/views/layouts/application.html.erb
113
+ - test/dummy/app/helpers/application_helper.rb
114
+ - test/dummy/app/assets/javascripts/application.js
115
+ - test/dummy/app/assets/stylesheets/application.css
116
+ - test/dummy/app/controllers/application_controller.rb
117
+ - test/dummy/public/422.html
118
+ - test/dummy/public/500.html
119
+ - test/dummy/public/favicon.ico
120
+ - test/dummy/public/404.html
121
+ - test/dummy/Rakefile
122
+ - test/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384
123
+ - test/dummy/tmp/cache/assets/CD1/FE0/sprockets%2Fa933373e0504e8cd28ab26932e144bb1
124
+ - test/dummy/tmp/cache/assets/D54/ED0/sprockets%2F71c9fa01091d432b131da3bb73faf3d4
125
+ - test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705
126
+ - test/dummy/tmp/cache/assets/E3E/820/sprockets%2F5a1c7de58da1288fd9f29b75aeedf6ea
127
+ - test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af
128
+ - test/dummy/tmp/cache/assets/CD8/710/sprockets%2F4597cff24032334bc3e3542f0754bac8
129
+ - test/dummy/tmp/cache/assets/CD8/430/sprockets%2F2859ec948a5d3b35fed62400c142008c
130
+ - test/dummy/tmp/cache/assets/BAD/970/sprockets%2F9a5112306a4228313104b6e694330675
131
+ - test/dummy/tmp/cache/assets/E2C/A10/sprockets%2F9accda57c2c3dd81f1fadc6e19c55c90
132
+ - test/fixtures/posts.yml
133
+ - test/fixtures/categories.yml
134
+ - test/blogmodule_test.rb
135
+ - test/functional/categories_controller_test.rb
136
+ - test/functional/posts_controller_test.rb
137
+ homepage: http://tecnobest.heroku.com
138
+ licenses: []
139
+ post_install_message:
140
+ rdoc_options: []
141
+ require_paths:
142
+ - lib
143
+ required_ruby_version: !ruby/object:Gem::Requirement
144
+ none: false
145
+ requirements:
146
+ - - ! '>='
147
+ - !ruby/object:Gem::Version
148
+ version: '0'
149
+ required_rubygems_version: !ruby/object:Gem::Requirement
150
+ none: false
151
+ requirements:
152
+ - - ! '>='
153
+ - !ruby/object:Gem::Version
154
+ version: '0'
155
+ requirements: []
156
+ rubyforge_project:
157
+ rubygems_version: 1.8.11
158
+ signing_key:
159
+ specification_version: 3
160
+ summary: Summary of Blogmodule.
161
+ test_files:
162
+ - test/integration/navigation_test.rb
163
+ - test/test_helper.rb
164
+ - test/unit/helpers/categories_helper_test.rb
165
+ - test/unit/helpers/posts_helper_test.rb
166
+ - test/unit/category_test.rb
167
+ - test/unit/post_test.rb
168
+ - test/dummy/config.ru
169
+ - test/dummy/db/schema.rb
170
+ - test/dummy/db/development.sqlite3
171
+ - test/dummy/config/initializers/secret_token.rb
172
+ - test/dummy/config/initializers/mime_types.rb
173
+ - test/dummy/config/initializers/inflections.rb
174
+ - test/dummy/config/initializers/wrap_parameters.rb
175
+ - test/dummy/config/initializers/backtrace_silencers.rb
176
+ - test/dummy/config/initializers/session_store.rb
177
+ - test/dummy/config/environment.rb
178
+ - test/dummy/config/locales/en.yml
179
+ - test/dummy/config/routes.rb
180
+ - test/dummy/config/environments/test.rb
181
+ - test/dummy/config/environments/production.rb
182
+ - test/dummy/config/environments/development.rb
183
+ - test/dummy/config/boot.rb
184
+ - test/dummy/config/application.rb
185
+ - test/dummy/config/database.yml
186
+ - test/dummy/script/rails
187
+ - test/dummy/log/development.log
188
+ - test/dummy/app/views/layouts/application.html.erb
189
+ - test/dummy/app/helpers/application_helper.rb
190
+ - test/dummy/app/assets/javascripts/application.js
191
+ - test/dummy/app/assets/stylesheets/application.css
192
+ - test/dummy/app/controllers/application_controller.rb
193
+ - test/dummy/public/422.html
194
+ - test/dummy/public/500.html
195
+ - test/dummy/public/favicon.ico
196
+ - test/dummy/public/404.html
197
+ - test/dummy/Rakefile
198
+ - test/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384
199
+ - test/dummy/tmp/cache/assets/CD1/FE0/sprockets%2Fa933373e0504e8cd28ab26932e144bb1
200
+ - test/dummy/tmp/cache/assets/D54/ED0/sprockets%2F71c9fa01091d432b131da3bb73faf3d4
201
+ - test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705
202
+ - test/dummy/tmp/cache/assets/E3E/820/sprockets%2F5a1c7de58da1288fd9f29b75aeedf6ea
203
+ - test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af
204
+ - test/dummy/tmp/cache/assets/CD8/710/sprockets%2F4597cff24032334bc3e3542f0754bac8
205
+ - test/dummy/tmp/cache/assets/CD8/430/sprockets%2F2859ec948a5d3b35fed62400c142008c
206
+ - test/dummy/tmp/cache/assets/BAD/970/sprockets%2F9a5112306a4228313104b6e694330675
207
+ - test/dummy/tmp/cache/assets/E2C/A10/sprockets%2F9accda57c2c3dd81f1fadc6e19c55c90
208
+ - test/fixtures/posts.yml
209
+ - test/fixtures/categories.yml
210
+ - test/blogmodule_test.rb
211
+ - test/functional/categories_controller_test.rb
212
+ - test/functional/posts_controller_test.rb