content_for_once 0.1.3 → 0.1.4

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
  SHA1:
3
- metadata.gz: e654fe32a4b905b6f67fbb36416e894dd800498c
4
- data.tar.gz: df1110ad4ca3457bb601af0966a0f49d86c42a68
3
+ metadata.gz: 309f7bd11fee9cf63a9b9440c50744ce8da5bca8
4
+ data.tar.gz: 697ca1307a07712790596c8efbb65adc6b492195
5
5
  SHA512:
6
- metadata.gz: 76a5a8b85bb30c7aa5c0e9d361f1e15e3599a5d5e3e7d068703f262029741427e763c5a9da99b7e391ddb562f2b26b7c35bde0c192dd80bb935cfbe425647376
7
- data.tar.gz: 415925a900056d8130ca18a336f9c35bb7c0cfec7841c258066289fa36269a8e0a289e6fba6e8a81ef6dfb5cc83318f3060f6e8ff55da412c2e50124c34ae0e2
6
+ metadata.gz: f2d84f51fafbf26ccb80569861aa6316da64e2617c0a3e630cf8c09081bff58b293416e2f1ca0b09cc757cd25ff2b93da23060841b510a3f011123da9363194f
7
+ data.tar.gz: 063d7cf4a99b688eb449e0862c44ca2081dfc0891cee298d19420ec587db40be78091ab7cf9857e002303913c025dccce60c68c74d44410dbf3e6ed7a176a203
@@ -1,14 +1,14 @@
1
1
  module ContentForOnce
2
2
  module Helpers
3
3
  def content_for_once(name, &block)
4
- @contents ||= Hash.new {|h, k| h[k] = '' }
4
+ @content_for_once ||= Hash.new {|h, k| h[k] = '' }
5
5
  name = name.to_sym
6
6
 
7
- @contents[name].concat(capture(&block)) if capture(&block).present?
8
- @contents[name] = Nokogiri::HTML.fragment(@contents[name]).children.
7
+ @content_for_once[name].concat(capture(&block)) if capture(&block).present?
8
+ @content_for_once[name] = Nokogiri::HTML.fragment(@content_for_once[name]).children.
9
9
  map(&:to_s).select(&:present?).map {|e| e.gsub(/>\n/, '>') }.uniq.join("\n")
10
10
 
11
- @contents.each do |name, content|
11
+ @content_for_once.each do |name, content|
12
12
  # ref: https://github.com/rails/rails/blob/master/actionview/lib/action_view/helpers/capture_helper.rb#L149
13
13
  _content = @view_flow.get(name).presence || ''
14
14
  _content.concat(content.html_safe)
@@ -1,3 +1,3 @@
1
1
  module ContentForOnce
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: content_for_once
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryusuke Sekiguchi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-04-08 00:00:00.000000000 Z
11
+ date: 2016-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview
@@ -135,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
135
  version: '0'
136
136
  requirements: []
137
137
  rubyforge_project:
138
- rubygems_version: 2.4.5.1
138
+ rubygems_version: 2.5.1
139
139
  signing_key:
140
140
  specification_version: 4
141
141
  summary: Embed the HTML tags just only once