public
Rubygem
Description: Blender is like ant or make for the front-end. It aggregates and compresses CSS and/or JavaScript assets for a site into efficient, production-ready files.
Homepage: http://front-end-architect.lighthouseapp.com/projects/11475-blender/overview
Clone URL: git://github.com/front-end/front-end-blender.git
Cleaned up command line -help output.
cgriego (author)
Tue Nov 25 15:27:55 -0800 2008
commit  7adc86ce9794a2e1cb15a83d0e467dc0ba203fd7
tree    2e24c1d5e2bbb2ecc5dae71564940aa3ef9b0aaf
parent  b20270b2a6ab391d45c1f25a29d471667db3c28c
...
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
51
52
...
35
36
37
 
 
 
 
 
 
 
 
 
 
 
 
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
0
@@ -35,18 +35,22 @@ source files are the hash values as an array. Here is a sample Blendfile:
0
 == Usage
0
 
0
   Usage: blend [options]
0
-    -h, --help                       Show this message
0
-    -V, --version                    Prints Blender's version number
0
-    -g, --generate                   Generate a stub Blendfile
0
-    -f, --file FILE                  Use given Blendfile
0
-    -r, --root ROOT                  Specify the path to the web root directory
0
-    -t, --type TYPE                  Select file type to blend (css, js)
0
-    -m, --min [MINIFIER]             Select minifier to use (yui, none)
0
-    -c, --cache-buster [BUSTER]      Append cache busters to URLs in CSS, defaults to timestamps
0
-        --force                      Force blending when source files aren't newer than output files
0
-        --yui=YUIOPTS                Pass arguments to YUI Compressor
0
-    -d, --data                       EXPERIMENTAL Convert url(file.ext) to url(data:) in CSS files
0
-    -z, --gzip                       EXPERIMENTAL Also create gzip output files
0
+      -g, --generate                   Generate a stub Blendfile
0
+      -f, --file FILE                  Use specified Blendfile
0
+      -r, --root ROOT                  Specify the path to the web root directory
0
+      -t, --type TYPE                  Select file type to blend (css, js)
0
+      -m, --min [MINIFIER]             Select minifier to use (yui, none)
0
+      -c, --cache-buster [BUSTER]      Add cache busters to URLs in CSS
0
+          --force                      Don't allow output files to be skipped
0
+          --yui=YUIOPTS                Pass arguments to YUI Compressor
0
+  
0
+  Experimental:
0
+      -d, --data                       Convert url(file.ext) to url(data:) in CSS
0
+      -z, --gzip                       Additionally generate gzipped output files
0
+  
0
+  Meta:
0
+      -h, --help                       Show this message
0
+      -V, --version                    Show the version number
0
 
0
 == Examples
0
 
...
11
12
13
 
 
 
 
 
14
15
16
17
18
19
20
21
22
23
24
25
26
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
28
29
...
11
12
13
14
15
16
17
18
19
 
 
 
 
 
 
 
 
 
 
 
 
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
0
@@ -11,19 +11,28 @@ require 'front_end_architect/blender'
0
 
0
 options = {}
0
 
0
+def section(opts, title)
0
+  opts.separator ''
0
+  opts.separator title + ':'
0
+end
0
+
0
 opts = OptionParser.new do |opts|
0
-  opts.on('-h',              '--help',                                 "Show this message")                                               {    puts opts; exit 0                                     }
0
-  opts.on('-V',              '--version',                              "Show the version number")                                         {    puts "Front-End Blender v#{FrontEndArchitect::Blender::VERSION}"; exit 0 }
0
-  opts.on('-g',              '--generate',              String,        "Generate a stub Blendfile")                                       {    options[:generate]     = true                         }
0
-  opts.on('-f FILE',         '--file FILE',             String,        "Use given Blendfile")                                             {|f| options[:blendfile]    = f                            }
0
-  opts.on('-r ROOT',         '--root ROOT',             String,        "Set the path to the web root directory")                          {|r| options[:root]         = r                            }
0
-  opts.on('-t TYPE',         '--type TYPE',             [:css, :js],   "Select file type to blend (css, js)")                             {|t| options[:file_type]    = t                            }
0
-  opts.on('-m [MINIFIER]',   '--min [MINIFIER]',        [:yui, :none], "Select minifier to use (yui, none)")                              {|m| options[:min]          = m.nil? ? :none : m.to_sym    }
0
-  opts.on('-c [BUSTER]',     '--cache-buster [BUSTER]', String,        "Append cache busters to URLs in CSS, defaults to timestamps")     {|b| options[:cache_buster] = b.nil? ? :mtime : b          }
0
-  opts.on(                   '--force',                 String,        "Force blending when source files aren't newer than output files") {    options[:force]        = true                         }
0
-  opts.on(                   '--yui=YUIOPTS',           String,        "Pass arguments to YUI Compressor")                                {|o| options[:yuiopts]      = o                            }
0
-  opts.on('-d',              '--data',                  String,        "EXPERIMENTAL Convert url(file.ext) to url(data:) in CSS files")   {    options[:data]         = true                         }
0
-  opts.on('-z',              '--gzip',                  String,        "EXPERIMENTAL Also create gzip output files")                      {    options[:gzip]         = true                         }
0
+  version = "Front-End Blender v#{FrontEndArchitect::Blender::VERSION}"
0
+  
0
+  opts.on('-g',            '--generate',              String,        "Generate a stub Blendfile")                  {    options[:generate]     = true                      }
0
+  opts.on('-f FILE',       '--file FILE',             String,        "Use specified Blendfile")                    {|f| options[:blendfile]    = f                         }
0
+  opts.on('-r ROOT',       '--root ROOT',             String,        "Specify the path to the web root directory") {|r| options[:root]         = r                         }
0
+  opts.on('-t TYPE',       '--type TYPE',             [:css, :js],   "Select file type to blend (css, js)")        {|t| options[:file_type]    = t                         }
0
+  opts.on('-m [MINIFIER]', '--min [MINIFIER]',        [:yui, :none], "Select minifier to use (yui, none)")         {|m| options[:min]          = m.nil? ? :none : m.to_sym }
0
+  opts.on('-c [BUSTER]',   '--cache-buster [BUSTER]', String,        "Add cache busters to URLs in CSS")           {|b| options[:cache_buster] = b.nil? ? :mtime : b       }
0
+  opts.on(                 '--force',                 String,        "Don't allow output files to be skipped")     {    options[:force]        = true                      }
0
+  opts.on(                 '--yui=YUIOPTS',           String,        "Pass arguments to YUI Compressor")           {|o| options[:yuiopts]      = o                         }
0
+  section opts, 'Experimental'
0
+  opts.on('-d',            '--data',                  String,        "Convert url(file.ext) to url(data:) in CSS") {    options[:data]         = true                      }
0
+  opts.on('-z',            '--gzip',                  String,        "Additionally generate gzipped output files") {    options[:gzip]         = true                      }
0
+  section opts, 'Meta'
0
+  opts.on('-h',            '--help',                                 "Show this message")                          {    puts opts;    exit 0                               }
0
+  opts.on('-V',            '--version',                              "Show the version number")                    {    puts version; exit 0                               }
0
   
0
   opts.parse!(ARGV) rescue return false
0
 end

Comments