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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 066fcf035bd1e6169fce11ccc0f4f414daae055a
4
- data.tar.gz: 7bed8a7437c5e9fb95115ca11277d98702c5f521
3
+ metadata.gz: cdd39110079ffa3ebcc24f6a1fc81874aafb4ab0
4
+ data.tar.gz: 907ba0fbe0d6f8b25d9b44f531c61f8e6de5b8e2
5
5
  SHA512:
6
- metadata.gz: b5ac42d459ff5db2d974227f56e0cbeb69796ea38b70a95d3cfa1c9a1783f9895b5694d326b13150dbf958b03846f5b0a67dd25adf0f8bac863d0e37c78e3072
7
- data.tar.gz: aca7106a2fa248f9fb4456ec506c4310cdfa3f9ec2d6018405ae4323fffdff23f8ff929c77b7163e829fe0fd4661fff732957b4678fd704a450233291168a85f
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
@@ -1,3 +1,3 @@
1
1
  module Thematic
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thematic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jay Wengrow