beef-articles 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +5 -0
- data/LICENSE +20 -0
- data/README.rdoc +7 -0
- data/Rakefile +58 -0
- data/VERSION +1 -0
- data/app/controllers/admin/articles_controller.rb +89 -0
- data/app/controllers/admin/categories_controller.rb +83 -0
- data/app/controllers/admin/comments_controller.rb +30 -0
- data/app/controllers/articles_controller.rb +55 -0
- data/app/controllers/comments_controller.rb +50 -0
- data/app/helpers/articles_helper.rb +92 -0
- data/app/helpers/comments_helper.rb +7 -0
- data/app/models/article.rb +37 -0
- data/app/models/category.rb +17 -0
- data/app/models/comment.rb +16 -0
- data/app/views/admin/articles/index.html.erb +45 -0
- data/app/views/admin/articles/preview.js.rjs +1 -0
- data/app/views/admin/articles/show.html.erb +58 -0
- data/app/views/admin/categories/index.html.erb +31 -0
- data/app/views/admin/categories/show.html.erb +18 -0
- data/app/views/admin/comments/index.html.erb +33 -0
- data/app/views/articles/_article.html.erb +12 -0
- data/app/views/articles/index.html.erb +40 -0
- data/app/views/articles/index.rss.builder +18 -0
- data/app/views/articles/show.html.erb +55 -0
- data/app/views/comments/_comment.html.erb +4 -0
- data/app/views/comments/_form.html.erb +25 -0
- data/app/views/comments/new.html.erb +4 -0
- data/articles.gemspec +79 -0
- data/config/routes.rb +32 -0
- data/generators/articles_migration/articles_migration_generator.rb +11 -0
- data/generators/articles_migration/templates/migration.rb +45 -0
- data/lib/articles.rb +7 -0
- data/rails/init.rb +9 -0
- data/test/articles_test.rb +7 -0
- data/test/test_helper.rb +10 -0
- metadata +110 -0
data/articles.gemspec
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{articles}
|
5
|
+
s.version = "0.1.0"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Steve England"]
|
9
|
+
s.date = %q{2009-06-24}
|
10
|
+
s.email = %q{steve@wearebeef.co.uk}
|
11
|
+
s.extra_rdoc_files = [
|
12
|
+
"LICENSE",
|
13
|
+
"README.rdoc"
|
14
|
+
]
|
15
|
+
s.files = [
|
16
|
+
".document",
|
17
|
+
".gitignore",
|
18
|
+
"LICENSE",
|
19
|
+
"README.rdoc",
|
20
|
+
"Rakefile",
|
21
|
+
"VERSION",
|
22
|
+
"app/controllers/admin/articles_controller.rb",
|
23
|
+
"app/controllers/admin/categories_controller.rb",
|
24
|
+
"app/controllers/admin/comments_controller.rb",
|
25
|
+
"app/controllers/articles_controller.rb",
|
26
|
+
"app/controllers/comments_controller.rb",
|
27
|
+
"app/helpers/articles_helper.rb",
|
28
|
+
"app/helpers/comments_helper.rb",
|
29
|
+
"app/models/article.rb",
|
30
|
+
"app/models/category.rb",
|
31
|
+
"app/models/comment.rb",
|
32
|
+
"app/views/admin/articles/index.html.erb",
|
33
|
+
"app/views/admin/articles/preview.js.rjs",
|
34
|
+
"app/views/admin/articles/show.html.erb",
|
35
|
+
"app/views/admin/categories/index.html.erb",
|
36
|
+
"app/views/admin/categories/show.html.erb",
|
37
|
+
"app/views/admin/comments/index.html.erb",
|
38
|
+
"app/views/articles/_article.html.erb",
|
39
|
+
"app/views/articles/index.html.erb",
|
40
|
+
"app/views/articles/index.rss.builder",
|
41
|
+
"app/views/articles/show.html.erb",
|
42
|
+
"app/views/comments/_comment.html.erb",
|
43
|
+
"app/views/comments/_form.html.erb",
|
44
|
+
"app/views/comments/new.html.erb",
|
45
|
+
"articles.gemspec",
|
46
|
+
"config/routes.rb",
|
47
|
+
"generators/articles_migration/articles_migration_generator.rb",
|
48
|
+
"generators/articles_migration/templates/migration.rb",
|
49
|
+
"lib/articles.rb",
|
50
|
+
"rails/init.rb",
|
51
|
+
"test/articles_test.rb",
|
52
|
+
"test/test_helper.rb"
|
53
|
+
]
|
54
|
+
s.homepage = %q{http://github.com/beef/articles}
|
55
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
56
|
+
s.require_paths = ["lib"]
|
57
|
+
s.rubygems_version = %q{1.3.3}
|
58
|
+
s.summary = %q{Article/Blogging engine}
|
59
|
+
s.test_files = [
|
60
|
+
"test/articles_test.rb",
|
61
|
+
"test/test_helper.rb"
|
62
|
+
]
|
63
|
+
|
64
|
+
if s.respond_to? :specification_version then
|
65
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
66
|
+
s.specification_version = 3
|
67
|
+
|
68
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
69
|
+
s.add_runtime_dependency(%q<mbleigh-acts-as-taggable-on>, [">= 0"])
|
70
|
+
s.add_runtime_dependency(%q<jackdempsey-acts_as_commentable>, [">= 0"])
|
71
|
+
else
|
72
|
+
s.add_dependency(%q<mbleigh-acts-as-taggable-on>, [">= 0"])
|
73
|
+
s.add_dependency(%q<jackdempsey-acts_as_commentable>, [">= 0"])
|
74
|
+
end
|
75
|
+
else
|
76
|
+
s.add_dependency(%q<mbleigh-acts-as-taggable-on>, [">= 0"])
|
77
|
+
s.add_dependency(%q<jackdempsey-acts_as_commentable>, [">= 0"])
|
78
|
+
end
|
79
|
+
end
|
data/config/routes.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
ActionController::Routing::Routes.draw do |map|
|
2
|
+
map.resources :comments
|
3
|
+
|
4
|
+
map.resources :categories, :has_many => :articles
|
5
|
+
|
6
|
+
map.with_options :controller => 'articles', :action => 'index' do |articles|
|
7
|
+
articles.articles_tagged 'articles/tagged/:tag'
|
8
|
+
articles.articles_tagged_format 'articles/tagged/:tag.:format'
|
9
|
+
articles.articles_authored 'articles/author/:user_id'
|
10
|
+
articles.articles_authored_format 'articles/author/:user_id.:format'
|
11
|
+
articles.articles_day 'articles/:year/:month/:day',
|
12
|
+
:year => /\d{4}/, :month => /\d{1,2}/, :day => /\d{1,2}/
|
13
|
+
articles.articles_month 'articles/:year/:month',
|
14
|
+
:year => /\d{4}/, :month => /\d{1,2}/
|
15
|
+
articles.articles_day 'articles/:year',
|
16
|
+
:year => /\d{4}/
|
17
|
+
end
|
18
|
+
map.article_permalink 'articles/:year/:month/:day/:permalink',
|
19
|
+
:controller => 'articles', :action => 'show',
|
20
|
+
:year => /\d{4}/, :day => /\d{1,2}/, :month => /\d{1,2}/,
|
21
|
+
:path_prefix => nil
|
22
|
+
map.resources :articles, :only => [:index], :collection => { :preview => :get }, :has_many => [:comments, { :only => :create } ]
|
23
|
+
|
24
|
+
map.resources :tweets
|
25
|
+
map.namespace(:admin) do |admin|
|
26
|
+
admin.resources :categories
|
27
|
+
admin.resources :articles, :member => { :preview => :put }, :collection => { :preview => :post }
|
28
|
+
admin.resources :comments, :only => [:index, :destroy]
|
29
|
+
admin.resources :things
|
30
|
+
admin.resources :blokes
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
class CreateArticlesCategoriesAndComments < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :articles do |t|
|
4
|
+
t.string :title
|
5
|
+
t.string :permalink
|
6
|
+
t.datetime :published_at
|
7
|
+
t.datetime :published_to
|
8
|
+
t.text :body
|
9
|
+
t.string :description
|
10
|
+
t.boolean :allow_comments, :default => false
|
11
|
+
t.string :cached_tag_list
|
12
|
+
t.references :created_by, :updated_by, :category
|
13
|
+
|
14
|
+
t.timestamps
|
15
|
+
end
|
16
|
+
|
17
|
+
create_table :categories do |t|
|
18
|
+
t.string :title
|
19
|
+
t.string :description, :permalink
|
20
|
+
|
21
|
+
t.timestamps
|
22
|
+
end
|
23
|
+
|
24
|
+
add_index :categories, :permalink
|
25
|
+
|
26
|
+
create_table :comments do |t|
|
27
|
+
t.text :comment, :default => ""
|
28
|
+
t.references :commentable, :polymorphic => true
|
29
|
+
|
30
|
+
t.string :website, :default => ""
|
31
|
+
t.string :name, :default => ""
|
32
|
+
t.string :email, :default => ""
|
33
|
+
t.timestamps
|
34
|
+
end
|
35
|
+
|
36
|
+
add_index :comments, :commentable_type
|
37
|
+
add_index :comments, :commentable_id
|
38
|
+
end
|
39
|
+
|
40
|
+
def self.down
|
41
|
+
drop_table :categories
|
42
|
+
drop_table :comments
|
43
|
+
drop_table :articles
|
44
|
+
end
|
45
|
+
end
|
data/lib/articles.rb
ADDED
data/rails/init.rb
ADDED
data/test/test_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,110 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: beef-articles
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Steve England
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-06-24 00:00:00 -07:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: mbleigh-acts-as-taggable-on
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0"
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: jackdempsey-acts_as_commentable
|
27
|
+
type: :runtime
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: "0"
|
34
|
+
version:
|
35
|
+
description:
|
36
|
+
email: steve@wearebeef.co.uk
|
37
|
+
executables: []
|
38
|
+
|
39
|
+
extensions: []
|
40
|
+
|
41
|
+
extra_rdoc_files:
|
42
|
+
- LICENSE
|
43
|
+
- README.rdoc
|
44
|
+
files:
|
45
|
+
- .document
|
46
|
+
- .gitignore
|
47
|
+
- LICENSE
|
48
|
+
- README.rdoc
|
49
|
+
- Rakefile
|
50
|
+
- VERSION
|
51
|
+
- app/controllers/admin/articles_controller.rb
|
52
|
+
- app/controllers/admin/categories_controller.rb
|
53
|
+
- app/controllers/admin/comments_controller.rb
|
54
|
+
- app/controllers/articles_controller.rb
|
55
|
+
- app/controllers/comments_controller.rb
|
56
|
+
- app/helpers/articles_helper.rb
|
57
|
+
- app/helpers/comments_helper.rb
|
58
|
+
- app/models/article.rb
|
59
|
+
- app/models/category.rb
|
60
|
+
- app/models/comment.rb
|
61
|
+
- app/views/admin/articles/index.html.erb
|
62
|
+
- app/views/admin/articles/preview.js.rjs
|
63
|
+
- app/views/admin/articles/show.html.erb
|
64
|
+
- app/views/admin/categories/index.html.erb
|
65
|
+
- app/views/admin/categories/show.html.erb
|
66
|
+
- app/views/admin/comments/index.html.erb
|
67
|
+
- app/views/articles/_article.html.erb
|
68
|
+
- app/views/articles/index.html.erb
|
69
|
+
- app/views/articles/index.rss.builder
|
70
|
+
- app/views/articles/show.html.erb
|
71
|
+
- app/views/comments/_comment.html.erb
|
72
|
+
- app/views/comments/_form.html.erb
|
73
|
+
- app/views/comments/new.html.erb
|
74
|
+
- articles.gemspec
|
75
|
+
- config/routes.rb
|
76
|
+
- generators/articles_migration/articles_migration_generator.rb
|
77
|
+
- generators/articles_migration/templates/migration.rb
|
78
|
+
- lib/articles.rb
|
79
|
+
- rails/init.rb
|
80
|
+
- test/articles_test.rb
|
81
|
+
- test/test_helper.rb
|
82
|
+
has_rdoc: false
|
83
|
+
homepage: http://github.com/beef/articles
|
84
|
+
post_install_message:
|
85
|
+
rdoc_options:
|
86
|
+
- --charset=UTF-8
|
87
|
+
require_paths:
|
88
|
+
- lib
|
89
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
90
|
+
requirements:
|
91
|
+
- - ">="
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: "0"
|
94
|
+
version:
|
95
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: "0"
|
100
|
+
version:
|
101
|
+
requirements: []
|
102
|
+
|
103
|
+
rubyforge_project:
|
104
|
+
rubygems_version: 1.2.0
|
105
|
+
signing_key:
|
106
|
+
specification_version: 3
|
107
|
+
summary: Article/Blogging engine
|
108
|
+
test_files:
|
109
|
+
- test/articles_test.rb
|
110
|
+
- test/test_helper.rb
|