Skip to content

Commit

Permalink
Update generale
Browse files Browse the repository at this point in the history
  • Loading branch information
gregogalante committed Oct 16, 2019
1 parent 8f2ee7a commit 41044fe
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
/pkg/
/spec/reports/
/tmp/
/testing/
9 changes: 9 additions & 0 deletions docs/pages/RailsGenerators.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ This command should create all initial files for general purpose projects. It ov

- ```config/initializer/_settings.rb```: A file that should be used to set custom application settings (application version, constants ecc.).
- ```.rubocop.yml```: A rubocop custom configuration.
- ```Procfile.dev```: A Procfile for foreman to start Rails and Webpack dev server with **foreman start -f Procfile.dev**

## Bootstrap

To install Bootstrap inside your application run:

```shell
rails generate dakarai:bootstrap
```

## Dockerize

Expand Down
20 changes: 20 additions & 0 deletions lib/generators/dakarai/bootstrap_generator.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# frozen_string_literal: true

require 'rails/generators/base'

module Dakarai

# BootstrapGenerator.
# Bootstrap integration to your application.
class BootstrapGenerator < Rails::Generators::Base

source_root File.expand_path('../../../../templates', __FILE__)

def create_bootstrap
directory './bootstrap', './'
run 'yarn add bootstrap jquery popper.js'
end

end

end
13 changes: 13 additions & 0 deletions templates/bootstrap/app/javascript/scripts/bootstrap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import 'bootstrap/js/dist/alert'
import 'bootstrap/js/dist/button'
import 'bootstrap/js/dist/carousel'
import 'bootstrap/js/dist/collapse'
import 'bootstrap/js/dist/dropdown'
import 'bootstrap/js/dist/index'
import 'bootstrap/js/dist/modal'
import 'bootstrap/js/dist/popover'
import 'bootstrap/js/dist/scrollspy'
import 'bootstrap/js/dist/tab'
import 'bootstrap/js/dist/toast'
import 'bootstrap/js/dist/tooltip'
import 'bootstrap/js/dist/util'
38 changes: 38 additions & 0 deletions templates/bootstrap/app/javascript/style/bootstrap.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
@import '~bootstrap/scss/_functions.scss';
@import '~bootstrap/scss/_variables.scss';
@import '~bootstrap/scss/_mixins.scss';
@import '~bootstrap/scss/_root.scss';
@import '~bootstrap/scss/_reboot.scss';
@import '~bootstrap/scss/_type.scss';
@import '~bootstrap/scss/_alert.scss';
@import '~bootstrap/scss/_badge';
@import '~bootstrap/scss/_breadcrumb';
@import '~bootstrap/scss/_button-group';
@import '~bootstrap/scss/_buttons';
@import '~bootstrap/scss/_buttons.scss';
@import '~bootstrap/scss/_card.scss';
@import '~bootstrap/scss/_carousel.scss';
@import '~bootstrap/scss/_close.scss';
@import '~bootstrap/scss/_code.scss';
@import '~bootstrap/scss/_custom-forms.scss';
@import '~bootstrap/scss/_dropdown.scss';
@import '~bootstrap/scss/_forms.scss';
@import '~bootstrap/scss/_grid.scss';
@import '~bootstrap/scss/_images.scss';
@import '~bootstrap/scss/_input-group.scss';
@import '~bootstrap/scss/_jumbotron.scss';
@import '~bootstrap/scss/_list-group.scss';
@import '~bootstrap/scss/_media.scss';
@import '~bootstrap/scss/_modal.scss';
@import '~bootstrap/scss/_nav.scss';
@import '~bootstrap/scss/_navbar.scss';
@import '~bootstrap/scss/_pagination.scss';
@import '~bootstrap/scss/_popover.scss';
@import '~bootstrap/scss/_print.scss';
@import '~bootstrap/scss/_progress.scss';
@import '~bootstrap/scss/_spinners.scss';
@import '~bootstrap/scss/_tables.scss';
@import '~bootstrap/scss/_toasts.scss';
@import '~bootstrap/scss/_tooltip.scss';
@import '~bootstrap/scss/_transitions.scss';
@import '~bootstrap/scss/_utilities.scss';
2 changes: 2 additions & 0 deletions templates/initializer/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ gem 'webpacker', '~> 4.0'
gem 'jbuilder', '~> 2.7'
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.2', require: false
# Use foreman to start multiple process one time
gem 'foreman'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use Active Model has_secure_password
Expand Down
2 changes: 2 additions & 0 deletions templates/initializer/Procfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
web: bundle exec rails s -p 3000
webpacker: ./bin/webpack-dev-server

0 comments on commit 41044fe

Please sign in to comment.