public
Clone URL: git://github.com/stevebartholomew/staticmatic.git
Configurable build tracking
Thu Jul 03 16:47:04 -0700 2008
commit  b975e2ecca14c5955ba667849cc6eba61e756dfc
tree    444112098c9aaa5c55ebe21602f3da0c15bf22a4
parent  5a4831adb4ba888eaaafa30ac30d48985f15f4de
...
23
24
25
26
 
27
28
29
...
23
24
25
 
26
27
28
29
0
@@ -23,7 +23,7 @@ module StaticMatic
0
     def initialize_config
0
       StaticMatic::Config.setup
0
       config_file = File.join(@root_dir, "config.rb")
0
-
0
+
0
       if File.exists? config_file
0
         require config_file
0
       end
...
4
5
6
7
 
 
 
8
9
 
 
10
11
12
...
56
57
58
59
 
60
61
62
...
82
83
84
85
 
86
87
88
...
4
5
6
 
7
8
9
10
 
11
12
13
14
15
...
59
60
61
 
62
63
64
65
...
85
86
87
 
88
89
90
91
0
@@ -4,9 +4,12 @@ module StaticMatic
0
     
0
     def initialize(staticmatic)
0
       @staticmatic = staticmatic
0
- determine_last_build
0
+
0
+ determine_last_build if StaticMatic::Config[:use_build_tracking]
0
+
0
       build_pages
0
- log_version
0
+
0
+ log_version if StaticMatic::Config[:use_build_tracking]
0
     end
0
     
0
     def determine_last_build
0
@@ -56,7 +59,7 @@ module StaticMatic
0
             @staticmatic.template.template_format = format
0
             build_file_path = "#{build_path_for(path)}.#{format}"
0
 
0
- if should_overwrite?(path, build_file_path)
0
+ if !StaticMatic::Config[:use_build_tracking] || (StaticMatic::Config[:use_build_tracking] && should_overwrite?(path, build_file_path))
0
               if format == "html"
0
                 output = @staticmatic.render_with_layout(base_template_name)
0
               else
0
@@ -82,7 +85,7 @@ module StaticMatic
0
     
0
     def file_changed?(src_file)
0
       template_modification_time = File.stat(src_file).mtime.strftime("%Y%m%d%H%M%S")
0
- puts "#{template_modification_time.to_i} > #{@last_build.to_i}"
0
+
0
       if template_modification_time.to_i > @last_build.to_i
0
         true
0
       else
...
6
7
8
9
 
 
10
11
12
...
6
7
8
 
9
10
11
12
13
0
@@ -6,7 +6,8 @@ module StaticMatic
0
           :host => "0.0.0.0",
0
           :port => "3000",
0
           :sass_options => {},
0
- :haml_options => {}
0
+ :haml_options => {},
0
+ :use_build_tracking => true
0
         }
0
       end
0
 
...
1
2
3
4
5
 
 
 
6
...
 
 
 
 
1
2
3
4
5
0
@@ -1,4 +1,3 @@
0
-# StaticMatic::Config.setup (
0
-# :host => "127.0.0.1",
0
-# :port => "3000"
0
-# )
0
\ No newline at end of file
0
+StaticMatic::Config.setup(
0
+ :use_build_tracking => true
0
+)
0
\ No newline at end of file
...
2
3
4
5
 
6
7
8
...
2
3
4
 
5
6
7
8
0
@@ -2,7 +2,7 @@ require File.join(File.dirname(__FILE__), "..", "lib", "staticmatic")
0
 
0
 describe StaticMatic::Builder do
0
   before(:all) do
0
- @root_dir = File.dirname(__FILE__) + "/fixtures/test"
0
+ @root_dir = File.dirname(__FILE__) + "/fixtures/builder-test"
0
     @staticmatic = StaticMatic::Base.new(@root_dir)
0
     @staticmatic.logger = mock("logger")
0
     @staticmatic.logger.should_receive(:info).at_least(:once)
...
2
3
4
5
 
6
7
8
...
2
3
4
 
5
6
7
8
0
@@ -2,7 +2,7 @@ require File.join(File.dirname(__FILE__), "..", "lib", "staticmatic")
0
 
0
 describe StaticMatic::Creator do
0
   before(:all) do
0
- @new_dir = File.dirname(__FILE__) + "/fixtures/test"
0
+ @new_dir = File.dirname(__FILE__) + "/fixtures/creator-test"
0
     StaticMatic::Creator.setup(@new_dir)
0
   end
0
   

Comments

    No one has commented yet.