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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: 1aeff81384f3fb903b4190874469788c842ec0c5
4
- data.tar.gz: 9e7902e544405cc03be7201f28eee0df4958b2fe
5
- !binary "U0hBNTEy":
6
- metadata.gz: c02614684124b20d5b3015b4014e985269878e9c7fb0b5a85000565fe1d826694d02cd9a9b39ef3b04509e9e10901964bd191414d5c5f256bea09663a0abff0d
7
- data.tar.gz: f8666a836b87ee8a5cc3a54a798d63a57060ac6536e7815b7c24305e23baa0402f5234377b1c9e33595cfa75c91ed79c99669231f3a693a130c560000d271371
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
  [![Gem Version](https://badge.fury.io/rb/comfy_blog.png)](http://rubygems.org/gems/comfy_blog) [![Build Status](https://secure.travis-ci.org/comfy/comfy-blog.png)](http://travis-ci.org/comfy/comfy-blog) [![Dependency Status](https://gemnasium.com/comfy/comfy-blog.png)](https://gemnasium.com/comfy/comfy-blog) [![Code Climate](https://codeclimate.com/github/comfy/comfy-blog.png)](https://codeclimate.com/github/comfy/comfy-blog) [![Coverage Status](https://coveralls.io/repos/comfy/comfy-blog/badge.png?branch=master)](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.10).
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.0.0'
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
- ComfyBlog::Routing.admin :path => 'admin'
29
- ComfyBlog::Routing.content :path => 'blog'
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
@@ -17,5 +17,5 @@ Gem::Specification.new do |s|
17
17
  s.platform = Gem::Platform::RUBY
18
18
  s.require_paths = ['lib']
19
19
 
20
- s.add_dependency 'comfortable_mexican_sofa', '>= 1.10.0'
20
+ s.add_dependency 'comfortable_mexican_sofa', '>= 1.11.0'
21
21
  end
@@ -1,6 +1,6 @@
1
1
  ComfyBlog::Application.routes.draw do
2
- ComfortableMexicanSofa::Routing.admin
3
- ComfyBlog::Routing.admin
4
- ComfyBlog::Routing.content
5
- ComfortableMexicanSofa::Routing.content :sitemap => true
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
@@ -1,38 +1,2 @@
1
- module ComfyBlog::Routing
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'
@@ -1,3 +1,3 @@
1
1
  module ComfyBlog
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -31,8 +31,8 @@ module Comfy
31
31
  end
32
32
 
33
33
  def generate_routing
34
- route_string = " ComfyBlog::Routing.admin :path => '/admin'\n"
35
- route_string << " ComfyBlog::Routing.content :path => '/blog'\n"
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
 
@@ -1,6 +1,6 @@
1
1
  Test::Application.routes.draw do
2
2
 
3
- ComfyBlog::Routing.admin :path => '/admin'
4
- ComfyBlog::Routing.content :path => '/blog'
3
+ comfy_route :blog_admin, :path => '/admin'
4
+ comfy_route :blog, :path => '/blog'
5
5
 
6
6
  end
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.0.0
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-10-22 00:00:00.000000000 Z
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.10.0
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.10.0
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.0.3
127
+ rubygems_version: 2.1.10
126
128
  signing_key:
127
129
  specification_version: 4
128
130
  summary: Simple Blog Engine for ComfortableMexicanSofa