Changeset 1057 for lang/ruby

Show
Ignore:
Timestamp:
11/03/07 17:46:44 (6 years ago)
Author:
cho45
Message:

lang/ruby/ekfloras/plugins/paging.rb,
lang/ruby/ekfloras/site-plugins,
lang/ruby/ekfloras/site-plugins/markdown.rb,
lang/ruby/ekfloras/site-plugins/text_hatena.rb,
lang/ruby/ekfloras/ekfloras.rb,
lang/ruby/ekfloras/template.html:

フォーマッタ系プラグインを追加
そのた微修正

Location:
lang/ruby/ekfloras
Files:
3 added
3 modified

Legend:

Unmodified
Added
Removed
  • lang/ruby/ekfloras/ekfloras.rb

    r1056 r1057  
    140140 
    141141        def list_entries 
    142                 Pathname.glob(@data + "**/*#{@opts[:data_ext]}").map {|f| 
     142                Pathname.glob((@data + "**/*#{@opts[:data_ext]}").to_s).map {|f| 
    143143                        content = f.readlines 
    144144                        name = f.relative_path_from(@opts[:data_dir]) 
     
    196196 
    197197if $stdout.tty? 
    198         Ekfloras.new(OpenStruct.new({ 
     198        o = OpenStruct.new({ 
    199199                #:path_info => "/test/index.html" 
    200200                #:path_info => "/2007/" 
    201201                #:path_info => "/test01" 
    202202                #:path_info => "/intro.html" 
    203                 :path_info => "/index" 
    204         })).run 
     203                :path_info => "/index", 
     204                :request_method => "GET", 
     205                :script_name => "/ekfloras.cgi", 
     206                :server_name => "example.com", 
     207        }) 
     208        def o.[](key) 
     209                "" 
     210        end 
     211 
     212        stdout = STDOUT.dup 
     213        files  = Ekfloras.new(o).list_entries.length 
     214        STDERR.reopen("/dev/null") 
     215        5.times { 
     216                STDOUT.reopen("/dev/null") 
     217                t = Time.now 
     218                Ekfloras.new(o).run 
     219                a = Time.now - t 
     220                STDOUT.reopen(stdout) 
     221                puts "%d files, %s sec" % [ 
     222                        files, 
     223                        a 
     224                ] 
     225        } 
     226 
    205227else 
    206228        begin 
  • lang/ruby/ekfloras/plugins/paging.rb

    r1053 r1057  
    55 
    66        @@entry_per_page = 7 
     7 
     8        def priority 
     9                50 
     10        end 
    711 
    812        def filter(entries) 
  • lang/ruby/ekfloras/template.html

    r1054 r1057  
    9494 
    9595                        pre { 
     96                                overflow: auto; 
    9697                                font-size: 90%; 
    9798                                padding: 1em;