comfy_blog 1.0.0 → 1.1.0
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.
- checksums.yaml +6 -6
- data/README.md +4 -4
- data/app/views/blog/comments/_form.html.haml +1 -1
- data/comfy_blog.gemspec +1 -1
- data/config/blog_routes.rb +4 -4
- data/lib/comfy_blog/routes/blog.rb +18 -0
- data/lib/comfy_blog/routes/blog_admin.rb +18 -0
- data/lib/comfy_blog/routing.rb +2 -38
- data/lib/comfy_blog/version.rb +1 -1
- data/lib/generators/comfy/blog/blog_generator.rb +2 -2
- data/test/fixtures/generators/blog/routes.rb +2 -2
- metadata +11 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
5
|
-
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: d83861dbf43fca5bfd0f5a843f06bc1341102381
|
|
4
|
+
data.tar.gz: 3efd7979fa175b4688ccb5ab04cff7c0fffc683c
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 31ada679c62fb0128dfa8e6b00352d3abdab8bea271cfb4f94d128355d4d6bf6ea124dde9b898e283b6c05786dda30083f2d365b69a0f3be5a8fade395d89c18
|
|
7
|
+
data.tar.gz: c3aac83f2eb28a33fb2d24fabdfa89358cfc617d0baeb12c6f122839adcb32a899fdee5c13865e5c75669dda49bf0b8428baf83f8bea22966c4be935378b4870
|
data/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# ComfyBlog
|
|
2
2
|
[](http://rubygems.org/gems/comfy_blog) [](http://travis-ci.org/comfy/comfy-blog) [](https://gemnasium.com/comfy/comfy-blog) [](https://codeclimate.com/github/comfy/comfy-blog) [](https://coveralls.io/r/comfy/comfy-blog)
|
|
3
3
|
|
|
4
|
-
ComfyBlog is an simple blog management engine for [ComfortableMexicanSofa](https://github.com/comfy/comfortable-mexican-sofa) (for version >= 1.
|
|
4
|
+
ComfyBlog is an simple blog management engine for [ComfortableMexicanSofa](https://github.com/comfy/comfortable-mexican-sofa) (for version >= 1.11).
|
|
5
5
|
|
|
6
6
|
## Features
|
|
7
7
|
|
|
@@ -13,7 +13,7 @@ ComfyBlog is an simple blog management engine for [ComfortableMexicanSofa](https
|
|
|
13
13
|
Add gem definition to your Gemfile:
|
|
14
14
|
|
|
15
15
|
```ruby
|
|
16
|
-
gem 'comfy_blog', '~> 1.
|
|
16
|
+
gem 'comfy_blog', '~> 1.1.0'
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
Then from the Rails project's root run:
|
|
@@ -25,8 +25,8 @@ Then from the Rails project's root run:
|
|
|
25
25
|
Take a look inside your `config/routes.rb` file and you should see following lines there:
|
|
26
26
|
|
|
27
27
|
```ruby
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
comfy_route :blog_admin, :path => 'admin'
|
|
29
|
+
comfy_route :blog, :path => 'blog'
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
You should also find view templates in `/app/views/blog` folder. Feel free to adjust them as you see fit.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
= formatted_form_for @comment, :url => blog_comments_path(@cms_site.path, @blog.path, @post.slug) do |form|
|
|
1
|
+
= formatted_form_for @comment, :as => :comment, :url => blog_comments_path(@cms_site.path, @blog.path, @post.slug) do |form|
|
|
2
2
|
|
|
3
3
|
-# don't need this when installed into your app
|
|
4
4
|
= form.hidden_field :authenticity_token, :value => form_authenticity_token
|
data/comfy_blog.gemspec
CHANGED
data/config/blog_routes.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
ComfyBlog::Application.routes.draw do
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
comfy_route :cms_admin
|
|
3
|
+
comfy_route :blog_admin
|
|
4
|
+
comfy_route :blog
|
|
5
|
+
comfy_route :cms, :sitemap => true
|
|
6
6
|
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
class ActionDispatch::Routing::Mapper
|
|
2
|
+
|
|
3
|
+
def comfy_route_blog(options = {})
|
|
4
|
+
options[:path] ||= 'blog'
|
|
5
|
+
path = ['(:cms_path)', options[:path], '(:blog_path)'].join('/')
|
|
6
|
+
|
|
7
|
+
namespace :blog, :path => path, :constraints => {:blog_path => /\w[a-z0-9_-]*/} do
|
|
8
|
+
with_options :constraints => {:year => /\d{4}/, :month => /\d{1,2}/} do |o|
|
|
9
|
+
o.get ':year' => 'posts#index', :as => :posts_of_year
|
|
10
|
+
o.get ':year/:month' => 'posts#index', :as => :posts_of_month
|
|
11
|
+
o.get ':year/:month/:slug' => 'posts#show', :as => :posts_dated
|
|
12
|
+
end
|
|
13
|
+
post ':slug/comments' => 'comments#create', :as => :comments
|
|
14
|
+
get ':slug' => 'posts#serve', :as => :post
|
|
15
|
+
get '/' => 'posts#serve', :as => :posts
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
class ActionDispatch::Routing::Mapper
|
|
2
|
+
|
|
3
|
+
def comfy_route_blog_admin(options = {})
|
|
4
|
+
options[:path] ||= 'admin'
|
|
5
|
+
path = [options[:path], 'sites', ':site_id'].join('/')
|
|
6
|
+
|
|
7
|
+
scope :module => :admin do
|
|
8
|
+
namespace :blog, :as => :admin, :path => path, :except => [:show] do
|
|
9
|
+
resources :blogs do
|
|
10
|
+
resources :posts
|
|
11
|
+
resources :comments, :only => [:index, :destroy] do
|
|
12
|
+
patch :toggle_publish, :on => :member
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
data/lib/comfy_blog/routing.rb
CHANGED
|
@@ -1,38 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
def self.admin(options = {})
|
|
4
|
-
options[:path] ||= 'admin'
|
|
5
|
-
path = [options[:path], 'sites', ':site_id'].join('/')
|
|
6
|
-
|
|
7
|
-
Rails.application.routes.draw do
|
|
8
|
-
scope :module => :admin do
|
|
9
|
-
namespace :blog, :as => :admin, :path => path, :except => [:show] do
|
|
10
|
-
resources :blogs do
|
|
11
|
-
resources :posts
|
|
12
|
-
resources :comments, :only => [:index, :destroy] do
|
|
13
|
-
patch :toggle_publish, :on => :member
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def self.content(options = {})
|
|
22
|
-
options[:path] ||= 'blog'
|
|
23
|
-
path = ['(:cms_path)', options[:path], '(:blog_path)'].join('/')
|
|
24
|
-
|
|
25
|
-
Rails.application.routes.draw do
|
|
26
|
-
namespace :blog, :path => path, :constraints => {:blog_path => /\w[a-z0-9_-]*/} do
|
|
27
|
-
with_options :constraints => {:year => /\d{4}/, :month => /\d{1,2}/} do |o|
|
|
28
|
-
o.get ':year' => 'posts#index', :as => :posts_of_year
|
|
29
|
-
o.get ':year/:month' => 'posts#index', :as => :posts_of_month
|
|
30
|
-
o.get ':year/:month/:slug' => 'posts#show', :as => :posts_dated
|
|
31
|
-
end
|
|
32
|
-
post ':slug/comments' => 'comments#create', :as => :comments
|
|
33
|
-
get ':slug' => 'posts#serve', :as => :post
|
|
34
|
-
get '/' => 'posts#serve', :as => :posts
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
end
|
|
1
|
+
require_relative 'routes/blog_admin'
|
|
2
|
+
require_relative 'routes/blog'
|
data/lib/comfy_blog/version.rb
CHANGED
|
@@ -31,8 +31,8 @@ module Comfy
|
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
def generate_routing
|
|
34
|
-
route_string = "
|
|
35
|
-
route_string << "
|
|
34
|
+
route_string = " comfy_route :blog_admin, :path => '/admin'\n"
|
|
35
|
+
route_string << " comfy_route :blog, :path => '/blog'\n"
|
|
36
36
|
route route_string[2..-1]
|
|
37
37
|
end
|
|
38
38
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: comfy_blog
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Oleg Khabarov
|
|
@@ -9,22 +9,22 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2013-
|
|
12
|
+
date: 2013-11-05 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: comfortable_mexican_sofa
|
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
|
17
17
|
requirements:
|
|
18
|
-
- -
|
|
18
|
+
- - '>='
|
|
19
19
|
- !ruby/object:Gem::Version
|
|
20
|
-
version: 1.
|
|
20
|
+
version: 1.11.0
|
|
21
21
|
type: :runtime
|
|
22
22
|
prerelease: false
|
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
|
24
24
|
requirements:
|
|
25
|
-
- -
|
|
25
|
+
- - '>='
|
|
26
26
|
- !ruby/object:Gem::Version
|
|
27
|
-
version: 1.
|
|
27
|
+
version: 1.11.0
|
|
28
28
|
description: Simple Blog Engine for ComfortableMexicanSofa
|
|
29
29
|
email:
|
|
30
30
|
- oleg@khabarov.ca
|
|
@@ -81,6 +81,8 @@ files:
|
|
|
81
81
|
- lib/comfy_blog.rb
|
|
82
82
|
- lib/comfy_blog/configuration.rb
|
|
83
83
|
- lib/comfy_blog/engine.rb
|
|
84
|
+
- lib/comfy_blog/routes/blog.rb
|
|
85
|
+
- lib/comfy_blog/routes/blog_admin.rb
|
|
84
86
|
- lib/comfy_blog/routing.rb
|
|
85
87
|
- lib/comfy_blog/version.rb
|
|
86
88
|
- lib/generators/comfy/blog/README
|
|
@@ -112,17 +114,17 @@ require_paths:
|
|
|
112
114
|
- lib
|
|
113
115
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
114
116
|
requirements:
|
|
115
|
-
- -
|
|
117
|
+
- - '>='
|
|
116
118
|
- !ruby/object:Gem::Version
|
|
117
119
|
version: '0'
|
|
118
120
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
121
|
requirements:
|
|
120
|
-
- -
|
|
122
|
+
- - '>='
|
|
121
123
|
- !ruby/object:Gem::Version
|
|
122
124
|
version: '0'
|
|
123
125
|
requirements: []
|
|
124
126
|
rubyforge_project:
|
|
125
|
-
rubygems_version: 2.
|
|
127
|
+
rubygems_version: 2.1.10
|
|
126
128
|
signing_key:
|
|
127
129
|
specification_version: 4
|
|
128
130
|
summary: Simple Blog Engine for ComfortableMexicanSofa
|