From b11a247303e3516c8eb209b9a825ccdb59e24115 Mon Sep 17 00:00:00 2001 From: BOHUNG Date: Thu, 26 Mar 2020 19:29:13 +0800 Subject: [PATCH] try --- patchfile.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patchfile.gemspec b/patchfile.gemspec index f394d97..b81d74d 100644 --- a/patchfile.gemspec +++ b/patchfile.gemspec @@ -40,13 +40,13 @@ all_template.each do |folder| filename = folder+'home/header.html.erb' texts = File.read(filename) texts_html = Nokogiri::HTML.parse(texts) + puts texts if texts_html.css('.navbar-brand').length == 1 new_texts = texts.gsub(texts_html.css('.navbar-brand').to_s.gsub("%7B",'{').gsub('%7D','}'),change_text) File.open(filename,'w') do |f| f.write new_texts end elsif texts_html.css('.site-title >a').length == 1 && texts_html.css('.navbar-brand').length == 0 - puts texts new_texts = texts.gsub(texts_html.css('.site-title >a').to_s.gsub("%7B",'{').gsub('%7D','}'),change_text) File.open(filename,'w') do |f| f.write new_texts