erb_asterisk 0.0.15 → 0.0.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/erb_asterisk/file_cache.rb +2 -0
- data/lib/erb_asterisk/soft_write.rb +2 -0
- data/lib/erb_asterisk/version.rb +1 -1
- data/lib/erb_asterisk/yields.rb +4 -4
- data/lib/erb_asterisk.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2d732cfc87196aae06400244c1d47ac724c2862
|
4
|
+
data.tar.gz: c36746393e7706b09231dabcce46a27b15921b57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61fc33aa338ac132379fe55636c994344dee234e6ad97b5efac5d27dfaca5d5bc76b3775311f9625df183c84e7cfb15e146946f6008ad0043f00212d5aa8b67b
|
7
|
+
data.tar.gz: 0da5094683f8bba27f740b8c1314c402a61737f16f3a1057d4cecc673d76d2e0cf880535cb335293ce42091a6bc0f19a40d47d12e60d31318a0c45fa653a51ac
|
data/lib/erb_asterisk/version.rb
CHANGED
data/lib/erb_asterisk/yields.rb
CHANGED
@@ -3,7 +3,7 @@ module ErbAsterisk
|
|
3
3
|
# Apply line to place where yield_here :tag defined
|
4
4
|
def apply_line_to(tag, line, args = {})
|
5
5
|
default_args!(args)
|
6
|
-
apply_to_yields(
|
6
|
+
apply_to_yields(tag, line, args[:priority])
|
7
7
|
|
8
8
|
log_debug("apply_line_to: :#{tag}, #{line}, #{args}", 2)
|
9
9
|
"; Applied \"#{line}\" to :#{tag}"
|
@@ -15,7 +15,7 @@ module ErbAsterisk
|
|
15
15
|
old_output = @erb_output
|
16
16
|
@erb_output = ''
|
17
17
|
|
18
|
-
apply_to_yields(
|
18
|
+
apply_to_yields(tag, yield, args[:priority])
|
19
19
|
|
20
20
|
log_debug("content_for: :#{tag}, #{args}", 2)
|
21
21
|
@erb_output = old_output
|
@@ -33,9 +33,9 @@ module ErbAsterisk
|
|
33
33
|
|
34
34
|
private
|
35
35
|
|
36
|
-
def apply_to_yields(
|
36
|
+
def apply_to_yields(tag, content, priority)
|
37
37
|
@yields[tag] = [] if @yields[tag].nil?
|
38
|
-
@yields[tag] << { content: content, priority: priority
|
38
|
+
@yields[tag] << { content: content, priority: priority }
|
39
39
|
end
|
40
40
|
|
41
41
|
def output_yield(tag)
|
data/lib/erb_asterisk.rb
CHANGED
@@ -60,6 +60,11 @@ module ErbAsterisk
|
|
60
60
|
def render_files(root)
|
61
61
|
erbs = load_erbs(root)
|
62
62
|
|
63
|
+
if erbs.size == 0
|
64
|
+
log_debug('nothing to do')
|
65
|
+
return
|
66
|
+
end
|
67
|
+
|
63
68
|
# It does two round of rendering because of apply_line_to and yield_here.
|
64
69
|
# First round accumulates apply_line_to declarations and converts
|
65
70
|
# yield_here to yield_actual.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: erb_asterisk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Artem Baikuzin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: slop
|