public
Description: Life On The Edge With Merb, DataMapper & RSpec
Homepage: http://blog.new-bamboo.co.uk
Clone URL: git://github.com/deimos1986/book_mdar.git
Search Repo:
Fixed the publish textmate command.
- Quoted the path for us poor souls who use spaces in our paths :[
- Moved the basetag to right after the OPENING head tag. The base tag only 
applies to urls _below_ it in the source of the document, so the link tag 
above it wasn't being based.
- For some reason the script was expecting a merb_book.html file to be 
generated. Where I was actually getting an index.html file. So I just made 
it cat every html file in that folder. That should only ever be a single 
html file, but if there are ever multple html files in there is could be 
weird.
Mon May 12 06:37:24 -0700 2008
commit  ad5adb870e9b03fb73d1e2201cafb88432a073ab
tree    61974b255554172f33d8d4b4b19bf9f4fead1632
parent  ef1e2433de5dd318af565fcfc2319ff150771b17
...
7
8
9
10
 
11
12
13
14
15
16
17
18
 
 
 
19
20
 
 
21
22
23
...
7
8
9
 
10
11
12
13
14
15
 
 
 
16
17
18
19
 
20
21
22
23
24
0
@@ -7,17 +7,18 @@
0
   <key>command</key>
0
   <string>#!/usr/bin/env ruby
0
 
0
-contents = `head -n1 $TM_FILEPATH`
0
+contents = `head -n1 "$TM_FILEPATH"`
0
 
0
 scroll_to_here = contents.gsub(/^#/,'').strip.gsub(/\W+/,'_').downcase!
0
 
0
 base_tag = `echo "&lt;base href='tm-file://$TM_PROJECT_DIRECTORY/book/output/'/&gt;"`
0
 
0
-`cd $TM_PROJECT_DIRECTORY; rake book:publish:html`
0
-output = `cat $TM_PROJECT_DIRECTORY/book/output/merb_book.html`
0
-output.gsub! '&lt;/head&gt;' , "#{base_tag}\n&lt;/head&gt;"
0
+`cd "$TM_PROJECT_DIRECTORY"; rake book:publish:html`
0
+output = `cat "$TM_PROJECT_DIRECTORY/book/output/"*.html`
0
+output.gsub! '&lt;head&gt;' , "&lt;head&gt;\n#{base_tag}"
0
 output &lt;&lt; %(\n&lt;script&gt;window.location.hash = "#{scroll_to_here}";&lt;/script&gt;)
0
-puts output</string>
0
+puts output
0
+</string>
0
   <key>input</key>
0
   <string>none</string>
0
   <key>keyEquivalent</key>

Comments

    No one has commented yet.