bootstrap_views_generator 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/Gemfile +1 -1
- data/README.md +10 -2
- data/lib/bootstrap_views_generator/version.rb +1 -1
- data/lib/generators/bootstrap/install_generator.rb +4 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a7a507f490b7ae5438db33f0141e7c6d19cb611335ae016242c958672b6e4f8
|
4
|
+
data.tar.gz: 23916c6fb15ce3fff85579c5e4f122889ff2ac2a638a30a635469ac936ead3a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd1419141de0306f659690ca02b2b215225fda7101af6a24cde0ceea76cc231dc0307f42b4ebb7deca7955199041b149f0d4c1b4b0771ff148cfcfa8b5619de9
|
7
|
+
data.tar.gz: 432b0e234d3e057bacb05c1eda7f1d1ffa50daecd2ad943951d14d4c8753a784514ff5bf60ece2d8830c5028aa9f2d9c112c42624a12fee2a72c743c140b61bc
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -10,6 +10,12 @@ Add this line to your application's Gemfile:
|
|
10
10
|
|
11
11
|
```ruby
|
12
12
|
gem 'bootstrap_views_generator', group: :development
|
13
|
+
|
14
|
+
# Now make sure you have the bootstrap gem installed in your Gemfile
|
15
|
+
gem 'bootstrap', '~> 4.3'
|
16
|
+
|
17
|
+
# And ensure you have bootstrap included in your application.scss
|
18
|
+
@import 'bootstrap';
|
13
19
|
```
|
14
20
|
|
15
21
|
And then execute:
|
@@ -28,14 +34,16 @@ Usage:
|
|
28
34
|
|
29
35
|
Options:
|
30
36
|
Options:
|
31
|
-
-t, [--template-engine=TEMPLATE_ENGINE] # Indicates when to generate template engine
|
37
|
+
-t, [--template-engine=TEMPLATE_ENGINE] # Indicates when to generate using a designated template engine (erb, slim, haml)
|
32
38
|
# Default: erb
|
33
|
-
--simpleform # Indicates if
|
39
|
+
--simpleform # Indicates if simple_form is to be used to generate the forms
|
34
40
|
# Default: false
|
35
41
|
--pagination # Specify if you want to add pagination to the index pages
|
36
42
|
# Defaults: false (requires Pagy to use pagination)
|
37
43
|
--metatags # If you want the pages titles to use the metatags gem function for the page title
|
38
44
|
# Default: false
|
45
|
+
--layout # Over-write your application layout file with a bootstrap based layout
|
46
|
+
# Default: false
|
39
47
|
```
|
40
48
|
|
41
49
|
## Options
|
@@ -8,6 +8,7 @@ module Bootstrap
|
|
8
8
|
|
9
9
|
class_option :template_engine, type: :string, default: 'erb', aliases: '-t', desc: 'Set template engine to generate the views with'
|
10
10
|
# Boolean flags that can be flagged by adding to the generator call ie: --pagination or --metag_tags
|
11
|
+
class_option :layout, type: :boolean, default: false, aliases: "-l", desc: 'Over-write your application layout file with a bootstrap based layout'
|
11
12
|
class_option :metatags, type: :boolean, default: false, aliases: "-m", desc: 'If views will assign pages title using metatags gem'
|
12
13
|
class_option :pagination, type: :boolean, default: false, aliases: '-p', desc: 'Toggle if pagination will be used with the index view/controller (based off of Pagy)'
|
13
14
|
class_option :simpleform, type: :boolean, default: false, aliases: '-sf', desc: 'Enable SimpleForms for the form generating'
|
@@ -21,19 +22,15 @@ module Bootstrap
|
|
21
22
|
end
|
22
23
|
|
23
24
|
def create_layout
|
24
|
-
template
|
25
|
+
template("layouts/application.html.#{options[:template_engine]}.tt", "app/views/layouts/application.html.#{options[:template_engine]}", force: true) if options[:layout]
|
25
26
|
end
|
26
27
|
|
27
28
|
def copy_shared_pagination
|
28
|
-
if options[:pagination]
|
29
|
-
copy_file "shared/_pagination.html.#{options[:template_engine]}", "app/views/shared/_pagination.html.#{options[:template_engine]}", force: true
|
30
|
-
end
|
29
|
+
copy_file("shared/_pagination.html.#{options[:template_engine]}", "app/views/shared/_pagination.html.#{options[:template_engine]}", force: true) if options[:pagination]
|
31
30
|
end
|
32
31
|
|
33
32
|
def copy_simpleforms
|
34
|
-
if options[:simpleform]
|
35
|
-
copy_file "simple_form/_form.html.#{options[:template_engine]}", "lib/templates/#{options[:template_engine]}/scaffold/_form.html.#{options[:template_engine]}", force: true
|
36
|
-
end
|
33
|
+
copy_file("simple_form/_form.html.#{options[:template_engine]}", "lib/templates/#{options[:template_engine]}/scaffold/_form.html.#{options[:template_engine]}", force: true) if options[:simpleform]
|
37
34
|
end
|
38
35
|
|
39
36
|
# Inject Bootstrap helpers into teh application_helper file
|
@@ -77,7 +74,6 @@ module Bootstrap
|
|
77
74
|
HELPER
|
78
75
|
|
79
76
|
inject_into_file 'app/helpers/application_helper.rb', helper_str, after: "module ApplicationHelper\n"
|
80
|
-
|
81
77
|
end
|
82
78
|
end
|
83
79
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bootstrap_views_generator
|
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
|
- Brandon Hicks
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bootstrap
|