spark_engine 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/spark_engine/helpers/layout_helpers.rb +16 -3
- data/lib/spark_engine/scaffold/gem/app/helpers/namespace/application_helper.rb +13 -0
- data/lib/spark_engine/scaffold/gem/app/views/layouts/namespace/default.html.erb +1 -2
- data/lib/spark_engine/scaffold/gem/site/app/controllers/docs_controller.rb +2 -2
- data/lib/spark_engine/version.rb +1 -1
- 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: 85484b63659bffb334c177eea2ed17a69f59816cbddeb5af36ab731690cce294
|
4
|
+
data.tar.gz: 1bea33c6abeb70f6b0a9be02b8c3eb0e8f5f5688d43def914880ebd327038b2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8032e5c1bf8037dc27412d9558922e0c94640d8a6fb0b6eedebaf8a2025a16c815d73bb2e6fbc42a6b4e4149ccc977dc730d9f10c3aa4dd1f49af22139fa94eb
|
7
|
+
data.tar.gz: 80ec5bac2c7d8b77b528e5c7eff990d13ae3f27867fb825d459bb597dd452c9a8fb07b55f45215e494afc53fe38aa748b7ff8d555cc44f86d388e0e1db0530aa
|
@@ -2,10 +2,10 @@ module SparkEngine
|
|
2
2
|
module Helpers
|
3
3
|
module LayoutHelper
|
4
4
|
def render_layout(*args, &block)
|
5
|
-
options =
|
5
|
+
options = {
|
6
|
+
locals: args.last.is_a?(Hash) ? args.pop : {}
|
7
|
+
}
|
6
8
|
options[:template] = "layouts/#{args.first}"
|
7
|
-
options[:locals] ||= {}
|
8
|
-
options[:locals][:classes] = [options.delete(:classes)].flatten
|
9
9
|
|
10
10
|
yield if block_given?
|
11
11
|
render options
|
@@ -18,6 +18,19 @@ module SparkEngine
|
|
18
18
|
def stylesheets(&block)
|
19
19
|
content_for :stylesheets, &block
|
20
20
|
end
|
21
|
+
|
22
|
+
# Make it easy to assign body classes from views
|
23
|
+
def root_class(classnames=nil)
|
24
|
+
unless classnames.nil?
|
25
|
+
content_for(:spark_root_classes) do
|
26
|
+
[classnames].flatten.join(' ') + ' '
|
27
|
+
end
|
28
|
+
end
|
29
|
+
if classes = content_for(:spark_root_classes)
|
30
|
+
classes.strip
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
21
34
|
end
|
22
35
|
end
|
23
36
|
end
|
@@ -1,4 +1,17 @@
|
|
1
1
|
module <%= @plugin_module %>
|
2
2
|
module ApplicationHelper
|
3
|
+
|
4
|
+
# Make it easy to assign body classes from views
|
5
|
+
def body_class(classnames=nil)
|
6
|
+
unless classnames.nil?
|
7
|
+
content_for(:body_classes) do
|
8
|
+
[classnames].flatten.join(' ') + ' '
|
9
|
+
end
|
10
|
+
end
|
11
|
+
if classes = content_for(:body_classes)
|
12
|
+
classes.strip
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
3
16
|
end
|
4
17
|
end
|
@@ -13,8 +13,7 @@
|
|
13
13
|
<script>console.log("<%= @plugin_module %>: <%%= <%= @gem_module %>::VERSION %>")</script>
|
14
14
|
</head>
|
15
15
|
|
16
|
-
|
17
|
-
<body class="<%%= body_classes.join(' ') %>">
|
16
|
+
<body class="<%%= root_class %>">
|
18
17
|
<%%= yield %>
|
19
18
|
|
20
19
|
<%%= javascript_tag "<%= @engine %>" %>
|
@@ -10,8 +10,8 @@ class DocsController < ApplicationController
|
|
10
10
|
|
11
11
|
if template_exists? page
|
12
12
|
render template: page
|
13
|
-
elsif template_exists? "docs
|
14
|
-
render template: "docs
|
13
|
+
elsif template_exists? "docs/#{page}"
|
14
|
+
render template: "docs/#{page}"
|
15
15
|
else
|
16
16
|
render file: "404.html", status: :not_found
|
17
17
|
end
|
data/lib/spark_engine/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spark_engine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Mathis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sass
|