tilt-mote 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +16 -0
  3. data/lib/cuba/mote.rb +1 -25
  4. data/tilt-mote.gemspec +1 -1
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2319a7544f823994355afe5b65d6ca067c9a1b27
4
- data.tar.gz: fa8e65fdcf3f313a7acbea4462586387dc755100
3
+ metadata.gz: dac3da76b83dc8de879d241d34f71d3c9a6bc1c0
4
+ data.tar.gz: 859072b03170b83e59e53dfb1ce2f51dce2910a8
5
5
  SHA512:
6
- metadata.gz: 8074add34e08ef966a171a4eb1ff5009dc250accbf6b8f394322cabd1898e115b9c162d98c945824e3152cbeabe73be7ffc2a71aa859902dd0621670ea948a85
7
- data.tar.gz: ce52c8e1a23da1d28b2a4694677c8dc138af442079b86c6734b0b530dfd64217b6e9865606e82150167e2890aae5119fdce8bd2af9bf9564e2bd7bf6b0e69d48
6
+ metadata.gz: f2b5aecbf41f1231372cdae9bb0d27511416bffe870f143b633feea2c9d551e5620ec252f86acf2007b405af7f4f1ebb3f1e7560eca467f33a52ae8d0934b174
7
+ data.tar.gz: 9209f25ef8ad5c4ab538eb2498034870dcd7593941e10b75f656c5890f877abc9204b183aec301b486f0a0e59ceea2f85b108afcad799db8f1f0e6b60ac472f7
data/README.md CHANGED
@@ -24,6 +24,22 @@ template = Tilt.new('dashboard.mote')
24
24
  template.render(nil, dashboard: @dashboard)
25
25
  ```
26
26
 
27
+ Cuba plugin
28
+ -----------
29
+
30
+ There is a [Cuba](https://github.com/soveran/cuba) minimal plugin you could use.
31
+
32
+ ```
33
+ require 'cuba'
34
+ require 'cuba/render'
35
+ require 'tilt/mote'
36
+
37
+ Cuba.plugin Cuba::Render
38
+ Cuba.plugin MoteHelper
39
+ ```
40
+
41
+ That's it! Now you can use your Mote templates in your Cuba application.
42
+
27
43
  Installation
28
44
  ------------
29
45
 
data/lib/cuba/mote.rb CHANGED
@@ -1,31 +1,7 @@
1
- # borrowed from:
2
- # https://github.com/harmoni-io/mote-render/blob/master/lib/mote/render.rb
3
1
  module Mout
4
2
  module Render
5
- include ::Mote::Helpers
6
-
7
3
  def self.setup(app)
8
- app.settings[:template_engine] = "mote"
9
- end
10
-
11
- def render(template, locals = {}, layout = settings[:render][:layout])
12
- res.write(view(template, locals, layout))
13
- end
14
-
15
- def view(template, locals = {}, layout = settings[:render][:layout])
16
- partial(layout, locals.merge(content: partial(template, locals)))
17
- end
18
-
19
- def partial(template, locals = {})
20
- mote(mote_path(template), locals.merge(app: self), TOPLEVEL_BINDING)
21
- end
22
-
23
- def mote_path(template)
24
- if template.end_with?(".mote")
25
- template
26
- else
27
- File.join(settings[:render][:views], "#{template}.mote")
28
- end
4
+ app.settings[:render][:template_engine] = "mote"
29
5
  end
30
6
  end
31
7
  end
data/tilt-mote.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "tilt-mote"
7
- spec.version = "0.0.2"
7
+ spec.version = "0.0.3"
8
8
  spec.authors = ["Horacio Bertorello"]
9
9
  spec.email = ["syrii@msn.com"]
10
10
  spec.summary = "Use Mote templates with Tilt."
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tilt-mote
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Horacio Bertorello