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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2569fc211bb99caae016194e9defa19c1945af9748eaebf3a89e7fb7b812fc5f
4
- data.tar.gz: 21954a1a99f741c3076ba850b068d17e4b5032921cb4bea76b147f35afd79ecf
3
+ metadata.gz: 85484b63659bffb334c177eea2ed17a69f59816cbddeb5af36ab731690cce294
4
+ data.tar.gz: 1bea33c6abeb70f6b0a9be02b8c3eb0e8f5f5688d43def914880ebd327038b2c
5
5
  SHA512:
6
- metadata.gz: d6f42cf5728886465dc2733dd7967042f09715f6375a3c8535d9a53bfa5a54d743f5f02eedd1491297a10ad4a302c0c1505d220bc1d57e2e2554428e154f8b55
7
- data.tar.gz: 526aaaa2d480c867c3886b84d80048148a8613e22fde97efabc509b66ad8e56c30357d524a7c2329091346f726852623e11716fd7abaa6503e0ea78879f440d8
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 = args.last.is_a?(Hash) ? args.pop : {}
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
- <%% body_classes ||= [] %>
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/\#{page}"
14
- render template: "docs/\#{page}"
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
@@ -1,3 +1,3 @@
1
1
  module SparkEngine
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
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.2
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-13 00:00:00.000000000 Z
11
+ date: 2018-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sass