comfy_blog 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. data/Gemfile +11 -0
  2. data/LICENSE +20 -0
  3. data/README.md +23 -0
  4. data/Rakefile +21 -0
  5. data/VERSION +1 -0
  6. data/app/assets/images/rails.png +0 -0
  7. data/app/assets/javascripts/application.js +8 -0
  8. data/app/assets/stylesheets/comfy_blog/admin.css +57 -0
  9. data/app/assets/stylesheets/comfy_blog/application.css +73 -0
  10. data/app/assets/stylesheets/comfy_blog/reset.css +1 -0
  11. data/app/controllers/application_controller.rb +5 -0
  12. data/app/controllers/blog/admin/base_controller.rb +3 -0
  13. data/app/controllers/blog/admin/comments_controller.rb +34 -0
  14. data/app/controllers/blog/admin/posts_controller.rb +57 -0
  15. data/app/controllers/blog/posts_controller.rb +33 -0
  16. data/app/helpers/blog/application_helper.rb +16 -0
  17. data/app/models/.gitkeep +0 -0
  18. data/app/models/blog/comment.rb +21 -0
  19. data/app/models/blog/post.rb +81 -0
  20. data/app/models/blog/tag.rb +25 -0
  21. data/app/models/blog/tagging.rb +22 -0
  22. data/app/views/blog/admin/_html_head.html.erb +1 -0
  23. data/app/views/blog/admin/_navigation.html.erb +1 -0
  24. data/app/views/blog/admin/comments/_comment.html.erb +22 -0
  25. data/app/views/blog/admin/comments/destroy.js.erb +3 -0
  26. data/app/views/blog/admin/comments/index.html.erb +10 -0
  27. data/app/views/blog/admin/comments/publish.js.erb +1 -0
  28. data/app/views/blog/admin/posts/_form.html.erb +24 -0
  29. data/app/views/blog/admin/posts/_post.html.erb +21 -0
  30. data/app/views/blog/admin/posts/edit.html.erb +5 -0
  31. data/app/views/blog/admin/posts/index.html.erb +9 -0
  32. data/app/views/blog/admin/posts/new.html.erb +5 -0
  33. data/app/views/blog/posts/_post.html.erb +18 -0
  34. data/app/views/blog/posts/index.html.erb +5 -0
  35. data/app/views/blog/posts/show.html.erb +1 -0
  36. data/app/views/layouts/application.html.erb +17 -0
  37. data/comfy_blog.gemspec +125 -0
  38. data/config.ru +4 -0
  39. data/config/application.rb +48 -0
  40. data/config/boot.rb +6 -0
  41. data/config/database.yml +25 -0
  42. data/config/environment.rb +5 -0
  43. data/config/environments/development.rb +33 -0
  44. data/config/environments/production.rb +51 -0
  45. data/config/environments/test.rb +42 -0
  46. data/config/initializers/comfy_blog.rb +18 -0
  47. data/config/initializers/secret_token.rb +3 -0
  48. data/config/initializers/wrap_parameters.rb +14 -0
  49. data/config/locales/en.yml +5 -0
  50. data/config/routes.rb +29 -0
  51. data/db/migrate/01_create_comfy_blog.rb +55 -0
  52. data/db/schema.rb +63 -0
  53. data/db/seeds.rb +7 -0
  54. data/lib/comfy_blog.rb +26 -0
  55. data/lib/comfy_blog/configuration.rb +33 -0
  56. data/lib/comfy_blog/core_ext/string.rb +8 -0
  57. data/lib/comfy_blog/engine.rb +20 -0
  58. data/lib/comfy_blog/form_builder.rb +50 -0
  59. data/lib/generators/README +10 -0
  60. data/lib/generators/blog_generator.rb +31 -0
  61. data/script/rails +6 -0
  62. data/test/fixtures/.gitkeep +0 -0
  63. data/test/fixtures/blog/comments.yml +6 -0
  64. data/test/fixtures/blog/posts.yml +8 -0
  65. data/test/fixtures/blog/taggings.yml +7 -0
  66. data/test/fixtures/blog/tags.yml +9 -0
  67. data/test/functional/.gitkeep +0 -0
  68. data/test/functional/blog/admin/comments_controller_test.rb +38 -0
  69. data/test/functional/blog/admin/posts_controller_test.rb +100 -0
  70. data/test/functional/blog/posts_controller_test.rb +93 -0
  71. data/test/test_helper.rb +40 -0
  72. data/test/unit/.gitkeep +0 -0
  73. data/test/unit/comment_test.rb +34 -0
  74. data/test/unit/configuration_test.rb +19 -0
  75. data/test/unit/post_test.rb +121 -0
  76. data/test/unit/tag_test.rb +44 -0
  77. data/test/unit/tagging_test.rb +30 -0
  78. metadata +172 -0
@@ -0,0 +1,44 @@
1
+ require File.expand_path('../test_helper', File.dirname(__FILE__))
2
+
3
+ class TagTest < ActiveSupport::TestCase
4
+
5
+ def test_fixtures_validity
6
+ Blog::Tag.all.each do |tag|
7
+ assert tag.valid?, tag.errors.to_s
8
+ end
9
+ end
10
+
11
+ def test_validation
12
+ old_tag = blog_tags(:tag)
13
+ tag = Blog::Tag.new(:name => old_tag.name)
14
+ assert tag.invalid?
15
+ assert_has_errors_on tag, [:name]
16
+ end
17
+
18
+ def test_strip_name
19
+ tag = Blog::Tag.new(:name => ' Test Tag ')
20
+ assert tag.valid?
21
+ assert_equal 'Test Tag', tag.name
22
+ end
23
+
24
+ def test_creation
25
+ assert_difference 'Blog::Tag.count' do
26
+ tag = Blog::Tag.create(:name => 'Test Tag')
27
+ end
28
+ end
29
+
30
+ def test_destroy
31
+ assert_difference ['Blog::Tag.count', 'Blog::Tagging.count'], -1 do
32
+ blog_tags(:tag).destroy
33
+ end
34
+ end
35
+
36
+ def test_scopes
37
+ assert_equal 1, Blog::Tag.tags.count
38
+ assert_equal blog_tags(:tag), Blog::Tag.tags.first
39
+
40
+ assert_equal 1, Blog::Tag.categories.count
41
+ assert_equal blog_tags(:category), Blog::Tag.categories.first
42
+ end
43
+
44
+ end
@@ -0,0 +1,30 @@
1
+ require File.expand_path('../test_helper', File.dirname(__FILE__))
2
+
3
+ class TaggingTest < ActiveSupport::TestCase
4
+
5
+ def test_fixtures_validity
6
+ Blog::Tagging.all.each do |tagging|
7
+ assert tagging.valid?, tagging.errors.to_s
8
+ end
9
+ end
10
+
11
+ def test_destroy_for_tag
12
+ assert_difference ['Blog::Tagging.count', 'Blog::Tag.count'], -1 do
13
+ blog_taggings(:tag).destroy
14
+ end
15
+ end
16
+
17
+ def test_destroy_for_category
18
+ assert_difference 'Blog::Tagging.count', -1 do
19
+ assert_no_difference 'Blog::Tag.count' do
20
+ blog_taggings(:category).destroy
21
+ end
22
+ end
23
+ end
24
+
25
+ def test_scopes
26
+ assert_equal 1, Blog::Tagging.for_tags.count
27
+ assert_equal 1, Blog::Tagging.for_categories.count
28
+ end
29
+
30
+ end
metadata ADDED
@@ -0,0 +1,172 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: comfy_blog
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Oleg Khabarov
9
+ - The Working Group Inc.
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+ date: 2012-01-18 00:00:00.000000000Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rails
17
+ requirement: &70265298083820 !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: 3.1.0
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: *70265298083820
26
+ - !ruby/object:Gem::Dependency
27
+ name: will_paginate
28
+ requirement: &70265298082160 !ruby/object:Gem::Requirement
29
+ none: false
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 3.0.2
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: *70265298082160
37
+ - !ruby/object:Gem::Dependency
38
+ name: rails_autolink
39
+ requirement: &70265298080580 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ~>
43
+ - !ruby/object:Gem::Version
44
+ version: 1.0.4
45
+ type: :runtime
46
+ prerelease: false
47
+ version_requirements: *70265298080580
48
+ - !ruby/object:Gem::Dependency
49
+ name: jquery-rails
50
+ requirement: &70265298079000 !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: 1.0.0
56
+ type: :runtime
57
+ prerelease: false
58
+ version_requirements: *70265298079000
59
+ description: ''
60
+ email: oleg@twg.ca
61
+ executables: []
62
+ extensions: []
63
+ extra_rdoc_files:
64
+ - LICENSE
65
+ - README.md
66
+ files:
67
+ - Gemfile
68
+ - LICENSE
69
+ - README.md
70
+ - Rakefile
71
+ - VERSION
72
+ - app/assets/images/rails.png
73
+ - app/assets/javascripts/application.js
74
+ - app/assets/stylesheets/comfy_blog/admin.css
75
+ - app/assets/stylesheets/comfy_blog/application.css
76
+ - app/assets/stylesheets/comfy_blog/reset.css
77
+ - app/controllers/application_controller.rb
78
+ - app/controllers/blog/admin/base_controller.rb
79
+ - app/controllers/blog/admin/comments_controller.rb
80
+ - app/controllers/blog/admin/posts_controller.rb
81
+ - app/controllers/blog/posts_controller.rb
82
+ - app/helpers/blog/application_helper.rb
83
+ - app/models/.gitkeep
84
+ - app/models/blog/comment.rb
85
+ - app/models/blog/post.rb
86
+ - app/models/blog/tag.rb
87
+ - app/models/blog/tagging.rb
88
+ - app/views/blog/admin/_html_head.html.erb
89
+ - app/views/blog/admin/_navigation.html.erb
90
+ - app/views/blog/admin/comments/_comment.html.erb
91
+ - app/views/blog/admin/comments/destroy.js.erb
92
+ - app/views/blog/admin/comments/index.html.erb
93
+ - app/views/blog/admin/comments/publish.js.erb
94
+ - app/views/blog/admin/posts/_form.html.erb
95
+ - app/views/blog/admin/posts/_post.html.erb
96
+ - app/views/blog/admin/posts/edit.html.erb
97
+ - app/views/blog/admin/posts/index.html.erb
98
+ - app/views/blog/admin/posts/new.html.erb
99
+ - app/views/blog/posts/_post.html.erb
100
+ - app/views/blog/posts/index.html.erb
101
+ - app/views/blog/posts/show.html.erb
102
+ - app/views/layouts/application.html.erb
103
+ - comfy_blog.gemspec
104
+ - config.ru
105
+ - config/application.rb
106
+ - config/boot.rb
107
+ - config/database.yml
108
+ - config/environment.rb
109
+ - config/environments/development.rb
110
+ - config/environments/production.rb
111
+ - config/environments/test.rb
112
+ - config/initializers/comfy_blog.rb
113
+ - config/initializers/secret_token.rb
114
+ - config/initializers/wrap_parameters.rb
115
+ - config/locales/en.yml
116
+ - config/routes.rb
117
+ - db/migrate/01_create_comfy_blog.rb
118
+ - db/schema.rb
119
+ - db/seeds.rb
120
+ - lib/comfy_blog.rb
121
+ - lib/comfy_blog/configuration.rb
122
+ - lib/comfy_blog/core_ext/string.rb
123
+ - lib/comfy_blog/engine.rb
124
+ - lib/comfy_blog/form_builder.rb
125
+ - lib/generators/README
126
+ - lib/generators/blog_generator.rb
127
+ - script/rails
128
+ - test/fixtures/.gitkeep
129
+ - test/fixtures/blog/comments.yml
130
+ - test/fixtures/blog/posts.yml
131
+ - test/fixtures/blog/taggings.yml
132
+ - test/fixtures/blog/tags.yml
133
+ - test/functional/.gitkeep
134
+ - test/functional/blog/admin/comments_controller_test.rb
135
+ - test/functional/blog/admin/posts_controller_test.rb
136
+ - test/functional/blog/posts_controller_test.rb
137
+ - test/test_helper.rb
138
+ - test/unit/.gitkeep
139
+ - test/unit/comment_test.rb
140
+ - test/unit/configuration_test.rb
141
+ - test/unit/post_test.rb
142
+ - test/unit/tag_test.rb
143
+ - test/unit/tagging_test.rb
144
+ homepage: http://github.com/comfy/comfy-blog
145
+ licenses:
146
+ - MIT
147
+ post_install_message:
148
+ rdoc_options: []
149
+ require_paths:
150
+ - lib
151
+ required_ruby_version: !ruby/object:Gem::Requirement
152
+ none: false
153
+ requirements:
154
+ - - ! '>='
155
+ - !ruby/object:Gem::Version
156
+ version: '0'
157
+ segments:
158
+ - 0
159
+ hash: 2905087274038457743
160
+ required_rubygems_version: !ruby/object:Gem::Requirement
161
+ none: false
162
+ requirements:
163
+ - - ! '>='
164
+ - !ruby/object:Gem::Version
165
+ version: '0'
166
+ requirements: []
167
+ rubyforge_project:
168
+ rubygems_version: 1.8.10
169
+ signing_key:
170
+ specification_version: 3
171
+ summary: ComfyBlog is a blog engine for Rails 3.1 apps (and ComfortableMexicanSofa)
172
+ test_files: []