comfy_blog 1.12.1 → 1.12.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b862ad156ddb05c62e864fb6adbb8d991d71c64b
4
- data.tar.gz: 227421e1fedf737a240a9504a676a1202bfe55a6
3
+ metadata.gz: 74cd97579b4570e8cac85c457007e8eb2db33031
4
+ data.tar.gz: f5bcdabd960071e1be2a3191ef51033b460483d7
5
5
  SHA512:
6
- metadata.gz: e8bf112ca2e72f2be2842a4cbd3de9431706c1664196431384f3980c44dd224b954e57e375bb17d38d128f58c14bcc39ded89a707b956ff0d6b555f89fd00b5c
7
- data.tar.gz: 8460c134957308def2287355661a6efcf9bdb6c96d5004c262cba0aa2702ecf23f52d17c8ad01f5f03ae59fb8ff11b01cf7a0efa0546d0603a30ba752465fe00
6
+ metadata.gz: 8b5db4dde5c35dc687d4e496ccf5febd576ffe14ea20aefd93ee51f0311f366db10b61c241e1deb858ac0cdabe23c0b66c79e0447dd941a4b2f600da10011a93
7
+ data.tar.gz: 5669fe544894ed906cad147e0ca8b3e031c01718691656d959cf453f6bdab91909e566df951e18f30e83e308b766f758962dd0a2867f8bc857c4e03268e8205c
@@ -1,11 +1,26 @@
1
1
  language: ruby
2
- rvm:
3
- - 1.9.3
4
- - 2.0.0
2
+ before_install:
3
+ - gem install bundler
5
4
  before_script:
6
- - 'rake db:migrate'
5
+ - rake db:migrate
7
6
  script:
8
7
  - rake test:all
8
+ rvm:
9
+ - 1.9.3
10
+ - 2.0.0
11
+ - 2.1.5
12
+ - 2.2.0
13
+ gemfile:
14
+ - test/gemfiles/Gemfile.rails.4.0
15
+ - test/gemfiles/Gemfile.rails.4.1
16
+ - test/gemfiles/Gemfile.rails.4.2
9
17
  branches:
10
18
  only:
11
- - master
19
+ - master
20
+ matrix:
21
+ fast_finish: true
22
+ include:
23
+ - rvm: 2.2.0
24
+ gemfile: test/gemfiles/Gemfile.rails.master
25
+ allow_failures:
26
+ - gemfile: test/gemfiles/Gemfile.rails.master
data/Gemfile CHANGED
@@ -2,7 +2,7 @@ source 'http://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- gem 'comfortable_mexican_sofa', :github => 'comfy/comfortable-mexican-sofa'
5
+ gem 'kaminari'
6
6
 
7
7
  group :development do
8
8
  gem 'awesome_print'
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
- # ComfyBlog
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)
1
+ # ComfyBlog
2
+ [![Gem Version](https://img.shields.io/gem/v/comfy_blog.svg?style=flat)](http://rubygems.org/gems/comfy_blog) [![Gem Downloads](https://img.shields.io/gem/dt/comfy_blog.svg?style=flat)](http://rubygems.org/gems/comfy_blog) [![Build Status](https://img.shields.io/travis/comfy/comfy-blog.svg?style=flat)](https://travis-ci.org/comfy/comfy-blog) [![Dependency Status](https://img.shields.io/gemnasium/comfy/comfy-blog.svg?style=flat)](https://gemnasium.com/comfy/comfy-blog) [![Code Climate](https://img.shields.io/codeclimate/github/comfy/comfy-blog.svg?style=flat)](https://codeclimate.com/github/comfy/comfy-blog) [![Coverage Status](https://img.shields.io/coveralls/comfy/comfy-blog.svg?style=flat)](https://coveralls.io/r/comfy/comfy-blog?branch=master)
3
3
 
4
4
  ComfyBlog is an simple blog management engine for [ComfortableMexicanSofa](https://github.com/comfy/comfortable-mexican-sofa)
5
5
 
@@ -17,11 +17,11 @@ gem 'comfy_blog', '~> 1.12.0'
17
17
  ```
18
18
 
19
19
  Then from the Rails project's root run:
20
-
20
+
21
21
  bundle install
22
22
  rails generate comfy:blog
23
23
  rake db:migrate
24
-
24
+
25
25
  Take a look inside your `config/routes.rb` file and you should see following lines there:
26
26
 
27
27
  ```ruby
@@ -1,16 +1,16 @@
1
1
  class Comfy::Admin::Blog::BlogsController < Comfy::Admin::Blog::BaseController
2
-
2
+
3
3
  before_action :build_blog, :only => [:new, :create]
4
4
  before_action :load_blog, :only => [:edit, :update, :destroy]
5
-
5
+
6
6
  def index
7
- @blogs = @site.blogs.page(params[:page])
7
+ @blogs = comfy_paginate(@site.blogs)
8
8
  end
9
-
9
+
10
10
  def new
11
11
  render
12
12
  end
13
-
13
+
14
14
  def edit
15
15
  render
16
16
  end
@@ -40,11 +40,11 @@ class Comfy::Admin::Blog::BlogsController < Comfy::Admin::Blog::BaseController
40
40
  end
41
41
 
42
42
  protected
43
-
43
+
44
44
  def build_blog
45
45
  @blog = @site.blogs.new(blog_params)
46
46
  end
47
-
47
+
48
48
  def blog_params
49
49
  params.fetch(:blog, {}).permit!
50
50
  end
@@ -1,13 +1,13 @@
1
1
  class Comfy::Admin::Blog::CommentsController < Comfy::Admin::Blog::BaseController
2
-
2
+
3
3
  before_action :load_blog
4
4
  before_action :load_comment, :only => [:destroy, :toggle_publish]
5
-
5
+
6
6
  def index
7
7
  @comments = if @post = @blog.posts.where(:id => params[:post_id]).first
8
- @post.comments.page(params[:page])
8
+ comfy_paginate(@post.comments)
9
9
  else
10
- @blog.comments.page(params[:page])
10
+ comfy_paginate(@blog.comments)
11
11
  end
12
12
  end
13
13
 
@@ -16,18 +16,18 @@ class Comfy::Admin::Blog::CommentsController < Comfy::Admin::Blog::BaseControlle
16
16
  flash[:success] = 'Comment deleted'
17
17
  redirect_to :action => :index
18
18
  end
19
-
19
+
20
20
  def toggle_publish
21
21
  @comment.update_attribute(:is_published, !@comment.is_published?)
22
22
  end
23
23
 
24
24
  protected
25
-
25
+
26
26
  def load_comment
27
27
  @comment = @blog.comments.find(params[:id])
28
28
  rescue ActiveRecord::RecordNotFound
29
29
  flash[:error] = 'Comment not found'
30
30
  redirect_to :action => :index
31
31
  end
32
-
32
+
33
33
  end
@@ -1,11 +1,11 @@
1
1
  class Comfy::Admin::Blog::PostsController < Comfy::Admin::Blog::BaseController
2
-
2
+
3
3
  before_action :load_blog
4
4
  before_action :build_post, :only => [:new, :create]
5
5
  before_action :load_post, :only => [:edit, :update, :destroy]
6
6
 
7
7
  def index
8
- @posts = @blog.posts.order(:published_at).page(params[:page])
8
+ @posts = comfy_paginate(@blog.posts.order(:published_at))
9
9
  end
10
10
 
11
11
  def new
@@ -56,7 +56,7 @@ protected
56
56
  @post = @blog.posts.new(post_params)
57
57
  @post.published_at ||= Time.zone.now
58
58
  end
59
-
59
+
60
60
  def post_params
61
61
  params.fetch(:post, {}).permit!
62
62
  end
@@ -1,9 +1,9 @@
1
1
  .page-header
2
2
  = link_to 'New Blog', new_comfy_admin_blog_path(@site), :class => 'btn btn-default pull-right'
3
3
  %h2 Blogs
4
-
5
- = paginate @blogs
6
-
4
+
5
+ = comfy_paginate @blogs
6
+
7
7
  %table.table.table-hover.table-bordered
8
8
  - @blogs.each do |blog|
9
9
  %tr
@@ -22,5 +22,5 @@
22
22
  .btn-group.btn-group-sm
23
23
  = link_to 'Edit', edit_comfy_admin_blog_path(@site, blog), :class => 'btn btn-default'
24
24
  = link_to 'Delete', comfy_admin_blog_path(@site, blog), :method => :delete, :data => {:confirm => 'Are you sure?'}, :class => 'btn btn-danger'
25
-
26
- = paginate @blogs
25
+
26
+ = comfy_paginate @blogs
@@ -1,7 +1,7 @@
1
1
  .page-header
2
2
  %h2 Blog Comments
3
-
4
- = paginate @comments
3
+
4
+ = comfy_paginate @comments
5
5
 
6
6
  %table.table.table-hover
7
7
  %tr
@@ -10,8 +10,8 @@
10
10
  %th Posted
11
11
  %th Status
12
12
  %th
13
-
13
+
14
14
  - @comments.each do |comment|
15
15
  = render :partial => 'comment', :object => comment
16
-
17
- = paginate @comments
16
+
17
+ = comfy_paginate @comments
@@ -1,9 +1,9 @@
1
1
  .page-header
2
2
  = link_to 'New Blog Post', new_comfy_admin_blog_post_path(@site, @blog), :class => 'btn btn-default pull-right'
3
3
  %h2 Blog Posts
4
-
5
- = paginate @posts
6
-
4
+
5
+ = comfy_paginate @posts
6
+
7
7
  %table.table.table-hover
8
8
  %tr
9
9
  %th.main Title
@@ -11,7 +11,7 @@
11
11
  %th Published
12
12
  %th Comments
13
13
  %th
14
-
14
+
15
15
  - @posts.each do |post|
16
16
  %tr
17
17
  %td.main
@@ -28,5 +28,5 @@
28
28
  .btn-group.btn-group-sm
29
29
  = link_to 'Edit', edit_comfy_admin_blog_post_path(@site, @blog, post), :class => 'btn btn-default'
30
30
  = link_to 'Delete', comfy_admin_blog_post_path(@site, @blog, post), :method => :delete, :data => {:confirm => 'Are you sure?'}, :class => 'btn btn-danger'
31
-
32
- = paginate @posts
31
+
32
+ = comfy_paginate @posts
@@ -1,7 +1,7 @@
1
1
  %h1 Blog Posts
2
2
 
3
3
  - @posts.each do |post|
4
-
4
+
5
5
  %h1= link_to post.title, comfy_blog_post_path(@cms_site.path, @blog.path, post.slug)
6
6
  .author
7
7
  = post.author
@@ -9,5 +9,5 @@
9
9
  = post.published_at.to_s(:db)
10
10
  .content
11
11
  = post.content.html_safe
12
-
13
- = paginate @posts
12
+
13
+ = comfy_paginate @posts
@@ -1,3 +1,3 @@
1
1
  module ComfyBlog
2
- VERSION = "1.12.1"
2
+ VERSION = "1.12.2"
3
3
  end
@@ -1,42 +1,42 @@
1
1
  require_relative '../../../../test_helper'
2
2
 
3
3
  class Comfy::Admin::Blog::BlogsControllerTest < ActionController::TestCase
4
-
4
+
5
5
  def setup
6
6
  @site = comfy_cms_sites(:default)
7
7
  @blog = comfy_blog_blogs(:default)
8
8
  end
9
-
9
+
10
10
  def test_get_index
11
11
  get :index, :site_id => @site
12
12
  assert_response :success
13
13
  assert assigns(:blogs)
14
14
  assert_template :index
15
15
  end
16
-
16
+
17
17
  def test_get_new
18
18
  get :new, :site_id => @site
19
19
  assert_response :success
20
20
  assert assigns(:blog)
21
21
  assert_template :new
22
- assert_select "form[action=/admin/sites/#{@site.id}/blogs]"
22
+ assert_select "form[action='/admin/sites/#{@site.id}/blogs']"
23
23
  end
24
-
24
+
25
25
  def test_get_edit
26
26
  get :edit, :site_id => @site, :id => @blog
27
27
  assert_response :success
28
28
  assert assigns(:blog)
29
29
  assert_template :edit
30
- assert_select "form[action=/admin/sites/#{@site.id}/blogs/#{@blog.id}]"
30
+ assert_select "form[action='/admin/sites/#{@site.id}/blogs/#{@blog.id}']"
31
31
  end
32
-
32
+
33
33
  def test_get_edit_failure
34
34
  get :edit, :site_id => @site, :id => 'invalid'
35
35
  assert_response :redirect
36
36
  assert_redirected_to :action => :index
37
37
  assert_equal 'Blog not found', flash[:error]
38
38
  end
39
-
39
+
40
40
  def test_creation
41
41
  assert_difference 'Comfy::Blog::Blog.count' do
42
42
  post :create, :site_id => @site, :blog => {
@@ -51,7 +51,7 @@ class Comfy::Admin::Blog::BlogsControllerTest < ActionController::TestCase
51
51
  assert_equal 'Blog created', flash[:success]
52
52
  end
53
53
  end
54
-
54
+
55
55
  def test_creation_failure
56
56
  assert_no_difference 'Comfy::Blog::Blog.count' do
57
57
  post :create, :site_id => @site, :blog => { }
@@ -60,7 +60,7 @@ class Comfy::Admin::Blog::BlogsControllerTest < ActionController::TestCase
60
60
  assert_equal 'Failed to create Blog', flash[:error]
61
61
  end
62
62
  end
63
-
63
+
64
64
  def test_update
65
65
  put :update, :site_id => @site, :id => @blog, blog: {
66
66
  :label => 'Updated'
@@ -71,7 +71,7 @@ class Comfy::Admin::Blog::BlogsControllerTest < ActionController::TestCase
71
71
  @blog.reload
72
72
  assert_equal 'Updated', @blog.label
73
73
  end
74
-
74
+
75
75
  def test_update_failure
76
76
  put :update, :site_id => @site, :id => @blog, :blog => {
77
77
  :label => ''
@@ -82,7 +82,7 @@ class Comfy::Admin::Blog::BlogsControllerTest < ActionController::TestCase
82
82
  @blog.reload
83
83
  refute_equal '', @blog.label
84
84
  end
85
-
85
+
86
86
  def test_destroy
87
87
  assert_difference 'Comfy::Blog::Blog.count', -1 do
88
88
  delete :destroy, :site_id => @site, :id => @blog
@@ -0,0 +1,10 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'rails', '~> 4.0.0'
4
+ gem 'comfortable_mexican_sofa', '~> 1.12.3'
5
+ gem 'kaminari', '>= 0.16.1'
6
+
7
+ group :test do
8
+ gem 'sqlite3'
9
+ gem 'coveralls', :require => false
10
+ end
@@ -0,0 +1,10 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'rails', '~> 4.1.0'
4
+ gem 'comfortable_mexican_sofa', '~> 1.12.3'
5
+ gem 'kaminari', '>= 0.16.1'
6
+
7
+ group :test do
8
+ gem 'sqlite3'
9
+ gem 'coveralls', :require => false
10
+ end
@@ -0,0 +1,10 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'rails', '~> 4.2.0'
4
+ gem 'comfortable_mexican_sofa', '~> 1.12.3'
5
+ gem 'kaminari', '>= 0.16.1'
6
+
7
+ group :test do
8
+ gem 'sqlite3'
9
+ gem 'coveralls', :require => false
10
+ end
@@ -0,0 +1,10 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'rails', :github => 'rails/rails'
4
+ gem 'comfortable_mexican_sofa', '~> 1.12.3'
5
+ gem 'kaminari', '>= 0.16.1'
6
+
7
+ group :test do
8
+ gem 'sqlite3'
9
+ gem 'coveralls', :require => false
10
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: comfy_blog
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.1
4
+ version: 1.12.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleg Khabarov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-26 00:00:00.000000000 Z
11
+ date: 2015-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: comfortable_mexican_sofa
@@ -97,6 +97,10 @@ files:
97
97
  - test/fixtures/comfy/blog/posts.yml
98
98
  - test/fixtures/comfy/cms/sites.yml
99
99
  - test/fixtures/generators/blog/routes.rb
100
+ - test/gemfiles/Gemfile.rails.4.0
101
+ - test/gemfiles/Gemfile.rails.4.1
102
+ - test/gemfiles/Gemfile.rails.4.2
103
+ - test/gemfiles/Gemfile.rails.master
100
104
  - test/generators/blog_generator_test.rb
101
105
  - test/lib/configuration_test.rb
102
106
  - test/models/blog_test.rb
@@ -123,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
127
  version: '0'
124
128
  requirements: []
125
129
  rubyforge_project:
126
- rubygems_version: 2.2.2
130
+ rubygems_version: 2.4.5
127
131
  signing_key:
128
132
  specification_version: 4
129
133
  summary: Simple Blog Engine for ComfortableMexicanSofa