pagelime_rails 0.1.4 → 0.1.5

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.1.5
@@ -89,16 +89,16 @@ def cms_process_html_block_regions(editable_regions, xml_content)
89
89
 
90
90
  end
91
91
 
92
- def cms_process_html_block(page_path=nil, html="")
92
+ def cms_process_html_block(page_path=nil, html="",fragment=true)
93
93
 
94
94
 
95
- unless pagelime_environment_configured?
96
- puts "PAGELIME CMS PLUGIN: Environment variables not configured"
97
- return html
98
- end
95
+ unless pagelime_environment_configured?
96
+ puts "PAGELIME CMS PLUGIN: Environment variables not configured"
97
+ return html
98
+ end
99
99
 
100
- # use nokogiri to replace contents
101
- doc = Nokogiri::HTML::DocumentFragment.parse(html)
100
+ # use nokogiri to replace contents
101
+ doc = fragment ? Nokogiri::HTML::DocumentFragment.parse(html) : Nokogiri::HTML::Document.parse(html)
102
102
  editable_regions = doc.css(".cms-editable")
103
103
  shared_regions = doc.css(".cms-shared")
104
104
 
@@ -111,7 +111,7 @@ def cms_process_html_block(page_path=nil, html="")
111
111
  cms_process_html_block_regions(editable_regions, fetch_cms_xml(page_path,region_client_ids))
112
112
  cms_process_html_block_regions(shared_regions,fetch_cms_shared_xml())
113
113
 
114
- return doc.to_html
114
+ return doc.to_html
115
115
 
116
116
  end
117
117
 
@@ -129,11 +129,11 @@ module PagelimeControllerExtensions
129
129
  # response contents loaded into a variable
130
130
  input_content = response.body
131
131
  page_path = request.path
132
- html = cms_process_html_block(page_path,input_content)
132
+ html = cms_process_html_block(page_path,input_content,false)
133
133
  # output the final content
134
134
  response.body = html
135
135
  else
136
- puts "PAGELIME CMS PLUGIN: Environment variables not configured"
136
+ puts "PAGELIME CMS PLUGIN: Environment variables not configured"
137
137
  end
138
138
  end
139
139
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "pagelime_rails"
8
- s.version = "0.1.4"
8
+ s.version = "0.1.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Emil Anticevic"]
12
- s.date = "2012-09-07"
12
+ s.date = "2012-12-03"
13
13
  s.description = ""
14
14
  s.email = "eanticev@gmail.com"
15
15
  s.files = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pagelime_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-07 00:00:00.000000000 Z
12
+ date: 2012-12-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
@@ -116,7 +116,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
116
116
  version: '0'
117
117
  segments:
118
118
  - 0
119
- hash: 2458246139609495427
119
+ hash: 3071907687059448777
120
120
  required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  none: false
122
122
  requirements: