hobix 0.4 → 0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. data/COPYING +18 -0
  2. data/README +18 -0
  3. data/Rakefile +96 -0
  4. data/bin/hobix +7 -3
  5. data/contrib/blosxom-to-hobix.rb +253 -0
  6. data/contrib/txp-to-hobix.rb +56 -0
  7. data/contrib/webrick-all-mine.rb +20 -0
  8. data/doc/CHANGELOG +285 -0
  9. data/doc/rdoc/classes/Hobix/API.html +382 -0
  10. data/doc/rdoc/classes/Hobix/Article.html +111 -0
  11. data/doc/rdoc/classes/Hobix/BaseContent.html +692 -0
  12. data/doc/rdoc/classes/Hobix/BaseEntry.html +218 -0
  13. data/doc/rdoc/classes/Hobix/BaseFacet.html +205 -0
  14. data/doc/rdoc/classes/Hobix/BaseOutput.html +122 -0
  15. data/doc/rdoc/classes/Hobix/BasePlugin.html +201 -0
  16. data/doc/rdoc/classes/Hobix/BaseProperties/ClassMethods.html +243 -0
  17. data/doc/rdoc/classes/Hobix/BaseProperties.html +218 -0
  18. data/doc/rdoc/classes/Hobix/BasePublish.html +157 -0
  19. data/doc/rdoc/classes/Hobix/BaseStorage.html +417 -0
  20. data/doc/rdoc/classes/Hobix/BixWik/Entry.html +196 -0
  21. data/doc/rdoc/classes/Hobix/BixWik/IndexEntry.html +170 -0
  22. data/doc/rdoc/classes/Hobix/BixWik/WikiRedCloth.html +111 -0
  23. data/doc/rdoc/classes/Hobix/BixWik.html +418 -0
  24. data/doc/rdoc/classes/Hobix/BixWikPlugin.html +158 -0
  25. data/doc/rdoc/classes/Hobix/CommandLine.html +1970 -0
  26. data/doc/rdoc/classes/Hobix/Comment.html +113 -0
  27. data/doc/rdoc/classes/Hobix/Config.html +212 -0
  28. data/doc/rdoc/classes/Hobix/DataMarsh.html +667 -0
  29. data/doc/rdoc/classes/Hobix/Entry.html +178 -0
  30. data/doc/rdoc/classes/Hobix/EntryEnum.html +162 -0
  31. data/doc/rdoc/classes/Hobix/Enumerable.html +170 -0
  32. data/doc/rdoc/classes/Hobix/Facets/WikiEdit.html +180 -0
  33. data/doc/rdoc/classes/Hobix/Facets.html +111 -0
  34. data/doc/rdoc/classes/Hobix/LinkList.html +182 -0
  35. data/doc/rdoc/classes/Hobix/Out/Quick.html +412 -0
  36. data/doc/rdoc/classes/Hobix/Out.html +119 -0
  37. data/doc/rdoc/classes/Hobix/Page.html +381 -0
  38. data/doc/rdoc/classes/Hobix/Trackback.html +113 -0
  39. data/doc/rdoc/classes/Hobix/UriStr.html +198 -0
  40. data/doc/rdoc/classes/Hobix/WebApp/QueryString.html +207 -0
  41. data/doc/rdoc/classes/Hobix/WebApp/QueryValidationFailure.html +111 -0
  42. data/doc/rdoc/classes/Hobix/WebApp.html +1383 -0
  43. data/doc/rdoc/classes/Hobix/Weblog/AuthorNotFound.html +111 -0
  44. data/doc/rdoc/classes/Hobix/Weblog.html +2082 -0
  45. data/doc/rdoc/classes/Hobix.html +399 -0
  46. data/doc/rdoc/classes/Kernel.html +139 -0
  47. data/doc/rdoc/classes/Regexp.html +154 -0
  48. data/doc/rdoc/classes/YAML/Omap.html +144 -0
  49. data/doc/rdoc/classes/YAML.html +111 -0
  50. data/doc/rdoc/created.rid +1 -0
  51. data/doc/rdoc/files/COPYING.html +129 -0
  52. data/doc/rdoc/files/README.html +131 -0
  53. data/doc/rdoc/files/doc/CHANGELOG.html +101 -0
  54. data/doc/rdoc/files/lib/hobix/api_rb.html +119 -0
  55. data/doc/rdoc/files/lib/hobix/article_rb.html +126 -0
  56. data/doc/rdoc/files/lib/hobix/base_rb.html +128 -0
  57. data/doc/rdoc/files/lib/hobix/bixwik_rb.html +126 -0
  58. data/doc/rdoc/files/lib/hobix/commandline_rb.html +140 -0
  59. data/doc/rdoc/files/lib/hobix/comments_rb.html +126 -0
  60. data/doc/rdoc/files/lib/hobix/config_rb.html +125 -0
  61. data/doc/rdoc/files/lib/hobix/datamarsh_rb.html +108 -0
  62. data/doc/rdoc/files/lib/hobix/entry_rb.html +118 -0
  63. data/doc/rdoc/files/lib/hobix/linklist_rb.html +127 -0
  64. data/doc/rdoc/files/lib/hobix/publisher_rb.html +126 -0
  65. data/doc/rdoc/files/lib/hobix/trackbacks_rb.html +128 -0
  66. data/doc/rdoc/files/lib/hobix/webapp_rb.html +127 -0
  67. data/doc/rdoc/files/lib/hobix/weblog_rb.html +135 -0
  68. data/doc/rdoc/files/lib/hobix_rb.html +127 -0
  69. data/doc/rdoc/fr_class_index.html +67 -0
  70. data/doc/rdoc/fr_file_index.html +44 -0
  71. data/doc/rdoc/fr_method_index.html +307 -0
  72. data/doc/rdoc/index.html +24 -0
  73. data/doc/rdoc/rdoc-style.css +208 -0
  74. data/git_hobix_update.php +13 -0
  75. data/lib/hobix/base.rb +6 -3
  76. data/lib/hobix/bixwik.rb +12 -12
  77. data/lib/hobix/commandline.rb +18 -2
  78. data/lib/hobix/comments.rb +4 -5
  79. data/lib/hobix/entry.rb +2 -1
  80. data/lib/hobix/facets/comments.rb +31 -6
  81. data/lib/hobix/linklist.rb +6 -1
  82. data/lib/hobix/out/atom.rb +29 -20
  83. data/lib/hobix/out/quick.rb +8 -6
  84. data/lib/hobix/out/rss.rb +16 -3
  85. data/lib/hobix/plugin/akismet.rb +196 -0
  86. data/lib/hobix/plugin/calendar.rb +6 -14
  87. data/lib/hobix/plugin/recent_comments.rb +4 -2
  88. data/lib/hobix/plugin/tags.rb +1 -1
  89. data/lib/hobix/storage/filesys.rb +41 -31
  90. data/lib/hobix/trackbacks.rb +1 -2
  91. data/lib/hobix/weblog.rb +73 -40
  92. data/lib/hobix.rb +9 -2
  93. data/share/default-blog/hobix.yaml +16 -0
  94. data/share/default-blog/htdocs/site.css +174 -0
  95. data/share/default-blog/skel/entry.html.quick +0 -0
  96. data/share/default-blog/skel/index.atom.atom +0 -0
  97. data/share/default-blog/skel/index.html.quick-summary +0 -0
  98. data/share/default-blog/skel/index.xml.rss +0 -0
  99. data/share/default-blog/skel/index.yaml.okaynews +0 -0
  100. data/share/default-blog/skel/monthly.html.quick-archive +0 -0
  101. data/share/default-blog/skel/section.html.quick-archive +0 -0
  102. data/share/default-blog/skel/yearly.html.quick-archive +0 -0
  103. data/share/default-blog-modes.yaml +7 -0
  104. data/share/default-blog.apache-cgi.patch +8 -0
  105. data/share/default-blog.apache-ssi.patch +38 -0
  106. data/share/default-blog.apache2-ssi.patch +3 -0
  107. data/share/default-blog.cgi.patch +8 -0
  108. data/share/default-blog.comments.patch +5 -0
  109. data/share/default-blog.prototype.patch +766 -0
  110. data/share/default-blog.publisher.patch +5 -0
  111. data/share/default-blog.wiki.patch +29 -0
  112. data/share/publisher/css/control.css +90 -0
  113. data/share/publisher/css/form.css +238 -0
  114. data/share/publisher/css/form.import.css +72 -0
  115. data/share/publisher/css/main-menu.css +134 -0
  116. data/share/publisher/i/hobix-emblazen-1.png +0 -0
  117. data/share/publisher/i/hobix-emblazen-2.png +0 -0
  118. data/share/publisher/i/hobix-emblazen-3.png +0 -0
  119. data/share/publisher/i/hobix-emblazen-4.png +0 -0
  120. data/share/publisher/i/hobix-emblazen-5.png +0 -0
  121. data/share/publisher/i/hobix-emblazen-6.png +0 -0
  122. data/share/publisher/i/hobix-emblazen-7.png +0 -0
  123. data/share/publisher/index.erb +66 -0
  124. data/share/publisher/js/controls.js +261 -0
  125. data/share/publisher/js/dragdrop.js +476 -0
  126. data/share/publisher/js/effects.js +570 -0
  127. data/share/publisher/js/prototype.js +1011 -0
  128. metadata +196 -53
  129. checksums.yaml +0 -7
data/lib/hobix/weblog.rb CHANGED
@@ -4,7 +4,7 @@
4
4
  # Hobix command-line weblog system.
5
5
  #
6
6
  # Copyright (c) 2003-2004 why the lucky stiff
7
- # Copyright (c) 2005 MenTaLguY
7
+ # Copyright (c) 2005-2007 MenTaLguY
8
8
  #
9
9
  # Written & maintained by why the lucky stiff <why@ruby-lang.org>
10
10
  # Additional bits by MenTaLguY <mental@rydia.net>
@@ -92,9 +92,10 @@ end
92
92
  # <% if page.next %>"next":<%= page.next_link %><% end %>
93
93
  #
94
94
  class Page
95
+ attr_reader :id
95
96
  attr_accessor :link, :next, :prev, :timestamp, :updated
96
- def initialize( id )
97
- @id = id
97
+ def initialize( id, dir='.' )
98
+ @id, @dir = id, dir
98
99
  end
99
100
  def id; dirj( @dir, @id ).gsub( /^\/+/, '' ); end
100
101
  def link; dirj( @dir, @id ) + @ext; end
@@ -106,8 +107,8 @@ class Page
106
107
  end
107
108
  link
108
109
  end
109
- def add_path( dir, ext ) #:nodoc:
110
- @dir, @ext = dir, ext
110
+ def add_ext( ext ) #:nodoc:
111
+ @ext = ext
111
112
  end
112
113
  def reference_fields; [:next, :prev]; end
113
114
  def references; reference_fields.map { |f| self.send f }.compact; end
@@ -145,6 +146,9 @@ end
145
146
  # output_path:: Path to output directory.
146
147
  # lib_path:: Path to extension library directory.
147
148
  #
149
+ # git:: If true, regenerations will commit to git and push the
150
+ # site to the blahg remote.
151
+ #
148
152
  # == Regeneration
149
153
  #
150
154
  # One of the primary uses of the Weblog class is to coordinate
@@ -166,12 +170,12 @@ end
166
170
  #
167
171
  # To give you a general idea, skel_index looks something like this:
168
172
  #
169
- # def skel_index( path_storage )
173
+ # def skel_index( path_storage, section_path )
170
174
  # index_entries = path_storage.lastn( @lastn )
171
- # page = Page.new( 'index' )
175
+ # page = Page.new( 'index', section_path )
172
176
  # page.prev = index_entries.last.created.strftime( "%Y/%m/index" )
173
177
  # page.timestamp = index_entries.first.created
174
- # page.updated = path_storage.last_modified( index_entries )
178
+ # page.updated = path_storage.last_updated( index_entries )
175
179
  # yield :page => page, :entries => index_entries
176
180
  # end
177
181
  #
@@ -215,14 +219,14 @@ end
215
219
  #
216
220
  # module Hobix
217
221
  # class Weblog
218
- # def skel_sidebar( path_storage )
222
+ # def skel_sidebar( path_storage, section_path )
219
223
  # ## Load `about' and `learn' entries
220
224
  # abouts = path_storage.find( :all => true, :inpath => 'about' ).reverse
221
225
  # learns = path_storage.find( :all => true, :inpath => 'learn' ).reverse
222
226
  #
223
227
  # ## Create page data
224
- # page = Page.new( 'sidebar' )
225
- # page.updated = path_storage.last_modified( abouts + learns )
228
+ # page = Page.new( 'sidebar', section_path )
229
+ # page.updated = path_storage.last_updated( abouts + learns )
226
230
  # yield :page => page,
227
231
  # :about_entries => abouts, :learn_entries => learns
228
232
  # end
@@ -244,7 +248,7 @@ end
244
248
  #
245
249
  # We create a Page object, which dictates that the output will be saved to
246
250
  # /sidebar.ext. A modification time is discovered by passing a combined list
247
- # to +Hobix::BaseStorage#last_modified+. The +updated+ property is being
251
+ # to +Hobix::BaseStorage#last_updated+. The +updated+ property is being
248
252
  # set to the latest timestamp among the about and learn entries.
249
253
  #
250
254
  # PLEASE NOTE: The +updated+ property is very important. The regeneration
@@ -306,6 +310,8 @@ class Weblog
306
310
 
307
311
  _! 'Libraries and Plugins'
308
312
  _ :requires, :req => true, :edit_as => :omap
313
+
314
+ _ :git, :edit_as => :text
309
315
 
310
316
  attr_accessor :path
311
317
  attr_reader :hobix_yaml
@@ -360,7 +366,9 @@ class Weblog
360
366
  tag = @entry_class =~ /^[\w:]+$/ ? @entry_class.untaint : default_entry_class unless tag
361
367
 
362
368
  found_class = nil
369
+ raise @@entry_classes.inspect
363
370
  if @@entry_classes
371
+
364
372
  found_class = @@entry_classes.find do |c|
365
373
  tag == c.name.split( '::' ).last.downcase
366
374
  end
@@ -396,7 +404,7 @@ class Weblog
396
404
  # Translate paths relative to the weblahhg's URL. This is especially important
397
405
  # if a weblog isn't at the root directory for a domain.
398
406
  def expand_path( path )
399
- File.expand_path( path.gsub( /^\/+/, '' ), self.link.path.gsub( /\/*$/, '/' ) )
407
+ File.expand_path( path.gsub( /^\/+/, '' ), self.link.path.gsub( /\/*$/, '/' ) ).gsub( /^C:/, '')
400
408
  end
401
409
 
402
410
  # Load the weblog information from a YAML file and +start+ the Weblog.
@@ -427,8 +435,9 @@ class Weblog
427
435
  loop do
428
436
  try_page = paths.join( '_' ).gsub('-','_')
429
437
  if respond_to? "skel_#{ try_page }"
430
- path_storage = storage.path_storage( File.dirname( page_name ) )
431
- method( "skel_#{ try_page }" ).call( path_storage ) do |vars|
438
+ section_path = File.dirname( page_name )
439
+ path_storage = storage.path_storage( section_path )
440
+ method( "skel_#{ try_page }" ).call( path_storage, section_path ) do |vars|
432
441
  vars[:weblog] = self
433
442
  raise TypeError, "No `page' variable returned from skel_#{ try_page }." unless vars[:page]
434
443
  yield vars
@@ -509,7 +518,7 @@ class Weblog
509
518
  ## Build the output pages
510
519
  build_pages( page_name ) do |vars|
511
520
  ## Extension and Path
512
- vars[:page].add_path( File.dirname( tpl_path ), tpl_ext )
521
+ vars[:page].add_ext( tpl_ext )
513
522
  vars[:template] = path
514
523
  vars[:output] = output
515
524
  eid = ( vars[:entry] && vars[:entry].id ) || page_name
@@ -617,10 +626,14 @@ class Weblog
617
626
  txt = output.load( template, vars )
618
627
  ## A plugin perhaps needs to change the output page name
619
628
  full_out_path = File.join( output_path, vars[:page].link.split( '/' ) )
620
- File.makedirs( File.dirname( full_out_path ) )
621
- File.open( full_out_path, 'w' ) do |f|
622
- f << txt
623
- f.chmod 0664 rescue nil
629
+ saved_umask = File.umask( 0002 ) rescue nil
630
+ begin
631
+ File.makedirs( File.dirname( full_out_path ) )
632
+ File.open( full_out_path, 'w' ) do |f|
633
+ f << txt
634
+ end
635
+ ensure
636
+ File.umask( saved_umask ) rescue nil
624
637
  end
625
638
  published[vars[:page].link] = vars[:page]
626
639
  published_types << page_name
@@ -636,18 +649,30 @@ class Weblog
636
649
  p.publish( published )
637
650
  end
638
651
  end
652
+
653
+ commit_to_git if @git
654
+
639
655
  reset_output_map
640
656
  end
641
657
 
658
+ # Method to commit to the local git repo and push pure happiness to the
659
+ # remote server named blahg (which should be of webserving character and
660
+ # a pleasant demeanor).
661
+ def commit_to_git
662
+ puts `git add .`
663
+ puts `git commit -a -m "New poshts for the syhtt"`
664
+ puts `git push blahg master`
665
+ end
666
+
642
667
  # Handler for templates with `index' prefix. These templates will
643
668
  # receive entries loaded by +Hobix::BaseStorage#lastn+. Only one
644
669
  # index page is requested by this handler.
645
- def skel_index( path_storage )
670
+ def skel_index( path_storage, section_path )
646
671
  index_entries = path_storage.lastn( @lastn )
647
- page = Page.new( 'index' )
672
+ page = Page.new( 'index', section_path )
648
673
  page.prev = index_entries.last.created.strftime( "%Y/%m/index" )
649
674
  page.timestamp = index_entries.first.created
650
- page.updated = path_storage.last_modified( index_entries )
675
+ page.updated = path_storage.last_updated( index_entries )
651
676
  yield :page => page, :entries => index_entries
652
677
  end
653
678
 
@@ -655,7 +680,7 @@ class Weblog
655
680
  # receive a list of entries for each day that has at least one entry
656
681
  # created in its time period. This handler requests daily pages
657
682
  # to be output as `/%Y/%m/%d.ext'.
658
- def skel_daily( path_storage )
683
+ def skel_daily( path_storage, section_path )
659
684
  entry_range = path_storage.find
660
685
  first_time, last_time = entry_range.last.created, entry_range.first.created
661
686
  start = Time.mktime( first_time.year, first_time.month, first_time.day, 0, 0, 0 ) + 1
@@ -669,11 +694,11 @@ class Weblog
669
694
  end
670
695
  days.extend Hobix::Enumerable
671
696
  days.each_with_neighbors do |prev, curr, nextd|
672
- page = Page.new( curr[0].strftime( "%Y/%m/%d" ) )
697
+ page = Page.new( curr[0].strftime( "%Y/%m/%d" ), section_path )
673
698
  page.prev = prev[0].strftime( "%Y/%m/%d" ) if prev
674
699
  page.next = nextd[0].strftime( "%Y/%m/%d" ) if nextd
675
700
  page.timestamp = curr[0]
676
- page.updated = path_storage.last_modified( curr[1] )
701
+ page.updated = path_storage.last_updated( curr[1] )
677
702
  yield :page => page, :entries => curr[1]
678
703
  end
679
704
  end
@@ -682,16 +707,16 @@ class Weblog
682
707
  # receive a list of entries for each month that has at least one entry
683
708
  # created in its time period. This handler requests monthly pages
684
709
  # to be output as `/%Y/%m/index.ext'.
685
- def skel_monthly( path_storage )
710
+ def skel_monthly( path_storage, section_path )
686
711
  months = path_storage.get_months( path_storage.find )
687
712
  months.extend Hobix::Enumerable
688
713
  months.each_with_neighbors do |prev, curr, nextm|
689
714
  entries = path_storage.within( curr[0], curr[1] )
690
- page = Page.new( curr[0].strftime( "%Y/%m/index" ) )
715
+ page = Page.new( curr[0].strftime( "%Y/%m/index" ), section_path )
691
716
  page.prev = prev[0].strftime( "%Y/%m/index" ) if prev
692
717
  page.next = nextm[0].strftime( "%Y/%m/index" ) if nextm
693
718
  page.timestamp = curr[1]
694
- page.updated = path_storage.last_modified( entries )
719
+ page.updated = path_storage.last_updated( entries )
695
720
  yield :page => page, :entries => entries
696
721
  end
697
722
  end
@@ -700,7 +725,7 @@ class Weblog
700
725
  # receive a list of entries for each month that has at least one entry
701
726
  # created in its time period. This handler requests yearly pages
702
727
  # to be output as `/%Y/index.ext'.
703
- def skel_yearly( path_storage )
728
+ def skel_yearly( path_storage, section_path )
704
729
  entry_range = path_storage.find
705
730
  first_time, last_time = entry_range.last.created, entry_range.first.created
706
731
  years = (first_time.year..last_time.year).collect do |y|
@@ -709,11 +734,11 @@ class Weblog
709
734
  years.extend Hobix::Enumerable
710
735
  years.each_with_neighbors do |prev, curr, nextm|
711
736
  entries = path_storage.within( curr[0], curr[1] )
712
- page = Page.new( curr[0].strftime( "%Y/index" ) )
737
+ page = Page.new( curr[0].strftime( "%Y/index" ), section_path )
713
738
  page.prev = prev[0].strftime( "%Y/index" ) if prev
714
739
  page.next = nextm[0].strftime( "%Y/index" ) if nextm
715
740
  page.timestamp = curr[1]
716
- page.updated = path_storage.last_modified( entries )
741
+ page.updated = path_storage.last_updated( entries )
717
742
  yield :page => page, :entries => entries
718
743
  end
719
744
  end
@@ -721,17 +746,17 @@ class Weblog
721
746
  # Handler for templates with `entry' prefix. These templates will
722
747
  # receive one entry for each entry in the weblog. The handler requests
723
748
  # entry pages to be output as `/shortName.ext'.
724
- def skel_entry( path_storage )
749
+ def skel_entry( path_storage, section_path )
725
750
  all_entries = [path_storage.find]
726
751
  all_entries += sections_ignored.collect { |ign| path_storage.find( :all => true, :inpath => ign ) }
727
752
  all_entries.each do |entry_set|
728
753
  entry_set.extend Hobix::Enumerable
729
754
  entry_set.each_with_neighbors do |nexte, entry, prev|
730
- page = Page.new( entry.class.url_link( entry ) )
755
+ page = Page.new( entry.id )
731
756
  page.prev = prev.id if prev
732
757
  page.next = nexte.id if nexte
733
758
  page.timestamp = entry.created
734
- page.updated = path_storage.modified( entry.id )
759
+ page.updated = path_storage.updated( entry.id )
735
760
  yield :page => page, :entry => entry
736
761
  end
737
762
  end
@@ -740,7 +765,7 @@ class Weblog
740
765
  # Handler for templates with `section' prefix. These templates
741
766
  # will receive all entries below a given directory. The handler
742
767
  # requests will be output as `/section/index.ext'.
743
- def skel_section( path_storage )
768
+ def skel_section( path_storage, section_path )
744
769
  section_map = {}
745
770
  path_storage.all.each do |entry|
746
771
  dirs = entry.id.split( '/' )
@@ -752,7 +777,7 @@ class Weblog
752
777
  end
753
778
  section_map.each do |section, entries|
754
779
  page = Page.new( "/#{ section }/index" )
755
- page.updated = path_storage.last_modified( entries )
780
+ page.updated = path_storage.last_updated( entries )
756
781
  yield :page => page, :entries => entries
757
782
  end
758
783
  end
@@ -792,18 +817,26 @@ class Weblog
792
817
  # Handler for templates with `tags' prefix. These templates
793
818
  # will receive a tag with all entries tagged with it. The handler
794
819
  # requests will be output as `/tags/<tag>/index.ext'.
795
- def skel_tags( path_storage )
820
+ def skel_tags( path_storage, section_path )
796
821
  # Get a list of all known tags
797
822
  tags = path_storage.find( :all => true ).map { |e| e.tags }.flatten.uniq
798
823
 
799
824
  tags.each do |tag|
800
825
  entries = path_storage.find.find_all { |e| e.tags.member? tag }
801
- page = Page.new( File::join('tags',tag,'index' ) )
802
- page.updated = path_storage.last_modified( entries )
826
+ page = Page.new( File::join( 'tags',tag,'index' ), section_path )
827
+ page.updated = path_storage.last_updated( entries )
803
828
  yield :page => page, :entries => entries
804
829
  end
805
830
  end
806
831
 
832
+ def join_path( prefix, suffix )
833
+ case prefix
834
+ when '', '.'
835
+ suffix
836
+ else
837
+ "#{ prefix }/#{ suffix }"
838
+ end
839
+ end
807
840
 
808
841
  class AuthorNotFound < Exception; end
809
842
 
data/lib/hobix.rb CHANGED
@@ -15,6 +15,7 @@
15
15
  #++
16
16
  require 'hobix/config'
17
17
  require 'hobix/weblog'
18
+ require 'rbconfig'
18
19
 
19
20
  # = Hobix
20
21
  #
@@ -204,14 +205,20 @@ require 'hobix/weblog'
204
205
  # end
205
206
  # end
206
207
  #
208
+
207
209
  module Hobix
208
210
  ## Version used to compare installations
209
- VERSION = '0.4'
211
+ VERSION = '0.5'
210
212
  ## CVS information
211
213
  CVS_ID = "$Id$"
212
214
  CVS_REV = "$Revision$"[11..-3]
213
215
  ## Share directory contains external data files
214
- SHARE_PATH = "/usr/share/hobix/"
216
+ share_path = File.expand_path('../../share', __FILE__)
217
+ if File.exists? share_path
218
+ SHARE_PATH = share_path
219
+ else
220
+ SHARE_PATH = "#{ ::Config::CONFIG['datadir'] }/hobix/"
221
+ end
215
222
 
216
223
  ## Get a top-level constant from a string
217
224
  def self.const_find( tclass )
@@ -0,0 +1,16 @@
1
+ --- !hobix.com,2004/weblog
2
+ title: a bokononist asks
3
+ link: http://bokononist.hobix.com/
4
+ tagline: "nice, nice, very nice"
5
+ period: 00:60:00
6
+ authors: {}
7
+ linklist:
8
+ - hobix: http://hobix.com/
9
+ - del.icio.us: http://del.icio.us/
10
+ requires:
11
+ - hobix/storage/filesys
12
+ - hobix/out/quick
13
+ - hobix/out/erb
14
+ - hobix/out/rss
15
+ - hobix/out/okaynews
16
+ - hobix/out/atom
@@ -0,0 +1,174 @@
1
+ body {
2
+ font-family: georgia, serif;
3
+ margin: 20px 60px 60px 60px;
4
+ background: #F1F8FF;
5
+ }
6
+
7
+ A { color: #003366; text-decoration: underline; }
8
+ A:link { color: #003366; text-decoration: underline; }
9
+ A:visited { color: #003366; text-decoration: underline; }
10
+ A:active { color: #999999; }
11
+ A:hover { color: #999999; }
12
+
13
+ h1, h2, h3 {
14
+ margin: 0px;
15
+ padding: 0px;
16
+ }
17
+
18
+ #page {
19
+ width: 680px;
20
+ background: #F8F1FF;
21
+ border: solid 2px #333;
22
+ margin: 0 auto;
23
+ }
24
+
25
+ #page:after {
26
+ content: ".";
27
+ display: block;
28
+ height: 0;
29
+ clear: both;
30
+ visibility: hidden;
31
+ }
32
+
33
+ #banner h1 {
34
+ font-size: 32pt;
35
+ text-align: center;
36
+ }
37
+
38
+ #banner a,
39
+ #banner a:link,
40
+ #banner a:visited,
41
+ #banner a:active,
42
+ #banner a:hover {
43
+ color: #333;
44
+ text-decoration: none;
45
+ }
46
+
47
+ #sidebar {
48
+ float:right;
49
+ font-family: arial, sans-serif;
50
+ font-size: 10pt;
51
+ padding:5px 5px 20px 5px;
52
+ width:90px;
53
+ }
54
+
55
+ #blog {
56
+ border-right: dotted 1px black;
57
+ width:560px;
58
+ padding:20px 5px 20px 10px;
59
+ }
60
+
61
+ .tagline {
62
+ border-top: dotted 1px black;
63
+ border-bottom: dotted 1px black;
64
+ font-size: 11pt;
65
+ padding:3px;
66
+ text-align: center;
67
+ }
68
+
69
+ .dayHeader {
70
+ border: dotted 1px #888;
71
+ background: #FFFFF1;
72
+ color: #333;
73
+ float: left;
74
+ width: 70px;
75
+ font-size: 8pt;
76
+ font-family: arial, sans-serif;
77
+ margin-top: 4px;
78
+ padding:5px;
79
+ text-align: center;
80
+ }
81
+
82
+ .entry {
83
+ float: right;
84
+ width: 460px;
85
+ padding:0px 8px;
86
+ }
87
+
88
+ .entryTitle {
89
+ font-size: 16pt;
90
+ line-height:120%;
91
+ color: #345;
92
+ }
93
+
94
+ .entryTagline {
95
+ font-size: 9pt;
96
+ line-height:200%;
97
+ color: #345;
98
+ }
99
+
100
+ .entryContent {
101
+ font-family:arial, sans-serif;
102
+ color:#333;
103
+ font-size: 10pt;
104
+ font-weight:normal;
105
+ line-height:200%;
106
+ padding: 10px 0px;
107
+ }
108
+
109
+ .entryContent p {
110
+ padding: 0px;
111
+ margin: 0px;
112
+ }
113
+
114
+ .entryContent a,
115
+ .entryContent a:link,
116
+ .entryContent a:visited,
117
+ .entryContent a:active,
118
+ .entryContent a:hover {
119
+ font-weight: normal;
120
+ text-decoration: underline;
121
+ }
122
+
123
+ .entryFooter {
124
+ margin-left:100px;
125
+ width:430px;
126
+ color:#334455;
127
+ font-family:arial, sans-serif;
128
+ font-size:8pt;
129
+ text-align:right;
130
+ padding:3px;
131
+ padding:20px;
132
+ }
133
+
134
+ .entryFooter a,
135
+ .entryFooter a:link,
136
+ .entryFooter a:visited,
137
+ .entryFooter a:active,
138
+ .entryFooter a:hover {
139
+ font-weight: normal;
140
+ text-decoration: underline;
141
+ }
142
+
143
+ .sidebarTitle {
144
+ color: #534;
145
+ font-size: 10pt;
146
+ padding:5px 0px;
147
+ }
148
+
149
+ .sidebarBox {
150
+ font-size: 8pt;
151
+ padding-top: 6px;
152
+ }
153
+
154
+ .sidebarBox ul, #archives ul {
155
+ margin:0px;
156
+ padding:0px;
157
+ }
158
+
159
+ .sidebarBox li, #archives li {
160
+ display: block;
161
+ list-style-image: none;
162
+ list-style-type: none;
163
+ padding-bottom: 3px;
164
+ }
165
+
166
+ #archives .entryTitle {
167
+ font-weight: normal;
168
+ padding: 0px 10px 10px 10px;
169
+ }
170
+
171
+ .sidebarBox p {
172
+ margin:0px;
173
+ padding:0px;
174
+ }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,7 @@
1
+ apache1-ssi: [apache-ssi]
2
+ apache2-ssi: [apache-ssi, apache2-ssi]
3
+ apache-comments: [cgi, apache-cgi, prototype, comments]
4
+ # apache-wiki: [cgi, apache-cgi, wiki]
5
+ # apache-publisher: [cgi, apache-cgi, prototype, publisher]
6
+ apache1-all: [apache-ssi, cgi, apache-cgi, prototype, comments]
7
+ apache2-all: [apache-ssi, apache2-ssi, cgi, apache-cgi, prototype, comments]
@@ -0,0 +1,8 @@
1
+ --- !hobix.com,2004/patches/^list
2
+ htdocs/control/.htaccess: !^file-ensure |
3
+ AddHandler cgi-script .cgi
4
+ Options +FollowSymLinks +ExecCGI
5
+
6
+ RewriteEngine On
7
+ RewriteCond %{REQUEST_FILENAME} !-f
8
+ RewriteRule ^(.*)$ /control/hobix.cgi
@@ -0,0 +1,38 @@
1
+ --- !hobix.com,2004/patches/^list
2
+ hobix.yaml: !^yaml-merge
3
+ requires:
4
+ - local
5
+
6
+ lib/local.rb: !^file-create |
7
+ module Hobix
8
+ class Weblog
9
+ def skel_sidebar( path_storage, section_path )
10
+ months = path_storage.get_months( storage.find )
11
+ page = Page.new( 'sidebar' )
12
+ page.updated = Time.now
13
+ yield :page => page, :months => months
14
+ end
15
+ end
16
+ class Out::Quick
17
+ def sidebar_erb
18
+ %{<!--#include virtual="<%= weblog.expand_path( 'sidebar.html' ) %>"-->}
19
+ end
20
+ end
21
+ end
22
+
23
+ skel/sidebar.html.quick: !^file-create |
24
+ page: <+ sidebar +>
25
+ sidebar: |
26
+ <div id="sidebar">
27
+ <+ sidebar_list +>
28
+ </div>
29
+
30
+ sidebar_archive: |
31
+ <div class="sidebarBox">
32
+ <h2 class="sidebarTitle">Archive</h2>
33
+ <ul>
34
+ <% months.reverse.each do |month_start, month_end, month_id| %>
35
+ <li><a href="<%= weblog.expand_path month_id %>"><%= month_start.strftime( "%B %Y" ) %></a></li>
36
+ <% end %>
37
+ </ul>
38
+ </div>
@@ -0,0 +1,3 @@
1
+ --- !hobix.com,2004/patches/^list
2
+ htdocs/.htaccess: !^file-ensure |
3
+ AddOutputFilter INCLUDES .html
@@ -0,0 +1,8 @@
1
+ --- !hobix.com,2004/patches/^list
2
+ htdocs/control/hobix.cgi: !^file-create |
3
+ #!/usr/bin/env ruby
4
+ require 'hobix/webapp'
5
+ require 'hobix/weblog'
6
+ Hobix::WebApp() do |web|
7
+ Hobix::Weblog.load( "../../hobix.yaml" ).facet_for( web )
8
+ end
@@ -0,0 +1,5 @@
1
+ --- !hobix.com,2004/patches/^list
2
+ hobix.yaml: !^yaml-merge
3
+ requires:
4
+ - hobix/out/quick
5
+ - hobix/comments