GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Rubygem
Description: A lightweight and flexible website management system.
Homepage: http://webby.rubyforge.org/
Clone URL: git://github.com/TwP/webby.git
Created the 'webby-gen' command for creating new sites.
Tim Pease (author)
Mon Aug 18 08:13:42 -0700 2008
commit  2e1383d145072baca6849e729a7f21b971f16e7f
tree    da06f3bd3d71b05acd0a60f3221d4cb10987e9d0
parent  97f35cd66aed8b613940351adb8175756a1c37c1
...
41
42
43
44
 
45
46
47
...
41
42
43
 
44
45
46
47
0
@@ -41,7 +41,7 @@ Webby is not limited to producing HTML. By no means! Do you ever get tired of re
0
 
0
 == EXAMPLE:
0
 
0
- $ webby gen website my_site
0
+ $ webby-gen website my_site
0
    creating my_site
0
 
0
    $ cd my_site
...
48
49
50
51
52
53
54
...
48
49
50
 
51
52
53
0
@@ -48,7 +48,6 @@ depend_on 'directory_watcher'
0
 depend_on 'heel'
0
 depend_on 'hpricot', '= 0.6.0'
0
 depend_on 'logging'
0
-depend_on 'main'
0
 depend_on 'rake'
0
 depend_on 'rspec'
0
 
...
33
34
35
36
 
 
 
 
 
37
38
39
...
47
48
49
50
51
52
53
54
55
 
56
57
58
59
60
61
62
63
 
 
64
65
66
...
71
72
73
74
75
 
 
76
77
78
79
 
80
81
82
83
84
85
 
86
87
88
...
33
34
35
 
36
37
38
39
40
41
42
43
...
51
52
53
 
54
55
56
 
 
57
58
59
60
61
62
63
 
 
64
65
66
67
68
...
73
74
75
 
 
76
77
78
79
80
 
81
82
83
84
85
86
 
87
88
89
90
0
@@ -33,7 +33,11 @@ class Generator
0
   #
0
   def parse( args )
0
     opts = OptionParser.new
0
- opts.banner = 'Usage: webby gen [options] template site'
0
+ opts.banner = 'Usage: webby-gen [options] template site'
0
+
0
+ opts.separator ''
0
+ opts.separator 'The webby-gen command is used to generate a site from a standard template.'
0
+ opts.separator 'A new site can be created, or an existing site can be added to or updated.'
0
 
0
     opts.separator ''
0
     opts.on('-f', '--force',
0
@@ -47,20 +51,18 @@ class Generator
0
 
0
     opts.separator ''
0
     opts.on('-t', '--templates', 'list available templates') {
0
- @stdout.puts opts
0
       ary = templates.map {|t| ::File.basename(t)}
0
       ary.delete 'webby'
0
       @stdout.puts "\nAvailable Templates"
0
- @stdout.puts " #{ary.join(', ')}"
0
- @stdout.puts
0
+ @stdout.puts " #{ary.join(', ')}\n"
0
       exit
0
     }
0
 
0
     opts.separator ''
0
     opts.separator 'common options:'
0
 
0
- opts.on_tail( '-h', '--help', 'show this message' ) {@stdout.puts opts; exit}
0
- opts.on_tail( '--version', 'show version' ) do
0
+ opts.on( '-h', '--help', 'show this message' ) {@stdout.puts opts; exit}
0
+ opts.on( '--version', 'show version' ) do
0
       @stdout.puts "Webby #{::Webby::VERSION}"
0
       exit
0
     end
0
@@ -71,18 +73,18 @@ class Generator
0
 
0
     # if no site was given, see if there is a Sitefile in the current
0
     # directory
0
- if @site.nil?
0
- @site = '.' if test(?f, 'Sitefile')
0
+ if site.nil?
0
+ self.site = '.' if test(?f, 'Sitefile')
0
     end
0
 
0
     # exit if comand line args are missing
0
- if @site.nil? or tmpl.nil?
0
+ if site.nil? or tmpl.nil?
0
       @stdout.puts opts
0
       exit 1
0
     end
0
 
0
     templates.each {|t| self.template = t if t =~ %r/\/#{tmpl}$/}
0
- if @template.nil?
0
+ if template.nil?
0
       @stdout.puts opts
0
       abort "Could not find template '#{tmpl}'"
0
     end
...
18
19
20
 
21
22
23
24
25
26
...
28
29
30
 
31
32
33
34
35
36
...
18
19
20
21
22
23
 
24
25
26
...
28
29
30
31
32
33
 
34
35
36
0
@@ -18,9 +18,9 @@ Main = ::Main.create {
0
   }
0
 
0
   option('describe', 'D') {
0
+ desc 'describe the tasks (mathcing optional PATTERN)'
0
     argument :optional
0
     synopsis '--describe=[PATTERN], -D'
0
- desc 'describe the tasks (mathcing optional PATTERN)'
0
   }
0
 
0
   option('prereqs', 'P') {
0
@@ -28,9 +28,9 @@ Main = ::Main.create {
0
   }
0
 
0
   option('tasks', 'T') {
0
+ desc 'display the tasks (mathcing optional PATTERN)'
0
     argument :optional
0
     synopsis '--tasks=[PATTERN], -T'
0
- desc 'display the tasks (mathcing optional PATTERN)'
0
   }
0
 
0
   option('trace', 't') {
...
96
97
98
99
 
100
101
102
...
96
97
98
 
99
100
101
102
0
@@ -96,7 +96,7 @@ describe Webby::Apps::Generator do
0
       lambda{@generator.parse %w[website]}.
0
           should raise_error(SystemExit, 'exit')
0
       @strio.to_s.split("\n").first.
0
- should == 'Usage: webby gen [options] template site'
0
+ should == 'Usage: webby-gen [options] template site'
0
     end
0
 
0
     it "should exit if an unknown template is given" do

Comments

    No one has commented yet.