lotus_admin 0.1.4 → 0.2.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
2
  SHA1:
3
- metadata.gz: 42904b79273766b1d437280515974a9fa8a2aaf7
4
- data.tar.gz: dc80eef83651a0de1dcbdf7f744c47331ba09f6f
3
+ metadata.gz: 71c9fe1d41f76cb80a2e2dd1417dbe65eed53559
4
+ data.tar.gz: 8b06ff35a33b84fa577365a67df9fe98e963d8af
5
5
  SHA512:
6
- metadata.gz: f3f9970e0123aa55b5de99f7db01866de21c7da180bf270f0c1aa8b2a41e199a2bf9e8070518d10e9b13f7148bb7351d7ae87b3b58592df932d360779695e78a
7
- data.tar.gz: 25f5ce57e8277f44abe10e5f4908d9963bc9cad45004d20d9defea458ffd16930e6128744bd96110636ca0dbdf90ad1e98ca46c20fab830ed837c2d2044f48f8
6
+ metadata.gz: 9272546b682589398887a5ec302deed33b56cde039e53cd63d2cdad4bcebdaf7f664f3432ae42f580449339bcfab56015524bb5b16e934803ba88d417f993646
7
+ data.tar.gz: c5f612e7a6a2416c1874e8d028ceafd08ec7b4279e08eb70db26771d222f574bc8c364b12e0ac90af93efb23bfa389b66735ab45265691ad3f386bc8b2136321
data/README.md CHANGED
@@ -49,6 +49,21 @@ There are many partials and SCSS variables that can be overwritten to customize
49
49
 
50
50
  To get started, provide any SCSS variables in a file at `app/assets/stylesheets/lotus_admin/_variables.scss`.
51
51
 
52
+ ## Configuration
53
+ You may configure the engine by providing an intializer:
54
+
55
+ ```ruby
56
+ # conifg/initializers/lotus_admin.rb
57
+ LotusAdmin.configure do |config|
58
+
59
+ # perhaps add more custom resources
60
+ config.routes do
61
+ resources :cats, only: :show
62
+ resources :dogs
63
+ end
64
+ end
65
+ ```
66
+
52
67
  ## Contributing
53
68
  Contribution directions go here.
54
69
 
data/config/routes.rb CHANGED
@@ -4,5 +4,7 @@ LotusAdmin::Engine.routes.draw do
4
4
  resources :users
5
5
  resource :profile, only: [:edit, :update]
6
6
 
7
+ LotusAdmin.install_routes!(self)
8
+
7
9
  root to: 'dashboard#show'
8
10
  end
@@ -0,0 +1,11 @@
1
+ module LotusAdmin
2
+ class Configuration
3
+ def routes(&block)
4
+ routing_options.push(block)
5
+ end
6
+
7
+ def routing_options
8
+ @routing_options ||= []
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module LotusAdmin
2
- VERSION = '0.1.4'
2
+ VERSION = '0.2.0'
3
3
  end
data/lib/lotus_admin.rb CHANGED
@@ -12,6 +12,22 @@ require 'jquery-rails'
12
12
  require 'page_title_helper'
13
13
  require 'kaminari'
14
14
 
15
+ require 'lotus_admin/configuration'
16
+
15
17
  module LotusAdmin
16
- # Your code goes here...
18
+ module_function
19
+
20
+ def configure(&block)
21
+ yield(configuration)
22
+ end
23
+
24
+ def configuration
25
+ @configuration ||= Configuration.new
26
+ end
27
+
28
+ def install_routes!(router)
29
+ configuration.routing_options.each do |routes|
30
+ router.instance_eval(&routes)
31
+ end
32
+ end
17
33
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lotus_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Millsaps-Brewer
@@ -341,6 +341,7 @@ files:
341
341
  - db/migrate/20180228124526_devise_create_lotus_admin_users.rb
342
342
  - db/migrate/20180228210938_add_timezone_to_users.rb
343
343
  - lib/lotus_admin.rb
344
+ - lib/lotus_admin/configuration.rb
344
345
  - lib/lotus_admin/engine.rb
345
346
  - lib/lotus_admin/version.rb
346
347
  - lib/tasks/lotus_admin_tasks.rake