thematic 0.0.10 → 0.0.11
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 +36 -14
- 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: 3a8079f296b332e918e651b00e4066bbb784d06e
|
4
|
+
data.tar.gz: caa8b09467e0d88aaa0672f581147f30a97df1cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7111d5459c96795b8f31e4294f9d6537b7d63688e3c57725b7ae2389574067cb1ebff39001665fe2edcaec55120b7b453ee05c0162631d4bafeebd03c5bfffeb
|
7
|
+
data.tar.gz: dd8523feb954a45a7997ccec0b4c03c83b4df355347dc8253079856d823efa4d62439175bef2a4987ab72b4ffc2ddd0a3a296bfcb1c5955d9836b852281a0c6f
|
@@ -21,17 +21,15 @@ namespace :thematic do
|
|
21
21
|
tempfile = File.open("file.tmp", 'w')
|
22
22
|
f.each do |line|
|
23
23
|
if line =~/^*= require_tree ./ #we want to insert new require statements above this line
|
24
|
-
files_to_copy = Dir[ File.join(copy_from_path, '**', '
|
24
|
+
files_to_copy = Dir[ File.join(copy_from_path, '**', '*.css') ]
|
25
25
|
|
26
26
|
#filter out minified versions of libraries that also have a non-minified version
|
27
27
|
files_to_copy.reject! { |filename| filename.index(".min") && files_to_copy.include?(filename.gsub(".min", "")) }
|
28
28
|
|
29
29
|
files_to_copy.each do |filepath|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
tempfile << " *= require #{theme_subfolder}/#{filename.gsub('.css', '')}\n"
|
34
|
-
end
|
30
|
+
filename = filepath.split("/").last
|
31
|
+
copy(filepath, "vendor/assets/stylesheets/#{theme_subfolder}/")
|
32
|
+
tempfile << " *= require #{theme_subfolder}/#{filename.gsub('.css', '')}\n"
|
35
33
|
end
|
36
34
|
|
37
35
|
end
|
@@ -55,17 +53,15 @@ namespace :thematic do
|
|
55
53
|
tempfile = File.open("file.tmp", 'w')
|
56
54
|
f.each do |line|
|
57
55
|
if line =~/^\/\/= require_tree ./ #we want to insert new require statements above
|
58
|
-
files_to_copy = Dir[ File.join(copy_from_path, '**', '
|
56
|
+
files_to_copy = Dir[ File.join(copy_from_path, '**', '*.js') ]
|
59
57
|
|
60
58
|
#filter out minified versions of libraries that also have a non-minified version
|
61
59
|
files_to_copy.reject! { |filename| filename.index(".min") && files_to_copy.include?(filename.gsub(".min", "")) }
|
62
60
|
|
63
61
|
files_to_copy.each do |filepath|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
tempfile << "//= require #{theme_subfolder}/#{filename.gsub('.js', '')}\n"
|
68
|
-
end
|
62
|
+
filename = filepath.split("/").last
|
63
|
+
copy(filepath, "vendor/assets/javascripts/#{theme_subfolder}/")
|
64
|
+
tempfile << "//= require #{theme_subfolder}/#{filename.gsub('.js', '')}\n"
|
69
65
|
end
|
70
66
|
end
|
71
67
|
tempfile << line
|
@@ -123,7 +119,7 @@ namespace :thematic do
|
|
123
119
|
end
|
124
120
|
|
125
121
|
if File.exist?("vendor/assets/stylesheets/#{theme_subfolder}/style.css")
|
126
|
-
puts "Configuring images
|
122
|
+
puts "Configuring images referenced in CSS..."
|
127
123
|
FileUtils.mv("vendor/assets/stylesheets/#{theme_subfolder}/style.css", "vendor/assets/stylesheets/#{theme_subfolder}/style.css.erb")
|
128
124
|
|
129
125
|
file_to_edit = "vendor/assets/stylesheets/#{theme_subfolder}/style.css.erb"
|
@@ -145,9 +141,35 @@ namespace :thematic do
|
|
145
141
|
tempfile.close
|
146
142
|
|
147
143
|
end
|
144
|
+
end
|
148
145
|
|
146
|
+
task :plugin, [:filepath] do |task, args|
|
147
|
+
copy_from_path = args[:filepath]
|
148
|
+
theme_subfolder = "theme"
|
149
149
|
|
150
|
+
file_to_edit = "app/assets/javascripts/application.js"
|
151
|
+
f = File.new(file_to_edit)
|
150
152
|
|
153
|
+
tempfile = File.open("file.tmp", 'w')
|
154
|
+
f.each do |line|
|
155
|
+
if line =~/^\/\/= require_tree ./ #we want to insert new require statements above
|
156
|
+
files_to_copy = Dir[ File.join(copy_from_path, '*.js') ]
|
157
|
+
|
158
|
+
#filter out minified versions of libraries that also have a non-minified version
|
159
|
+
files_to_copy.reject! { |filename| filename.index(".min") && files_to_copy.include?(filename.gsub(".min", "")) }
|
160
|
+
|
161
|
+
files_to_copy.each do |filepath|
|
162
|
+
filename = filepath.split("/").last
|
163
|
+
copy(filepath, "vendor/assets/javascripts/#{theme_subfolder}/")
|
164
|
+
tempfile << "//= require #{theme_subfolder}/#{filename.gsub('.js', '')}\n"
|
165
|
+
end
|
166
|
+
end
|
167
|
+
tempfile << line
|
168
|
+
end
|
169
|
+
|
170
|
+
FileUtils.mv("file.tmp", file_to_edit)
|
171
|
+
f.close
|
172
|
+
tempfile.close
|
173
|
+
end
|
151
174
|
|
152
|
-
end
|
153
175
|
end
|
data/lib/thematic/version.rb
CHANGED