dakarai 4.1.1 → 4.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -18
- data/lib/dakarai/version.rb +1 -1
- data/lib/generators/dakarai/engine_configuration_generator.rb +26 -0
- data/lib/generators/dakarai/engine_webpacker_generator.rb +64 -0
- data/lib/generators/dakarai/services_generator.rb +19 -0
- data/lib/generators/dakarai/sidekiq_generator.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71e5c1ab723e3d8360545aebd61638da7a69a02022acea613fe0e2b7b6062eb1
|
4
|
+
data.tar.gz: 3ca6d67c4c2b05eac8a91b595bddc88ce7bb584a59d965ce56be5fdddd3397b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60d12f97d38cc0a5c2b157f764d3e155aa270fd7708ed19e4c7af78d5a039285493288d5a0040058b6b6d1ea5d73d46c85232cfd8539ec258f95c3be41b3b5e2
|
7
|
+
data.tar.gz: e629e3715f3f49c2698dac03c697265cafc8f7b982b8e14e6bd791ed5d40e71b06667fe5fdebb62a2e7b30d05fd96a479ff8c752ee7e35d6bd3fcacbace99af1
|
data/README.md
CHANGED
@@ -1,10 +1,13 @@
|
|
1
1
|
# Dakarai
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/dakarai.svg)](https://badge.fury.io/rb/dakarai)
|
4
|
+
[![Inline docs](http://inch-ci.org/github/ideonetwork/dakarai.svg?branch=master)](http://inch-ci.org/github/ideonetwork/dakarai)
|
4
5
|
|
5
6
|
Code generator for new Rails projects.
|
6
7
|
This gem helps developers to start new Rails projects with a better starting boilerplate and popular gem integrations.
|
7
8
|
|
9
|
+
The full documentation of the gem can be found here: https://ideonetwork.github.io/dakarai
|
10
|
+
|
8
11
|
## Installation
|
9
12
|
|
10
13
|
To install the gem you need to add it on your Rails application's Gemfile:
|
@@ -19,30 +22,18 @@ Legacy version
|
|
19
22
|
gem 'dakarai'
|
20
23
|
```
|
21
24
|
|
22
|
-
##
|
23
|
-
|
24
|
-
Before any commands we recommend you to initialize your Rails app with Rails 5.2.* and the webpack option activated
|
25
|
-
|
26
|
-
```shell
|
27
|
-
rails new my_app --webpack --skip-sprockets
|
28
|
-
```
|
25
|
+
## Development
|
29
26
|
|
30
|
-
###
|
27
|
+
### Docsify documentation
|
31
28
|
|
32
|
-
|
29
|
+
Install docsify as global node dependency
|
33
30
|
|
34
31
|
```shell
|
35
|
-
|
32
|
+
npm install -g docsify
|
36
33
|
```
|
37
34
|
|
38
|
-
|
39
|
-
|
40
|
-
### Sidekiq
|
41
|
-
|
42
|
-
To add Sidekiq gem support on your application run:
|
35
|
+
See documentation on local machine
|
43
36
|
|
44
37
|
```shell
|
45
|
-
|
38
|
+
docsify serve ./docs
|
46
39
|
```
|
47
|
-
|
48
|
-
This command should add all files used to manage sidekiq and sidekiq cron (with redis).
|
data/lib/dakarai/version.rb
CHANGED
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rails/generators/base'
|
4
|
+
|
5
|
+
module Dakarai
|
6
|
+
|
7
|
+
# EngineConfigurationGenerator.
|
8
|
+
class EngineConfigurationGenerator < Rails::Generators::Base
|
9
|
+
|
10
|
+
source_root File.expand_path('../../../../templates', __FILE__)
|
11
|
+
|
12
|
+
argument :engine, type: :string, optional: false
|
13
|
+
|
14
|
+
def create_engine_configuration
|
15
|
+
@engine_class = engine.camelize
|
16
|
+
@engine_name = engine.underscore
|
17
|
+
|
18
|
+
template(
|
19
|
+
'engine_configuration/lib/engine/configuration.rb',
|
20
|
+
"lib/#{@engine_name}/configuration.rb"
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rails/generators/base'
|
4
|
+
|
5
|
+
module Dakarai
|
6
|
+
|
7
|
+
# EngineWebpackerGenerator.
|
8
|
+
class EngineWebpackerGenerator < Rails::Generators::Base
|
9
|
+
|
10
|
+
source_root File.expand_path('../../../../templates', __FILE__)
|
11
|
+
|
12
|
+
argument :engine, type: :string, optional: false
|
13
|
+
|
14
|
+
def create_engine_webpacker
|
15
|
+
@engine_class = engine.camelize
|
16
|
+
@engine_name = engine.underscore
|
17
|
+
|
18
|
+
# prepare engine emplate
|
19
|
+
template 'engine_webpacker/package.json', 'package.json'
|
20
|
+
template 'engine_webpacker/webpack.config.js', 'webpack.config.js'
|
21
|
+
template(
|
22
|
+
'engine_webpacker/lib/tasks/assets_management_tasks.rake',
|
23
|
+
'lib/tasks/assets_management_tasks.rake'
|
24
|
+
)
|
25
|
+
copy_file 'engine_webpacker/.babelrc', '.babelrc'
|
26
|
+
copy_file 'engine_webpacker/Gemfile', 'Gemfile'
|
27
|
+
copy_file 'engine_webpacker/.gitignore', '.gitignore'
|
28
|
+
copy_file(
|
29
|
+
'engine_webpacker/app/javascript/engine/index.js',
|
30
|
+
"app/javascript/#{@engine_name}/index.js"
|
31
|
+
)
|
32
|
+
copy_file(
|
33
|
+
'engine_webpacker/app/javascript/engine/scripts/main.js',
|
34
|
+
"app/javascript/#{@engine_name}/scripts/main.js"
|
35
|
+
)
|
36
|
+
copy_file(
|
37
|
+
'engine_webpacker/app/javascript/engine/style/main.scss',
|
38
|
+
"app/javascript/#{@engine_name}/style/main.scss"
|
39
|
+
)
|
40
|
+
copy_file(
|
41
|
+
'engine_webpacker/app/views/layouts/engine/application.html.erb',
|
42
|
+
"app/views/layouts/#{@engine_name}/application.html.erb"
|
43
|
+
)
|
44
|
+
|
45
|
+
# install dependencies
|
46
|
+
system 'bundle install'
|
47
|
+
system 'npm install -g yarn'
|
48
|
+
system 'yarn install'
|
49
|
+
system 'cd test/dummy && rails webpacker:install'
|
50
|
+
|
51
|
+
# prepare engine dummy app
|
52
|
+
template(
|
53
|
+
'engine_webpacker/test/dummy/config/initializers/webpacker.rb',
|
54
|
+
'test/dummy/config/initializers/webpacker.rb'
|
55
|
+
)
|
56
|
+
copy_file(
|
57
|
+
'engine_webpacker/test/dummy/app/javascript/packs/application.js',
|
58
|
+
'test/dummy/app/javascript/packs/application.js'
|
59
|
+
)
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rails/generators/base'
|
4
|
+
|
5
|
+
module Dakarai
|
6
|
+
|
7
|
+
# ServicesGenerator.
|
8
|
+
class ServicesGenerator < Rails::Generators::Base
|
9
|
+
|
10
|
+
source_root File.expand_path('../../../../templates', __FILE__)
|
11
|
+
|
12
|
+
def create_services
|
13
|
+
directory './services', './'
|
14
|
+
application "config.autoload_paths += %W[\#{Rails.root}/app/services]"
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dakarai
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ideonetwork
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -34,7 +34,10 @@ files:
|
|
34
34
|
- MIT-LICENSE
|
35
35
|
- README.md
|
36
36
|
- lib/dakarai/version.rb
|
37
|
+
- lib/generators/dakarai/engine_configuration_generator.rb
|
38
|
+
- lib/generators/dakarai/engine_webpacker_generator.rb
|
37
39
|
- lib/generators/dakarai/initializer_generator.rb
|
40
|
+
- lib/generators/dakarai/services_generator.rb
|
38
41
|
- lib/generators/dakarai/sidekiq_generator.rb
|
39
42
|
homepage: http://ideonetwork.it/
|
40
43
|
licenses:
|
@@ -44,6 +47,7 @@ post_install_message:
|
|
44
47
|
rdoc_options: []
|
45
48
|
require_paths:
|
46
49
|
- lib
|
50
|
+
- templates
|
47
51
|
required_ruby_version: !ruby/object:Gem::Requirement
|
48
52
|
requirements:
|
49
53
|
- - ">="
|