webby 0.9.3-x86-mswin32 → 0.9.4-x86-mswin32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. data/History.txt +20 -0
  2. data/{README.txt → README.rdoc} +9 -9
  3. data/Rakefile +19 -6
  4. data/examples/blog/content/css/blueprint/ie.css +26 -0
  5. data/examples/blog/content/css/blueprint/plugins/buttons/icons/cross.png +0 -0
  6. data/examples/blog/content/css/blueprint/plugins/buttons/icons/key.png +0 -0
  7. data/examples/blog/content/css/blueprint/plugins/buttons/icons/tick.png +0 -0
  8. data/examples/{website/content/css/blueprint/plugins/buttons/Readme → blog/content/css/blueprint/plugins/buttons/readme.txt} +3 -2
  9. data/examples/{website/content/css/blueprint/plugins/buttons/buttons.css → blog/content/css/blueprint/plugins/buttons/screen.css} +1 -1
  10. data/examples/blog/content/css/blueprint/plugins/fancy-type/readme.txt +14 -0
  11. data/examples/{website/content/css/blueprint/plugins/fancy-type/fancy-type.css → blog/content/css/blueprint/plugins/fancy-type/screen.css} +2 -5
  12. data/examples/blog/content/css/blueprint/plugins/link-icons/icons/doc.png +0 -0
  13. data/examples/blog/content/css/blueprint/plugins/link-icons/icons/email.png +0 -0
  14. data/examples/blog/content/css/blueprint/plugins/link-icons/icons/external.png +0 -0
  15. data/examples/blog/content/css/blueprint/plugins/link-icons/icons/feed.png +0 -0
  16. data/examples/blog/content/css/blueprint/plugins/link-icons/icons/im.png +0 -0
  17. data/examples/blog/content/css/blueprint/plugins/link-icons/icons/pdf.png +0 -0
  18. data/examples/blog/content/css/blueprint/plugins/link-icons/icons/visited.png +0 -0
  19. data/examples/blog/content/css/blueprint/plugins/link-icons/icons/xls.png +0 -0
  20. data/examples/blog/content/css/blueprint/plugins/link-icons/readme.txt +18 -0
  21. data/examples/blog/content/css/blueprint/plugins/link-icons/screen.css +40 -0
  22. data/examples/blog/content/css/blueprint/plugins/rtl/readme.txt +10 -0
  23. data/examples/blog/content/css/blueprint/plugins/rtl/screen.css +109 -0
  24. data/examples/blog/content/css/blueprint/print.css +30 -0
  25. data/examples/blog/content/css/blueprint/screen.css +251 -0
  26. data/examples/blog/content/css/blueprint/src/forms.css +49 -0
  27. data/examples/blog/content/css/blueprint/src/grid.css +212 -0
  28. data/examples/{website/content/css/blueprint/lib → blog/content/css/blueprint/src}/grid.png +0 -0
  29. data/examples/blog/content/css/blueprint/src/ie.css +59 -0
  30. data/examples/blog/content/css/blueprint/src/print.css +85 -0
  31. data/examples/{website/content/css/blueprint/lib → blog/content/css/blueprint/src}/reset.css +14 -15
  32. data/examples/blog/content/css/blueprint/src/typography.css +105 -0
  33. data/examples/blog/content/css/coderay.css +111 -0
  34. data/examples/blog/content/css/site.css +67 -0
  35. data/examples/blog/layouts/default.txt +61 -0
  36. data/examples/blog/tasks/blog.rake +5 -1
  37. data/examples/presentation/Sitefile +2 -2
  38. data/examples/tumblog/tasks/tumblog.rake +5 -1
  39. data/examples/webby/Sitefile +2 -2
  40. data/examples/webby/content/communicate/index.txt +2 -2
  41. data/examples/webby/content/index.txt +1 -1
  42. data/examples/webby/content/release-notes/rel-0-9-3/index.txt +0 -2
  43. data/examples/webby/content/release-notes/rel-0-9-4/index.txt +33 -0
  44. data/examples/webby/content/sitemap.txt +2 -2
  45. data/examples/webby/content/user-manual/index.txt +3 -3
  46. data/examples/website/content/css/blueprint/ie.css +26 -0
  47. data/examples/website/content/css/blueprint/plugins/buttons/readme.txt +32 -0
  48. data/examples/website/content/css/blueprint/plugins/buttons/screen.css +97 -0
  49. data/examples/website/content/css/blueprint/plugins/fancy-type/readme.txt +14 -0
  50. data/examples/website/content/css/blueprint/plugins/fancy-type/screen.css +71 -0
  51. data/examples/website/content/css/blueprint/plugins/link-icons/icons/doc.png +0 -0
  52. data/examples/website/content/css/blueprint/plugins/link-icons/icons/email.png +0 -0
  53. data/examples/website/content/css/blueprint/plugins/link-icons/icons/external.png +0 -0
  54. data/examples/website/content/css/blueprint/plugins/link-icons/icons/feed.png +0 -0
  55. data/examples/website/content/css/blueprint/plugins/link-icons/icons/im.png +0 -0
  56. data/examples/website/content/css/blueprint/plugins/link-icons/icons/pdf.png +0 -0
  57. data/examples/website/content/css/blueprint/plugins/link-icons/icons/visited.png +0 -0
  58. data/examples/website/content/css/blueprint/plugins/link-icons/icons/xls.png +0 -0
  59. data/examples/website/content/css/blueprint/plugins/link-icons/readme.txt +18 -0
  60. data/examples/website/content/css/blueprint/plugins/link-icons/screen.css +40 -0
  61. data/examples/website/content/css/blueprint/plugins/rtl/readme.txt +10 -0
  62. data/examples/website/content/css/blueprint/plugins/rtl/screen.css +109 -0
  63. data/examples/website/content/css/blueprint/print.css +30 -68
  64. data/examples/website/content/css/blueprint/screen.css +251 -22
  65. data/examples/website/content/css/blueprint/src/forms.css +49 -0
  66. data/examples/website/content/css/blueprint/src/grid.css +212 -0
  67. data/examples/website/content/css/blueprint/src/grid.png +0 -0
  68. data/examples/website/content/css/blueprint/src/ie.css +59 -0
  69. data/examples/website/content/css/blueprint/src/print.css +85 -0
  70. data/examples/website/content/css/blueprint/src/reset.css +38 -0
  71. data/examples/website/content/css/blueprint/src/typography.css +105 -0
  72. data/examples/website/layouts/default.txt +5 -2
  73. data/lib/webby.rb +36 -102
  74. data/lib/webby/apps/generator.rb +2 -2
  75. data/lib/webby/apps/main.rb +36 -62
  76. data/lib/webby/auto_builder.rb +3 -3
  77. data/lib/webby/builder.rb +5 -13
  78. data/lib/webby/config.rb +172 -0
  79. data/lib/webby/filters.rb +2 -0
  80. data/lib/webby/filters/haml.rb +13 -0
  81. data/lib/webby/filters/maruku.rb +16 -0
  82. data/lib/webby/filters/outline.rb +1 -1
  83. data/lib/webby/filters/sass.rb +14 -0
  84. data/lib/webby/filters/slides.rb +2 -2
  85. data/lib/webby/filters/tidy.rb +5 -0
  86. data/lib/webby/helpers/coderay_helper.rb +27 -3
  87. data/lib/webby/helpers/graphviz_helper.rb +20 -3
  88. data/lib/webby/helpers/tex_img_helper.rb +25 -5
  89. data/lib/webby/helpers/ultraviolet_helper.rb +19 -5
  90. data/lib/webby/link_validator.rb +59 -51
  91. data/lib/webby/renderer.rb +9 -6
  92. data/lib/webby/resources.rb +2 -1
  93. data/lib/webby/resources/page.rb +4 -1
  94. data/lib/webby/tasks/create.rake +1 -1
  95. data/lib/webby/tasks/validate.rake +1 -1
  96. data/spec/data/html/anchor.html +11 -0
  97. data/spec/data/html/external.html +10 -0
  98. data/spec/data/html/invalid-relative.html +10 -0
  99. data/spec/data/html/relative-anchor.html +10 -0
  100. data/spec/data/html/relative-invalid-anchor.html +10 -0
  101. data/spec/data/html/relative.html +10 -0
  102. data/spec/data/site/tasks/tumblog.rake +5 -1
  103. data/spec/spec_helper.rb +8 -1
  104. data/spec/webby/apps/generator_spec.rb +36 -3
  105. data/spec/webby/apps/main_spec.rb +2 -1
  106. data/spec/webby/filters/basepath_spec.rb +2 -2
  107. data/spec/webby/filters/maruku_spec.rb +31 -0
  108. data/spec/webby/filters/textile_spec.rb +15 -4
  109. data/spec/webby/helpers/capture_helper_spec.rb +1 -1
  110. data/spec/webby/link_validator_spec.rb +154 -0
  111. data/spec/webby/resources/db_spec.rb +24 -24
  112. data/spec/webby/resources/layout_spec.rb +1 -1
  113. data/spec/webby/resources/page_spec.rb +8 -2
  114. data/spec/webby/resources/resource_spec.rb +1 -1
  115. data/spec/webby/resources_spec.rb +1 -1
  116. data/tasks/ann.rake +1 -2
  117. data/tasks/bones.rake +0 -1
  118. data/tasks/gem.rake +48 -34
  119. data/tasks/git.rake +0 -1
  120. data/tasks/mswin32.rake +38 -0
  121. data/tasks/notes.rake +0 -1
  122. data/tasks/post_load.rake +4 -9
  123. data/tasks/rdoc.rake +4 -4
  124. data/tasks/setup.rb +50 -26
  125. data/tasks/spec.rake +1 -2
  126. data/tasks/svn.rake +47 -0
  127. data/tasks/test.rake +40 -0
  128. data/tasks/website.rake +0 -1
  129. data/tasks/zentest.rake +36 -0
  130. metadata +104 -33
  131. data/Manifest.txt +0 -228
  132. data/examples/website/content/css/blueprint/License.txt +0 -21
  133. data/examples/website/content/css/blueprint/Readme.txt +0 -100
  134. data/examples/website/content/css/blueprint/compressed/print.css +0 -76
  135. data/examples/website/content/css/blueprint/compressed/screen.css +0 -696
  136. data/examples/website/content/css/blueprint/lib/forms.css +0 -45
  137. data/examples/website/content/css/blueprint/lib/grid.css +0 -193
  138. data/examples/website/content/css/blueprint/lib/ie.css +0 -30
  139. data/examples/website/content/css/blueprint/lib/typography.css +0 -116
  140. data/examples/website/content/css/blueprint/plugins/css-classes/Readme +0 -14
  141. data/examples/website/content/css/blueprint/plugins/css-classes/css-classes.css +0 -24
  142. data/examples/website/content/css/blueprint/plugins/fancy-type/Readme +0 -22
  143. data/examples/website/content/css/blueprint/plugins/fancy-type/fancy-type-compressed.css +0 -5
  144. data/lib/webby/stelan/spawner.rb +0 -339
  145. data/tasks/manifest.rake +0 -48
@@ -1,5 +0,0 @@
1
- p + p { text-indent:2em; margin-top:-1.5em; }
2
- .alt{color:#666;font-family:"Warnock Pro","Goudy Old Style","Palatino","Book Antiqua",Georgia,serif;font-size:1.2em;line-height:80%;font-style:italic;}
3
- .dquo{margin-left:-.5em;}
4
- p.incr,.incr p{font-size:10px;line-height:1.44em;margin-bottom:1.5em;}
5
- .caps{font-variant:small-caps;letter-spacing:1px;text-transform:lowercase;font-size:1.2em;line-height:1%;font-weight:bold;}
@@ -1,339 +0,0 @@
1
- require 'rbconfig'
2
- require 'thread'
3
- require 'tempfile'
4
-
5
- # :stopdoc:
6
-
7
- # == Synopsis
8
- #
9
- # A class for spawning child processes and ensuring those children continue
10
- # running.
11
- #
12
- # == Details
13
- #
14
- # When a spawner is created it is given the command to run in a child
15
- # process. This child process has +stdin+, +stdout+, and +stderr+ redirected
16
- # to +/dev/null+ (this works even on Windows). When the child dies for any
17
- # reason, the spawner will restart a new child process in the exact same
18
- # manner as the original.
19
- #
20
- class Spawner
21
-
22
- @dev_null = test(?e, "/dev/null") ? "/dev/null" : "NUL:"
23
-
24
- c = ::Config::CONFIG
25
- ruby = File.join(c['bindir'], c['ruby_install_name']) << c['EXEEXT']
26
- @ruby = if system('%s -e exit' % ruby) then ruby
27
- elsif system('ruby -e exit') then 'ruby'
28
- else warn 'no ruby in PATH/CONFIG'
29
- end
30
-
31
- class << self
32
- attr_reader :ruby
33
- attr_reader :dev_null
34
-
35
- def finalizer( cids )
36
- pid = $$
37
- lambda do
38
- break unless pid == $$
39
- cids.kill 'TERM', :all
40
- end # lambda
41
- end # finalizer
42
- end
43
-
44
- # call-seq:
45
- # Spawner.new( command, *args, opts = {} )
46
- #
47
- # Creates a new spawner that will execute the given external _command_ in
48
- # a sub-process. The calling semantics of <code>Kernel::exec</code> are
49
- # used to execute the _command_. Any number of optional _args_ can be
50
- # passed to the _command_.
51
- #
52
- # Available options:
53
- #
54
- # :spawn => the number of child processes to spawn
55
- # :pause => wait time (in seconds) before respawning after termination
56
- # :ruby => the Ruby interpreter to use when spawning children
57
- # :env => a hash for the child process environment
58
- # :stdin => stdin child processes will read from
59
- # :stdout => stdout child processes will write to
60
- # :stderr => stderr child processes will write to
61
- #
62
- # The <code>:env</code> option is used to add environemnt variables to
63
- # child processes when they are spawned.
64
- #
65
- # *Note:* all spawned child processes will use the same stdin, stdout, and
66
- # stderr if they are given in the options. Otherwise they all default to
67
- # <code>/dev/null</code> on *NIX and <code>NUL:</code> on Windows.
68
- #
69
- def initialize( *args )
70
- config = {
71
- :ruby => self.class.ruby,
72
- :spawn => 1,
73
- :pause => 0,
74
- :stdin => self.class.dev_null,
75
- :stdout => self.class.dev_null,
76
- :stderr => self.class.dev_null
77
- }
78
- config.merge! args.pop if Hash === args.last
79
- config[:argv] = args
80
-
81
- raise ArgumentError, 'wrong number of arguments' if args.empty?
82
-
83
- @stop = true
84
- @cids = []
85
- @group = ThreadGroup.new
86
-
87
- @spawn = config.delete(:spawn)
88
- @pause = config.delete(:pause)
89
- @ruby = config.delete(:ruby)
90
-
91
- @tmp = child_program(config)
92
-
93
- class << @cids
94
- # call-seq:
95
- # sync {block}
96
- #
97
- # Executes the given block in a synchronized fashion -- i.e. only a
98
- # single thread can execute at a time. Uses Mutex under the hood.
99
- #
100
- def sync(&b)
101
- @mutex ||= Mutex.new
102
- @mutex.synchronize(&b)
103
- end
104
-
105
- # call-seq:
106
- # kill( signal, num ) => number killed
107
- # kill( signal, :all ) => number killed
108
- #
109
- # Send the _signal_ to a given _num_ of child processes or all child
110
- # processes if <code>:all</code> is given instead of a number. Returns
111
- # the number of child processes killed.
112
- #
113
- def kill( signal, arg )
114
- return if empty?
115
-
116
- ary = sync do
117
- case arg
118
- when :all; self.dup
119
- when Integer; self.slice(0,arg)
120
- else raise ArgumentError end
121
- end
122
-
123
- ary.each do |cid|
124
- begin
125
- Process.kill(signal, cid)
126
- rescue SystemCallError
127
- sync {delete cid}
128
- end
129
- end
130
- ary.length
131
- end # def kill
132
- end # class << @cids
133
-
134
- end # def initialize
135
-
136
- attr_reader :spawn
137
- attr_accessor :pause
138
-
139
- # call-seq:
140
- # spawner.spawn = num
141
- #
142
- # Set the number of child processes to spawn. If the new spawn number is
143
- # less than the current number, then spawner threads will die
144
- #
145
- def spawn=( num )
146
- num = num.abs
147
- diff, @spawn = num - @spawn, num
148
- return unless running?
149
-
150
- if diff > 0
151
- diff.times {_spawn}
152
- elsif diff < 0
153
- @cids.kill 'TERM', diff.abs
154
- end
155
- end
156
-
157
- # call-seq:
158
- # start => self
159
- #
160
- # Spawn the sub-processes.
161
- #
162
- def start
163
- return self if running?
164
- @stop = false
165
-
166
- @cleanup = Spawner.finalizer(@cids)
167
- ObjectSpace.define_finalizer(self, @cleanup)
168
-
169
- @spawn.times {_spawn}
170
- self
171
- end
172
-
173
- # call-seq:
174
- # stop( timeout = 5 ) => self
175
- #
176
- # Stop any spawned sub-processes.
177
- #
178
- def stop( timeout = 5 )
179
- return self unless running?
180
- @stop = true
181
-
182
- @cleanup.call
183
- ObjectSpace.undefine_finalizer(self)
184
-
185
- # the cleanup call sends SIGTERM to all the child processes
186
- # however, some might still be hanging around, so we are going to wait
187
- # for a timeout interval and then send a SIGKILL to any remaining child
188
- # processes
189
- nap_time = 0.05 * timeout # sleep for 5% of the timeout interval
190
- timeout = Time.now + timeout
191
-
192
- until @cids.empty?
193
- sleep nap_time
194
- unless Time.now < timeout
195
- @cids.kill 'KILL', :all
196
- @cids.clear
197
- @group.list.each {|t| t.kill}
198
- break
199
- end
200
- end
201
-
202
- self
203
- end
204
-
205
- # call-seq:
206
- # restart( timeout = 5 )
207
- #
208
- def restart( timeout = 5 )
209
- stop( timeout )
210
- start
211
- end
212
-
213
- # call-seq:
214
- # running?
215
- #
216
- # Returns +true+ if the spawner is currently running; returns +false+
217
- # otherwise.
218
- #
219
- def running?
220
- !@stop
221
- end
222
-
223
- # call-seq:
224
- # join( timeout = nil ) => spawner or nil
225
- #
226
- # The calling thread will suspend execution until all child processes have
227
- # been stopped. Does not return until all spawner threads have exited (the
228
- # child processes have been stopped) or until _timeout seconds have
229
- # passed. If the timeout expires +nil+ will be returned; otherwise the
230
- # spawner is returned.
231
- #
232
- def join( limit = nil )
233
- loop do
234
- t = @group.list.first
235
- break if t.nil?
236
- return nil unless t.join(limit)
237
- end
238
- self
239
- end
240
-
241
-
242
- private
243
-
244
- # call-seq:
245
- # _spawn => thread
246
- #
247
- # Creates a thread that will spawn the sub-process via
248
- # <code>IO::popen</code>. If the sub-process terminates, it will be
249
- # respawned until the +stop+ message is sent to this spawner.
250
- #
251
- # If an Exception is encountered during the spawning process, a message
252
- # will be printed to stderr and the thread will exit.
253
- #
254
- def _spawn
255
- t = Thread.new do
256
- catch(:die) do
257
- loop do
258
- begin
259
- io = IO.popen("#{@ruby} #{@tmp.path}", 'r')
260
- cid = io.gets.to_i
261
-
262
- @cids.sync {@cids << cid} if cid > 0
263
- Process.wait cid
264
- rescue Exception => e
265
- STDERR.puts e.inspect
266
- STDERR.puts e.backtrace.join("\n")
267
- throw :die
268
- ensure
269
- io.close rescue nil
270
- @cids.sync {
271
- @cids.delete cid
272
- throw :die unless @cids.length < @spawn
273
- }
274
- end
275
-
276
- throw :die if @stop
277
- sleep @pause
278
-
279
- end # loop
280
- end # catch(:die)
281
- end # Thread.new
282
-
283
- @group.add t
284
- t
285
- end
286
-
287
- # call-seq:
288
- # child_program( config ) => tempfile
289
- #
290
- # Creates a child Ruby program based on the given _config_ hash. The
291
- # following hash keys are used:
292
- #
293
- # :argv => command and arguments passed to <code>Kernel::exec</code>
294
- # :env => environment variables for the child process
295
- # :cwd => the current working directory to use for the child process
296
- # :stdin => stdin the child process will read from
297
- # :stdout => stdout the child process will write to
298
- # :stderr => stderr the child process will write to
299
- #
300
- def child_program( config )
301
- config = Marshal.dump(config)
302
-
303
- tmp = Tempfile.new(self.class.name.downcase)
304
- tmp.write <<-PROG
305
- begin
306
- config = Marshal.load(#{config.inspect})
307
-
308
- argv = config[:argv]
309
- env = config[:env]
310
- cwd = config[:cwd]
311
- stdin = config[:stdin]
312
- stdout = config[:stdout]
313
- stderr = config[:stderr]
314
-
315
- Dir.chdir cwd if cwd
316
- env.each {|k,v| ENV[k.to_s] = v.to_s} if env
317
- rescue Exception => e
318
- STDERR.warn e
319
- abort
320
- end
321
-
322
- STDOUT.puts Process.pid
323
- STDOUT.flush
324
-
325
- STDIN.reopen stdin
326
- STDOUT.reopen stdout
327
- STDERR.reopen stderr
328
-
329
- exec *argv
330
- PROG
331
-
332
- tmp.close
333
- tmp
334
- end
335
- end # class Spawner
336
-
337
- # :startdoc:
338
-
339
- # EOF
@@ -1,48 +0,0 @@
1
-
2
- require 'find'
3
-
4
- namespace :manifest do
5
-
6
- desc 'Verify the manifest'
7
- task :check do
8
- fn = PROJ.manifest_file + '.tmp'
9
- files = manifest_files
10
-
11
- File.open(fn, 'w') {|fp| fp.puts files}
12
- lines = %x(#{DIFF} -du #{PROJ.manifest_file} #{fn}).split("\n")
13
- if HAVE_FACETS_ANSICODE and ENV.has_key?('TERM')
14
- lines.map! do |line|
15
- case line
16
- when %r/^(-{3}|\+{3})/; nil
17
- when %r/^@/; ANSICode.blue line
18
- when %r/^\+/; ANSICode.green line
19
- when %r/^\-/; ANSICode.red line
20
- else line end
21
- end
22
- end
23
- puts lines.compact
24
- rm fn rescue nil
25
- end
26
-
27
- desc 'Create a new manifest'
28
- task :create do
29
- files = manifest_files
30
- unless test(?f, PROJ.manifest_file)
31
- files << PROJ.manifest_file
32
- files.sort!
33
- end
34
- File.open(PROJ.manifest_file, 'w') {|fp| fp.puts files}
35
- end
36
-
37
- task :assert do
38
- files = manifest_files
39
- manifest = File.read(PROJ.manifest_file).split($/)
40
- raise "ERROR: #{PROJ.manifest_file} is out of date" unless files == manifest
41
- end
42
-
43
- end # namespace :manifest
44
-
45
- desc 'Alias to manifest:check'
46
- task :manifest => 'manifest:check'
47
-
48
- # EOF