wp-fire 0.0.3 → 0.0.4
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.
- data/lib/wp_fire/compiler.rb +7 -0
- data/lib/wp_fire/main_command.rb +6 -5
- metadata +1 -1
data/lib/wp_fire/compiler.rb
CHANGED
@@ -12,12 +12,19 @@ module WpFire
|
|
12
12
|
File.open File.join(build_path, basename), "w" do |f|
|
13
13
|
f.puts sass_engine.to_css
|
14
14
|
end
|
15
|
+
elsif extname.eql?".css"
|
16
|
+
FileUtils.cp filename, File.join(build_path, File.basename(filename))
|
15
17
|
elsif extname.eql?".coffee"
|
16
18
|
File.open File.join(build_path, basename), "w" do |f|
|
17
19
|
f.puts CoffeeScript.compile File.read(filename)
|
18
20
|
end
|
21
|
+
elsif extname.eql?".js"
|
22
|
+
FileUtils.cp filename, File.join(build_path, File.basename(filename))
|
19
23
|
elsif extname.eql?".php"
|
20
24
|
FileUtils.cp filename, File.join(build_path, File.basename(filename))
|
25
|
+
elsif [".jpg",".jpeg",".png",".gif",".ico"].include?(extname)
|
26
|
+
Dir.mkdir File.join(build_path, "images") unless File.directory?(File.join(build_path, "images"))
|
27
|
+
FileUtils.cp filename, File.join(build_path, "images", File.basename(filename))
|
21
28
|
end
|
22
29
|
end
|
23
30
|
|
data/lib/wp_fire/main_command.rb
CHANGED
@@ -26,9 +26,6 @@ module WpFire
|
|
26
26
|
@build_path = File.join(dir,"build")
|
27
27
|
FileUtils.rm_rf(@build_path) if File.directory?(@build_path)
|
28
28
|
Dir.mkdir @build_path
|
29
|
-
Dir[File.join(dir.split(/\\/), "*.*")].each do |f|
|
30
|
-
File.unlink f unless File.basename(f).eql? "config.rb"
|
31
|
-
end
|
32
29
|
watch_directories = [@assets_path,@templates_path,@functions_path]
|
33
30
|
WpFire::Compiler.compile_all watch_directories, @build_path
|
34
31
|
end
|
@@ -51,8 +48,12 @@ module WpFire
|
|
51
48
|
@build_path = dir
|
52
49
|
end
|
53
50
|
|
54
|
-
Dir[File.join(dir
|
55
|
-
|
51
|
+
Dir[File.join(dir,"*")].each do |f|
|
52
|
+
unless File.directory?(f)
|
53
|
+
File.unlink f unless File.basename(f).eql? "config.rb"
|
54
|
+
else
|
55
|
+
FileUtils.rm_rf(f) unless File.basename(f).eql? "source"
|
56
|
+
end
|
56
57
|
end
|
57
58
|
watch_directories = [@assets_path,@templates_path,@functions_path]
|
58
59
|
WpFire::Compiler.compile_all watch_directories, @build_path
|