thematic 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/thematic/tasks/thematic.rake +18 -22
- 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: 357a9903c979c8c7a017e58f58e8f04afecbff7e
|
4
|
+
data.tar.gz: 73ad286317f94fec04f702e6286c6856f4d333c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9aca30a45eb6ca6fffdff26d9f6c6eea4c550e08de7aeb404e6833a99c212dac61d024cf9cc0696072a7125d4fc466e328f51debb06cf83eeae22039436bb654
|
7
|
+
data.tar.gz: 270296ecfa3fbf9a6a506cd45af2757dca853cf14de222606926acc0ed22fba9371619e27adc56f46ad14916ba02025af4a408eb6d330f2296ae7436e54dd553
|
@@ -13,7 +13,7 @@ namespace :thematic do
|
|
13
13
|
copy_from_path = "#{args[:filepath]}/css"
|
14
14
|
theme_subfolder = "theme"
|
15
15
|
|
16
|
-
FileUtils.remove_dir "vendor/assets/stylesheets/#{theme_subfolder}"
|
16
|
+
FileUtils.remove_dir "vendor/assets/stylesheets/#{theme_subfolder}" if File.exist?("vendor/assets/stylesheets/#{theme_subfolder}")
|
17
17
|
FileUtils.mkdir "vendor/assets/stylesheets/#{theme_subfolder}"
|
18
18
|
|
19
19
|
file_to_edit = "app/assets/stylesheets/application.css"
|
@@ -21,20 +21,17 @@ namespace :thematic do
|
|
21
21
|
|
22
22
|
tempfile = File.open("file.tmp", 'w')
|
23
23
|
f.each do |line|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
tempfile << " *= require #{filename.gsub('.css', '')}\n"
|
24
|
+
if line =~/^*= require_tree ./ #we want to insert new require statements above this line
|
25
|
+
Dir.open(copy_from_path).each do |filename|
|
26
|
+
unless File.directory?("#{copy_from_path}/#{filename}") || filename[0] == "."
|
27
|
+
copy("#{copy_from_path}/#{filename}", "vendor/assets/stylesheets/#{theme_subfolder}/")
|
28
|
+
tempfile << " *= require #{filename.gsub('.css', '')}\n"
|
29
|
+
end
|
30
|
+
end
|
32
31
|
end
|
32
|
+
tempfile << line
|
33
33
|
end
|
34
34
|
|
35
|
-
tempfile << " *= require_tree .\n"
|
36
|
-
tempfile << " *= require_self\n"
|
37
|
-
tempfile << " */\n"
|
38
35
|
FileUtils.mv("file.tmp", file_to_edit)
|
39
36
|
f.close
|
40
37
|
tempfile.close
|
@@ -44,7 +41,7 @@ namespace :thematic do
|
|
44
41
|
# it is assumed that the theme comes with a folder called 'js'
|
45
42
|
copy_from_path = "#{args[:filepath]}/js"
|
46
43
|
|
47
|
-
FileUtils.remove_dir "vendor/assets/javascripts/#{theme_subfolder}"
|
44
|
+
FileUtils.remove_dir "vendor/assets/javascripts/#{theme_subfolder}" if File.exist?("vendor/assets/javascripts/#{theme_subfolder}")
|
48
45
|
FileUtils.mkdir "vendor/assets/javascripts/#{theme_subfolder}"
|
49
46
|
|
50
47
|
file_to_edit = "app/assets/javascripts/application.js"
|
@@ -52,18 +49,17 @@ namespace :thematic do
|
|
52
49
|
|
53
50
|
tempfile = File.open("file.tmp", 'w')
|
54
51
|
f.each do |line|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
tempfile << "//= require #{filename.gsub('.js', '')}\n"
|
52
|
+
if line =~/^\/\/= require_tree ./ #we want to insert new require statements above this line
|
53
|
+
Dir.open(copy_from_path).each do |filename|
|
54
|
+
unless File.directory?("#{copy_from_path}/#{filename}") || filename[0] == "."
|
55
|
+
copy("#{copy_from_path}/#{filename}", "vendor/assets/javascripts/#{theme_subfolder}/") unless File.directory?("#{copy_from_path}/#{filename}")
|
56
|
+
tempfile << "//= require #{filename.gsub('.js', '')}\n"
|
57
|
+
end
|
58
|
+
end
|
63
59
|
end
|
60
|
+
tempfile << line
|
64
61
|
end
|
65
62
|
|
66
|
-
tempfile << "//= require_tree .\n"
|
67
63
|
FileUtils.mv("file.tmp", file_to_edit)
|
68
64
|
f.close
|
69
65
|
tempfile.close
|
data/lib/thematic/version.rb
CHANGED