thematic 0.0.8 → 0.0.9
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 +4 -4
- data/lib/thematic/tasks/thematic.rake +26 -0
- data/lib/thematic/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cdd39110079ffa3ebcc24f6a1fc81874aafb4ab0
|
4
|
+
data.tar.gz: 907ba0fbe0d6f8b25d9b44f531c61f8e6de5b8e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0031c7a06aff545a65957fb97c32da330e3cc982d99e91c7b57553bdba6158c7cf99948842e25a4d79795509bf1c2fad84dae6a351829b172d35029f6f70ba8a
|
7
|
+
data.tar.gz: 817472e284edd1eef96647a84398c3264bc5a09832f37f04af7294170efcf25087154231e37cd54f4c1689a2ab76e25bd06d0880fe9701284db2aa504c629195
|
@@ -116,6 +116,32 @@ namespace :thematic do
|
|
116
116
|
|
117
117
|
end
|
118
118
|
|
119
|
+
if File.exist?("vendor/assets/stylesheets/#{theme_subfolder}/style.css")
|
120
|
+
puts "Configuring images mentioned inside CSS..."
|
121
|
+
FileUtils.mv("vendor/assets/stylesheets/#{theme_subfolder}/style.css", "vendor/assets/stylesheets/#{theme_subfolder}/style.css.erb")
|
122
|
+
|
123
|
+
file_to_edit = "vendor/assets/stylesheets/#{theme_subfolder}/style.css.erb"
|
124
|
+
f = File.new(file_to_edit)
|
125
|
+
tempfile = File.open("file.tmp", 'w')
|
126
|
+
|
127
|
+
f.each do |line|
|
128
|
+
if line =~/background.*url/
|
129
|
+
image_filename = /\(.*\)/.match(line)[0].delete('(').delete(')').split("/").last.delete('"')
|
130
|
+
new_snippet = "(\"<%= asset_path('#{image_filename}') %>\")"
|
131
|
+
# modified_line = line.gsub("../", "").gsub("img", "<%= asset_path('#{theme_subfolder}").gsub("\")", "')%>\")")
|
132
|
+
modified_line = line.gsub(/\(.*\)/, new_snippet)
|
133
|
+
tempfile << modified_line
|
134
|
+
else
|
135
|
+
tempfile << line
|
136
|
+
end
|
137
|
+
end
|
138
|
+
FileUtils.mv("file.tmp", file_to_edit)
|
139
|
+
f.close
|
140
|
+
tempfile.close
|
141
|
+
|
142
|
+
end
|
143
|
+
|
144
|
+
|
119
145
|
|
120
146
|
|
121
147
|
end
|
data/lib/thematic/version.rb
CHANGED