erb_asterisk 0.0.15 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6f0fecca0c2117fa73b3d92f12f140d8671025c9
4
- data.tar.gz: 327785c07af5c5a5e6e04c74d9c6d8729083a1b5
3
+ metadata.gz: c2d732cfc87196aae06400244c1d47ac724c2862
4
+ data.tar.gz: c36746393e7706b09231dabcce46a27b15921b57
5
5
  SHA512:
6
- metadata.gz: 136c2ebd6398372f08ad093f4e5d085cc0c3298468457eae8721ecdaff481ee35126e5cb39ff43503c703be3fcb53be45b37712af73f228da11a2b00b69567f8
7
- data.tar.gz: 373e733cee4fde8433bece09e7363c32840fe86ce43e8a21b69f2e1327eea338f40d8a6bd2b876ad96e96f2229569612bc7b3adea624bde516acf759751da4fe
6
+ metadata.gz: 61fc33aa338ac132379fe55636c994344dee234e6ad97b5efac5d27dfaca5d5bc76b3775311f9625df183c84e7cfb15e146946f6008ad0043f00212d5aa8b67b
7
+ data.tar.gz: 0da5094683f8bba27f740b8c1314c402a61737f16f3a1057d4cecc673d76d2e0cf880535cb335293ce42091a6bc0f19a40d47d12e60d31318a0c45fa653a51ac
@@ -1,5 +1,7 @@
1
1
  module ErbAsterisk
2
2
  module FileCache
3
+ private
4
+
3
5
  def file_read(file_name)
4
6
  content = @file_cache[file_name]
5
7
  if content
@@ -2,6 +2,8 @@ require 'digest'
2
2
 
3
3
  module ErbAsterisk
4
4
  module SoftWrite
5
+ private
6
+
5
7
  # Write to file only if something has changed
6
8
  def soft_write(file_name, content)
7
9
  if !File.exist?(file_name) ||
@@ -1,3 +1,3 @@
1
1
  module ErbAsterisk
2
- VERSION = '0.0.15'.freeze
2
+ VERSION = '0.0.16'.freeze
3
3
  end
@@ -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(:line, tag, line, args[:priority])
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(:block, tag, yield, args[:priority])
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(type, tag, content, priority)
36
+ def apply_to_yields(tag, content, priority)
37
37
  @yields[tag] = [] if @yields[tag].nil?
38
- @yields[tag] << { content: content, priority: priority, type: type }
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.15
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-09 00:00:00.000000000 Z
11
+ date: 2017-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: slop