ecm_blog 0.2.0 → 1.0.0

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: 1ad16cae6059ef857fe5d7f8fb010b66cde8d474
4
- data.tar.gz: 2f73acae55a824b3d77f14639e20d697a78caa76
3
+ metadata.gz: a83b2849b7fee1e82e79056744eecbb21cc3c047
4
+ data.tar.gz: e8ed2920068f5e47fb3d9d0c1c473987defebd9d
5
5
  SHA512:
6
- metadata.gz: 59e56e7a0ea13f5c1806fb4708672d4becdbf6d7d502e94d738adff171642e65fc28f0261267880390d4ee4846daf134ef7f9d9b264bd64b495b0ab247857f73
7
- data.tar.gz: 34004e582864cbf1b838e2ebbc4c2d79678c806d166051c5cf1d89c7cce7c0535f6eb7b5f3053f66689494e1508ad2d0a8741419c8b48f8289ee1b91f689ab36
6
+ metadata.gz: 0ac4bf41724ee62f6a7f6a01c3e26519cedc87753baf02a907eaa65d8053e3633db4d310b9c61c745f08e39ab70ecbac75b3bf79dfd4798d859ee49d0b78dc81
7
+ data.tar.gz: 71b1200de61c315dd7afc34f88553429445aab8ed04f18965aecc7ddf3f694b2acdf13e79896cba74cf35ba56837fb190c139590f574a886d770c42b4c8cb5a0
@@ -1,10 +1,11 @@
1
1
  module Ecm
2
2
  module Blog
3
3
  class PostsController < Ecm::Blog::Configuration.base_controller.constantize
4
- include Controller::ResourceConcern
5
- include Controller::ResourceUrlsConcern
6
- include Controller::ResourceInflectionsConcern
7
- include Controller::RestActionsConcern
4
+ include ResourcesController::Resources
5
+ include ResourcesController::ResourceInflections
6
+ include ResourcesController::RestResourceUrls
7
+ include ResourcesController::RestActions
8
+ include ResourcesController::Kaminari
8
9
 
9
10
  helper Ecm::Comments::ApplicationHelper
10
11
 
@@ -14,14 +15,10 @@ module Ecm
14
15
 
15
16
  private
16
17
 
17
- def collection_scope
18
+ def load_collection_scope
18
19
  super.published.friendly.order(updated_at: :desc)
19
20
  end
20
21
 
21
- def load_collection
22
- collection_scope.page(params[:page])
23
- end
24
-
25
22
  def load_scope
26
23
  super.published.friendly
27
24
  end
@@ -1,5 +1,5 @@
1
1
  module Ecm
2
2
  module Blog
3
- VERSION = '0.2.0'.freeze
3
+ VERSION = '1.0.0'.freeze
4
4
  end
5
5
  end
@@ -6,14 +6,19 @@ module Ecm
6
6
 
7
7
  source_root File.expand_path('../templates', __FILE__)
8
8
 
9
+ attr_reader :base_controller_class_name
10
+
11
+ def initialize(*args)
12
+ super
13
+ @base_controller_class_name = ENV.fetch('BASE_CONTROLLER_CLASS_NAME') { '::FrontendController' }
14
+ end
15
+
9
16
  def generate_initializer
10
- copy_file 'initializer.rb', 'config/initializers/ecm_blog.rb'
17
+ template 'initializer.rb', 'config/initializers/ecm_blog.rb'
11
18
  end
12
19
 
13
20
  def generate_routes
14
- inject_into_file 'config/routes.rb', before: "\nend" do
15
- File.read(File.join(File.expand_path('../templates', __FILE__), 'routes.source'))
16
- end
21
+ route File.read(File.join(File.expand_path('../templates', __FILE__), 'routes.source'))
17
22
  end
18
23
  end
19
24
  end
@@ -1,9 +1,9 @@
1
1
  Ecm::Blog.configure do |config|
2
- # Set the base controller for the controllers
2
+ # Set the base controller for the page controller
3
3
  #
4
- # Default: config.base_controller = '::FrontendController'
4
+ # Default: config.base_controller = '<%= base_controller_class_name %>'
5
5
  #
6
- config.base_controller = '::FrontendController'
6
+ config.base_controller = '<%= base_controller_class_name %>'
7
7
 
8
8
  config.creator_class_name = 'User'
9
9
  end
@@ -1,3 +1,3 @@
1
1
 
2
2
 
3
- mount Ecm::Blog::Engine, at: '/'
3
+ mount Ecm::Blog::Engine, at: '/'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecm_blog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Vasquez Angel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-05 00:00:00.000000000 Z
11
+ date: 2018-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails