thematic 0.0.6 → 0.0.7
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 +39 -2
- 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: 9c790db151bfcafd0a53403e346b08b616cb6b59
|
4
|
+
data.tar.gz: 8fa71821036b96e0def6ffe80d2154db710770c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb74c604dbac0308f0bf60c697226ff943102dded56f1221be20b6b82a152ad19bef8884a6e55480aef126e5e7ee54e61ffdf1a1558343af2cd22e139d6ddc91
|
7
|
+
data.tar.gz: cbefa8d4e45ced70b193af8d29166349b750678a2c9b3a2e7ddef22f6ba5c02ccbadd80d96de640c9a0b5806997f8c06304d3d4a12f0af1ba58290fdd22c92e4
|
@@ -24,7 +24,7 @@ namespace :thematic do
|
|
24
24
|
files_to_copy = Dir[ File.join(copy_from_path, '**', '*') ]
|
25
25
|
|
26
26
|
files_to_copy.each do |filepath|
|
27
|
-
unless File.directory?(filepath)
|
27
|
+
unless File.directory?(filepath) || filepath.end_with?("min.css")
|
28
28
|
filename = filepath.split("/").last
|
29
29
|
copy(filepath, "vendor/assets/stylesheets/#{theme_subfolder}/")
|
30
30
|
tempfile << " *= require #{theme_subfolder}/#{filename.gsub('.css', '')}\n"
|
@@ -55,7 +55,7 @@ namespace :thematic do
|
|
55
55
|
files_to_copy = Dir[ File.join(copy_from_path, '**', '*') ]
|
56
56
|
|
57
57
|
files_to_copy.each do |filepath|
|
58
|
-
unless File.directory?(filepath)
|
58
|
+
unless File.directory?(filepath) || filepath.end_with?("min.js")
|
59
59
|
filename = filepath.split("/").last
|
60
60
|
copy(filepath, "vendor/assets/javascripts/#{theme_subfolder}/")
|
61
61
|
tempfile << "//= require #{theme_subfolder}/#{filename.gsub('.js', '')}\n"
|
@@ -81,5 +81,42 @@ namespace :thematic do
|
|
81
81
|
copy(filepath, "app/assets/images/#{theme_subfolder}/") unless File.directory?(filepath)
|
82
82
|
end
|
83
83
|
|
84
|
+
puts "Copying fonts..."
|
85
|
+
|
86
|
+
FileUtils.mkdir "app/assets/fonts" unless File.exist?("app/assets/fonts")
|
87
|
+
FileUtils.remove_dir "app/assets/fonts/#{theme_subfolder}" if File.exist?("app/assets/fonts/#{theme_subfolder}")
|
88
|
+
FileUtils.mkdir "app/assets/fonts/#{theme_subfolder}"
|
89
|
+
|
90
|
+
copy_from_path = "#{args[:filepath]}/fonts"
|
91
|
+
files_to_copy = Dir[ File.join(copy_from_path, '**', '*') ]
|
92
|
+
|
93
|
+
files_to_copy.each do |filepath|
|
94
|
+
copy(filepath, "app/assets/fonts/#{theme_subfolder}") unless File.directory?(filepath)
|
95
|
+
end
|
96
|
+
|
97
|
+
if File.exist?("vendor/assets/stylesheets/#{theme_subfolder}/font-awesome.css")
|
98
|
+
puts "Configuring FontAwesome..."
|
99
|
+
FileUtils.mv("vendor/assets/stylesheets/#{theme_subfolder}/font-awesome.css", "vendor/assets/stylesheets/#{theme_subfolder}/font-awesome.css.erb")
|
100
|
+
|
101
|
+
file_to_edit = "vendor/assets/stylesheets/#{theme_subfolder}/font-awesome.css.erb"
|
102
|
+
f = File.new(file_to_edit)
|
103
|
+
tempfile = File.open("file.tmp", 'w')
|
104
|
+
|
105
|
+
f.each do |line|
|
106
|
+
if line =~/url/
|
107
|
+
modified_line = line.gsub("../fonts", "<%= font_path('#{theme_subfolder}").gsub("?", "')%>?")
|
108
|
+
tempfile << modified_line
|
109
|
+
else
|
110
|
+
tempfile << line
|
111
|
+
end
|
112
|
+
end
|
113
|
+
FileUtils.mv("file.tmp", file_to_edit)
|
114
|
+
f.close
|
115
|
+
tempfile.close
|
116
|
+
|
117
|
+
end
|
118
|
+
|
119
|
+
|
120
|
+
|
84
121
|
end
|
85
122
|
end
|
data/lib/thematic/version.rb
CHANGED