semantic_ui_views_generator 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/generators/semantic/install_generator.rb +22 -7
- data/lib/generators/semantic/templates/layouts/application.html.erb.tt +10 -17
- data/lib/generators/semantic/templates/layouts/application.html.haml.tt +11 -18
- data/lib/generators/semantic/templates/layouts/application.html.slim.tt +10 -17
- data/lib/semantic_ui_views_generator/version.rb +1 -1
- data/semantic_ui_views_generator.gemspec +2 -2
- metadata +14 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fde662c19449eb49cdf183978e15db8025d292b5e5c9b87e52dcafe1132a112
|
4
|
+
data.tar.gz: e22e2939e58fbc8f321546b36ad5676aab5d72cf89c6fcdb8687ea4cb6ec1c07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6847c188c650e8bc26756fa98afd1f26cddee8a47a2aad464d144161cde7d58bfbbb1127d046fdc61f7a913780c32626857c5bee5a4737793f7aa21bfa953f3c
|
7
|
+
data.tar.gz: 3a4355acb1a8376e9be4b8b62267b85d6d756a9a0a0c7c48828fa6efed68ae3e43fb3703ba11d6a8babeab4643fff1447487619780385e232400ef6bbfbfc85e
|
data/README.md
CHANGED
@@ -49,6 +49,10 @@ Options:
|
|
49
49
|
# Default: false
|
50
50
|
--devise # If you want to generate semantic based devise views
|
51
51
|
# Default: false
|
52
|
+
--skip_javascript # If you want to skip adding javascript_include_tag || javascript_pack_tag to the layouts
|
53
|
+
# Default: false
|
54
|
+
--skip_turbolinks # Do you want to skip associating turbolinks with the assets and views
|
55
|
+
# Default: false
|
52
56
|
```
|
53
57
|
|
54
58
|
## Options
|
@@ -6,14 +6,29 @@ module Semantic
|
|
6
6
|
class InstallGenerator < ::Rails::Generators::Base
|
7
7
|
desc 'Overwrite Rails scaffold templates with Semantic UI based templates'
|
8
8
|
source_root ::File.expand_path('../templates', __FILE__)
|
9
|
-
|
10
|
-
|
9
|
+
class_option :template_engine, type: :string, default: 'erb', aliases: '-t', enum: %w[erb slim haml],
|
10
|
+
desc: 'Set template engine to generate the views with'
|
11
11
|
# Boolean flags that can be flagged by adding to the generator call ie: --pagination or --metag_tags
|
12
|
-
class_option :devise,
|
13
|
-
|
14
|
-
|
15
|
-
class_option :
|
16
|
-
|
12
|
+
class_option :devise, type: :boolean, default: false,
|
13
|
+
desc: 'If views for devise will be required by the generator'
|
14
|
+
|
15
|
+
class_option :layout, type: :boolean, default: false, aliases: '-l',
|
16
|
+
desc: 'Over-write your application layout file with a Semantic UI based layout'
|
17
|
+
|
18
|
+
class_option :metatags, type: :boolean, default: false, aliases: '-m',
|
19
|
+
desc: 'If views will assign pages title using metatags gem'
|
20
|
+
|
21
|
+
class_option :pagination, type: :boolean, default: false, aliases: '-p',
|
22
|
+
desc: 'Toggle if pagination will be used with the index view/controller (based off of Pagy)'
|
23
|
+
|
24
|
+
class_option :simpleform, type: :boolean, default: false, aliases: '-sf',
|
25
|
+
desc: 'Enable SimpleForms for the form generating'
|
26
|
+
|
27
|
+
class_option :skip_javascript, type: :boolean, default: false,
|
28
|
+
desc: 'Skip adding javascript_include_tag or javascript_pack_tag to the layouts'
|
29
|
+
|
30
|
+
class_option :skip_turbolinks, type: :boolean, default: false,
|
31
|
+
desc: 'Skip associating assets and views with turbolinks'
|
17
32
|
|
18
33
|
def copy_scaffold_views
|
19
34
|
%w[edit index show new].each do |file|
|
@@ -4,28 +4,21 @@
|
|
4
4
|
<meta charset="utf-8" />
|
5
5
|
<meta content="IE=Edge" http-equiv="X-UA-Compatible" />
|
6
6
|
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
|
7
|
-
<%- if options[:metatags]
|
7
|
+
<%- if options[:metatags] -%>
|
8
8
|
<%%= display_meta_tags site: '<%= Rails.application.class.parent.to_s.titleize %>' %>
|
9
9
|
<%- else -%>
|
10
10
|
<title>Semantic UI template</title>
|
11
|
-
|
11
|
+
<%- end -%>
|
12
12
|
<%%= csrf_meta_tags %>
|
13
13
|
<%%= csp_meta_tag %>
|
14
|
-
|
15
|
-
|
16
|
-
<%- if Gem::Version.new(Rails.version) < Gem::Version.new('6.0')
|
17
|
-
<%%= javascript_include_tag 'application' %>
|
18
|
-
<%- else
|
19
|
-
<%%= javascript_pack_tag 'application' %>
|
20
|
-
<%- end
|
21
|
-
|
22
|
-
<%%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
|
23
|
-
<%- if Gem::Version.new(Rails.version) < Gem::Version.new('6.0') %>
|
24
|
-
<%%= javascript_include_tag 'application', 'data-turbolinks-track': true %>
|
25
|
-
<%- else %>
|
26
|
-
<%%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
|
27
|
-
<% end %>
|
28
|
-
<%- end -%>
|
14
|
+
<%%= stylesheet_link_tag 'application', media: 'all'<%= (options[:skip_turbolinks] || options[:skip_javascript]) ? '' : ", 'data-turbolinks-track': 'reload'" %> %>
|
15
|
+
<%- unless options[:skip_javascript] -%>
|
16
|
+
<%- if Gem::Version.new(Rails.version) < Gem::Version.new('6.0') -%>
|
17
|
+
<%%= javascript_include_tag 'application'<%= options[:skip_turbolinks] ? '' : ", 'data-turbolinks-track': true" -%> %>
|
18
|
+
<%- else -%>
|
19
|
+
<%%= javascript_pack_tag 'application'<%= options[:skip_turbolinks] ? '' : ", 'data-turbolinks-track': 'reload'" -%> %>
|
20
|
+
<%- end -%>
|
21
|
+
<%- end -%>
|
29
22
|
<!--IE Polyfill for CSS Elements-->
|
30
23
|
<!--HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries-->
|
31
24
|
<!--[if lt IE 9]>
|
@@ -5,28 +5,21 @@
|
|
5
5
|
%meta{charset: "utf-8"}/
|
6
6
|
%meta{content: "IE=Edge", "http-equiv" => "X-UA-Compatible"}/
|
7
7
|
%meta{content: "width=device-width, initial-scale=1.0", name: "viewport"}/
|
8
|
-
<%- if options[:metatags]
|
8
|
+
<%- if options[:metatags] -%>
|
9
9
|
= display_meta_tags site: '<%= Rails.application.class.parent.to_s.titleize %>'
|
10
|
-
|
10
|
+
<%- else -%>
|
11
11
|
%title Semantic UI template
|
12
|
-
|
12
|
+
<%- end -%>
|
13
13
|
= csrf_meta_tags
|
14
14
|
= csp_meta_tag
|
15
|
-
|
16
|
-
|
17
|
-
<%- if Gem::Version.new(Rails.version) < Gem::Version.new('6.0')
|
18
|
-
= javascript_include_tag 'application'
|
19
|
-
<%- else
|
20
|
-
= javascript_pack_tag 'application'
|
21
|
-
|
22
|
-
|
23
|
-
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload'
|
24
|
-
<%- if Gem::Version.new(Rails.version) < Gem::Version.new('6.0') %>
|
25
|
-
= javascript_include_tag 'application', 'data-turbolinks-track': true
|
26
|
-
<%- else %>
|
27
|
-
= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload'
|
28
|
-
<% end %>
|
29
|
-
<%- end -%>
|
15
|
+
= stylesheet_link_tag 'application', media: 'all'<%= (options[:skip_turbolinks] || options[:skip_javascript]) ? '' : ", 'data-turbolinks-track': 'reload'" %>
|
16
|
+
<%- unless options[:skip_javascript] -%>
|
17
|
+
<%- if Gem::Version.new(Rails.version) < Gem::Version.new('6.0') -%>
|
18
|
+
= javascript_include_tag 'application'<%= options[:skip_turbolinks] ? '' : ", 'data-turbolinks-track': true" -%>
|
19
|
+
<%- else -%>
|
20
|
+
= javascript_pack_tag 'application'<%= options[:skip_turbolinks] ? '' : ", 'data-turbolinks-track': 'reload'" -%>
|
21
|
+
<%- end -%>
|
22
|
+
<%- end %>
|
30
23
|
/ IE Polyfill for CSS Elements
|
31
24
|
/ HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries
|
32
25
|
/[if lt IE 9]
|
@@ -4,28 +4,21 @@ html
|
|
4
4
|
meta charset="utf-8"
|
5
5
|
meta content="IE=Edge" http-equiv="X-UA-Compatible"
|
6
6
|
meta content="width=device-width, initial-scale=1.0" name="viewport"
|
7
|
-
<%- if options[:metatags]
|
7
|
+
<%- if options[:metatags] -%>
|
8
8
|
= display_meta_tags site: '<%= Rails.application.class.parent.to_s.titleize %>'
|
9
|
-
|
9
|
+
<%- else -%>
|
10
10
|
title Semantic UI template
|
11
|
-
|
11
|
+
<%- end -%>
|
12
12
|
= csrf_meta_tags
|
13
13
|
= csp_meta_tag
|
14
|
-
|
15
|
-
|
16
|
-
<%- if Gem::Version.new(Rails.version) < Gem::Version.new('6.0')
|
17
|
-
= javascript_include_tag 'application'
|
18
|
-
<%- else
|
19
|
-
= javascript_pack_tag 'application'
|
14
|
+
= stylesheet_link_tag 'application', media: 'all'<%= (options[:skip_turbolinks] || options[:skip_javascript]) ? '' : ", 'data-turbolinks-track': 'reload'" %>
|
15
|
+
<%- unless options[:skip_javascript] -%>
|
16
|
+
<%- if Gem::Version.new(Rails.version) < Gem::Version.new('6.0') -%>
|
17
|
+
= javascript_include_tag 'application'<%= options[:skip_turbolinks] ? '' : ", 'data-turbolinks-track': true" -%>
|
18
|
+
<%- else -%>
|
19
|
+
= javascript_pack_tag 'application'<%= options[:skip_turbolinks] ? '' : ", 'data-turbolinks-track': 'reload'" -%>
|
20
|
+
<%- end -%>
|
20
21
|
<%- end %>
|
21
|
-
<%- else -%>
|
22
|
-
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload'
|
23
|
-
<%- if Gem::Version.new(Rails.version) < Gem::Version.new('6.0') %>
|
24
|
-
= javascript_include_tag 'application', 'data-turbolinks-track': true
|
25
|
-
<%- else %>
|
26
|
-
= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload'
|
27
|
-
<% end %>
|
28
|
-
<%- end -%>
|
29
22
|
/! IE Polyfill for CSS Elements
|
30
23
|
/! HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries
|
31
24
|
/[if lt IE 9]
|
@@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
|
|
33
33
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
34
34
|
spec.require_paths = ['lib']
|
35
35
|
|
36
|
-
spec.add_runtime_dependency 'railties', '>= 4.0'
|
37
|
-
spec.add_development_dependency 'bundler', '>= 1.17'
|
36
|
+
spec.add_runtime_dependency 'railties', '>= 4.0', '<= 7'
|
37
|
+
spec.add_development_dependency 'bundler', '>= 1.17', '<= 3'
|
38
38
|
spec.add_development_dependency 'rake', '>= 10.0'
|
39
39
|
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.
|
4
|
+
version: 0.0.8
|
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-
|
11
|
+
date: 2019-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -17,6 +17,9 @@ dependencies:
|
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '4.0'
|
20
|
+
- - "<="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '7'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -24,6 +27,9 @@ dependencies:
|
|
24
27
|
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '4.0'
|
30
|
+
- - "<="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '7'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: bundler
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -31,6 +37,9 @@ dependencies:
|
|
31
37
|
- - ">="
|
32
38
|
- !ruby/object:Gem::Version
|
33
39
|
version: '1.17'
|
40
|
+
- - "<="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '3'
|
34
43
|
type: :development
|
35
44
|
prerelease: false
|
36
45
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -38,6 +47,9 @@ dependencies:
|
|
38
47
|
- - ">="
|
39
48
|
- !ruby/object:Gem::Version
|
40
49
|
version: '1.17'
|
50
|
+
- - "<="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '3'
|
41
53
|
- !ruby/object:Gem::Dependency
|
42
54
|
name: rake
|
43
55
|
requirement: !ruby/object:Gem::Requirement
|