semantic_ui_views_generator 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 449e81ca109162a7e8774a9cac8b2f3590acc99746cd3f1f9d216526d16728eb
4
- data.tar.gz: 364364555140d12b5e237d6b6bcb899d38d1a422114094e564b9194d59871267
3
+ metadata.gz: 192cbb438a8179cfdf4743b7196b784e3bf58b7e6e84743539961ddee8d2b6a8
4
+ data.tar.gz: 4117170563e3d6bfea9466b91dcc0421871c5bf3b2cc5ab8d0ff4ff09934e3c8
5
5
  SHA512:
6
- metadata.gz: aacf03a69049dcd1af5ddf5f5648d79f6cad8eb2b701181f39ede85aab1549c40c537697411cff10ca82eb52783abacb77b28a333777a3a2b9d1845ab183954a
7
- data.tar.gz: a11472343f81f2123c07754c266a64d044d529f4b1f1aa6acadcfeb18685545d030b768c7daf73584add744c164c2f557ba4f91b27dcfe5941332002d57ffe0d
6
+ metadata.gz: 4c654d4a82407501d7d02aff05f59c579b5d701285c3d7267431878a6b05f5995d430ee454bcddbdbb97650b4f09a2805a3e2be4838e1ca0bc0c60e76238c376
7
+ data.tar.gz: babe90ae2bf12189f784f3983e455fc30f2ab3b2added1aa228e42e8dcc19244818b37a0faababdde40ddc3237d0d5d1a71482d88184aa2b2051566b3650db5a
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # SemanticViewsGenerator
1
+ # Semantic-UI Views Generator
2
2
 
3
- ![](https://ruby-gem-downloads-badge.herokuapp.com/semantic_views_generator?type=total) [![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT) [![Gem Version](https://badge.fury.io/rb/semantic_views_generator.svg)](https://badge.fury.io/rb/semantic_views_generator)
3
+ ![](https://ruby-gem-downloads-badge.herokuapp.com/semantic_ui_views_generator?type=total) [![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT) [![Gem Version](https://badge.fury.io/rb/semantic_ui_views_generator.svg)](https://badge.fury.io/rb/semantic_ui_views_generator)
4
4
 
5
5
  This gem is used for generating semantic based scaffold views for your Rails application. They can be Erb, Slim, or HAML. You can include pagination (using Pagy), simple_form (for the form components), and if you'd like you can utilize the meta-tags gems to all dynamic page titles when switching between your view components.
6
6
 
@@ -12,6 +12,13 @@ Add this line to your application's Gemfile:
12
12
 
13
13
  ```ruby
14
14
  gem 'semantic_ui_views_generator', group: :development
15
+
16
+ # Before continuing make sure you have the semantic-ui-sass gem installed and included in your application.scss file
17
+ gem 'semantic-ui-sass', github: 'doabit/semantic-ui-sass'
18
+
19
+ # application.scss
20
+ @import 'semantic-ui';
21
+
15
22
  ```
16
23
 
17
24
  And then execute:
@@ -30,13 +37,15 @@ Usage:
30
37
 
31
38
  Options:
32
39
  Options:
33
- -t, [--template-engine=TEMPLATE_ENGINE] # Indicates when to generate template engine
40
+ -t, [--template-engine=TEMPLATE_ENGINE] # Indicates when to generate using a designated template engine (erb, slim, haml)
34
41
  # Default: erb
35
- --simpleform # Indicates if simpleform will be used (when used will generate a Semantic Ui based simple_form initialzer)
42
+ --simpleform # Indicates if simple_form is to be used to generate the forms
36
43
  # Default: false
37
44
  --pagination # Specify if you want to add pagination to the index pages
38
45
  # Defaults: false (requires Pagy to use pagination)
39
- --metatags # If you want the pages titles to use the metatags gem function for the page title
46
+ --metatags # If you want the pages titles to use the meta-tags gem function for the page title
47
+ # Default: false
48
+ --layout # Over-write your application layout file with a Semantic UI based layout
40
49
  # Default: false
41
50
  ```
42
51
 
@@ -8,6 +8,7 @@ module Semantic
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 Semantic UI 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'
@@ -20,7 +21,7 @@ module Semantic
20
21
  end
21
22
 
22
23
  def create_layout
23
- template "layouts/application.html.#{options[:template_engine]}.tt", "app/views/layouts/application.html.#{options[:template_engine]}", force: true
24
+ template("layouts/application.html.#{options[:template_engine]}.tt", "app/views/layouts/application.html.#{options[:template_engine]}", force: true) if options[:layout]
24
25
  end
25
26
 
26
27
  def copy_flash_messages
@@ -28,15 +29,12 @@ module Semantic
28
29
  end
29
30
 
30
31
  def copy_shared_pagination
31
- if options[:pagination]
32
- copy_file "shared/_pagination.html.#{options[:template_engine]}", "app/views/shared/_pagination.html.#{options[:template_engine]}", force: true
33
- end
32
+ copy_file("shared/_pagination.html.#{options[:template_engine]}", "app/views/shared/_pagination.html.#{options[:template_engine]}", force: true) if options[:pagination]
34
33
  end
35
34
 
36
35
  def copy_simpleforms
37
36
  if options[:simpleform]
38
37
  copy_file 'initialzers/simple_form.rb', 'config/initialzers/simple_form.rb', force: true
39
-
40
38
  copy_file "simple_form/_form.html.#{options[:template_engine]}", "lib/templates/#{options[:template_engine]}/scaffold/_form.html.#{options[:template_engine]}", force: true
41
39
  end
42
40
  end
@@ -1,3 +1,3 @@
1
1
  module SemanticUiViewsGenerator
2
- VERSION = '0.0.1'.freeze
2
+ VERSION = '0.0.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: semantic_ui_views_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
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-07 00:00:00.000000000 Z
11
+ date: 2019-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: semantic-ui-sass