flame 1.0.4 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/flame/render.rb +13 -5
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 384b92d10d4900497a38949a18f91ac6ac823132
|
4
|
+
data.tar.gz: c0fc2d6ce00fc8d604e3e0a80e87561e7f16c98b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61e9d6978c5ef17f5610e95b429cecc2933e876c506d045e352f18d76d0c95b710e986ad3ced8606c9f954f75b2f22bb8f0054b438cf6afac43cde7b6f350f99
|
7
|
+
data.tar.gz: 636d98627dec1e1e85be4f8af0cf847bd6207381d68b02120454c3c5f2bf78a8efffc4e734a8a330a6c2eb9ded1e1175448dc343a50411f54a945787b05f0164
|
data/lib/flame/render.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
require 'tilt'
|
2
|
+
require 'tilt/plain'
|
3
|
+
require 'tilt/erb'
|
2
4
|
|
3
5
|
module Flame
|
4
6
|
## Helper for render functionality
|
@@ -22,23 +24,29 @@ module Flame
|
|
22
24
|
|
23
25
|
private
|
24
26
|
|
27
|
+
using GorillaPatch::StringExt
|
28
|
+
|
25
29
|
## TODO: Add `views_dir` for Application and Controller
|
26
30
|
## TODO: Add `layout` method for Controller
|
27
31
|
def find_file(path)
|
28
|
-
## Build controller_dir
|
29
|
-
controller_dir = (
|
30
|
-
self.class.name.split(/(?=[A-Z])/) - ['Controller']
|
31
|
-
).join('_').downcase
|
32
32
|
## Get full filename
|
33
33
|
Dir[File.join(
|
34
34
|
config[:views_dir],
|
35
|
-
"{#{
|
35
|
+
"{#{controller_dirs.join(',')},}",
|
36
36
|
"#{path}.*"
|
37
37
|
)].find do |file|
|
38
38
|
Tilt[file]
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
+
def controller_dirs
|
43
|
+
## Build controller_dirs
|
44
|
+
controller_dir = (
|
45
|
+
self.class.name.underscore.split('_') - %w(controller ctrl)
|
46
|
+
).join('_')
|
47
|
+
[controller_dir, controller_dir.split('/').last]
|
48
|
+
end
|
49
|
+
|
42
50
|
def layout_render(layout, result)
|
43
51
|
layout_filename = find_file(layout)
|
44
52
|
## Compile layout to hash
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flame
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Popov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -59,7 +59,7 @@ dependencies:
|
|
59
59
|
version: '0.0'
|
60
60
|
- - ">="
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: 0.0.
|
62
|
+
version: 0.0.6
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -69,7 +69,7 @@ dependencies:
|
|
69
69
|
version: '0.0'
|
70
70
|
- - ">="
|
71
71
|
- !ruby/object:Gem::Version
|
72
|
-
version: 0.0.
|
72
|
+
version: 0.0.6
|
73
73
|
description: Use controller's classes with instance methods as routing actions, mounting
|
74
74
|
its in application class.
|
75
75
|
email:
|