kadim 0.1.0 → 0.1.1
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 +4 -4
- data/README.md +5 -0
- data/lib/generators/kadim/host/USAGE +8 -0
- data/lib/generators/kadim/host/host_generator.rb +21 -0
- data/lib/kadim/version.rb +1 -1
- data/lib/kadim.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0609e21a1cde13e365c213353302e153cd080dcb4d694550394e179a388f8473'
|
4
|
+
data.tar.gz: 53e8961b9ac7de492f843f6755177324dc2e53e66ca97cf4083f50e6c7745003
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f4530436577de2e6a8fab5fc17735339cb566c5731c3149d8b4917cac1548a6dea94f90e259b6c72d9709e17c0cccdebf4fc0cff6c4e5aadb750b1cce5e8804
|
7
|
+
data.tar.gz: bee6b4545a6115496e7cdcd45f7a38061b68d0eff14eb0d14a09632c5e9756530a35009a91bcacc1f12b419c2248ea08ac472f65313de2863a415a087990f037
|
data/README.md
CHANGED
@@ -25,6 +25,11 @@ ActiveRecord methods added by gems are ignored.
|
|
25
25
|
Files are generated in `tmp/kadim` and loaded into memory, including views. This also has the advantage of allowing the
|
26
26
|
gem to work in environments with ephemeral file systems.
|
27
27
|
|
28
|
+
If you want to customize `Kadim::ApplicationController`, the basic controller for all generated controllers, you can
|
29
|
+
copy the file [app/controllers/kadim/application_controller.rb](https://github.com/fnix/kadim/blob/master/app/controllers/kadim/application_controller.rb)
|
30
|
+
to your application. You can do the same for [app/views/layouts/kadim/application.html.erb](https://github.com/fnix/kadim/blob/master/app/views/layouts/kadim/application.html.erb).
|
31
|
+
If you want to customize the generated controller/views just copy them from `tmp/kadim` to your application.
|
32
|
+
|
28
33
|
## Installation
|
29
34
|
Add this line to your application's Gemfile:
|
30
35
|
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Kadim
|
4
|
+
class HostGenerator < Rails::Generators::Base
|
5
|
+
source_root File.expand_path("templates", __dir__)
|
6
|
+
|
7
|
+
BASE_DIRS = [
|
8
|
+
"app/assets/javascripts/kadim",
|
9
|
+
"app/assets/stylesheets/kadim",
|
10
|
+
"app/controllers/kadim",
|
11
|
+
"app/helpers/kadim",
|
12
|
+
"app/views/kadim",
|
13
|
+
"app/views/layouts/kadim"
|
14
|
+
]
|
15
|
+
|
16
|
+
def copy_base_files
|
17
|
+
self.class.source_root File.expand_path("../../../..", __dir__)
|
18
|
+
BASE_DIRS.each { |dirname| directory dirname }
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/lib/kadim/version.rb
CHANGED
data/lib/kadim.rb
CHANGED
@@ -11,7 +11,7 @@ module Kadim
|
|
11
11
|
Dir[Rails.root.join("app", "models", "**", "*.rb")]
|
12
12
|
.reject { |model_path| model_path.include?("/concerns/") || model_path.include?("application_record") }
|
13
13
|
.map { |model_path| model_path.remove(%r{.*/app/models/}, ".rb") }
|
14
|
-
.select { |model_name| model_name.camelize.constantize.table_exists? }
|
14
|
+
.select { |model_name| model_name.camelize.constantize.try(:table_exists?) }
|
15
15
|
.sort
|
16
16
|
end
|
17
17
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kadim
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kadu Diógenes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-11-
|
11
|
+
date: 2019-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activestorage-resumable
|
@@ -212,6 +212,8 @@ files:
|
|
212
212
|
- app/views/kadim/application/index.html.erb
|
213
213
|
- app/views/layouts/kadim/application.html.erb
|
214
214
|
- config/routes.rb
|
215
|
+
- lib/generators/kadim/host/USAGE
|
216
|
+
- lib/generators/kadim/host/host_generator.rb
|
215
217
|
- lib/kadim.rb
|
216
218
|
- lib/kadim/engine.rb
|
217
219
|
- lib/kadim/template/memory_resolver.rb
|