Changeset 198

Show
Ignore:
Timestamp:
03/26/07 19:25:59 (1 year ago)
Author:
ingy
Message:
 r3683@skinny:  ingy | 2007-03-26 19:23:03 -0700
 Get Spork working under K2.
 
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/core/Kwiki/kwiki

    r178 r198  
    5555use lib grep { -e } split /:/, $ENV{KWIKI_LIB_PATH} || 'lib'; 
    5656use Kwiki::Boot; 
    57 Kwiki::Boot->boot->kwiki->hub->command->process(@ARGV)->hub->remove_hooks; 
     57Kwiki::Boot->boot->main->hub->command->process(@ARGV)->hub->remove_hooks; 
    5858 
    5959__END__ 
  • trunk/src/core/Kwiki/lib/Kwiki/Boot/V1.pm

    r194 r198  
    11package Kwiki::Boot::V1; 
    2 use Kwiki::Boot::Base -Base; 
     2use Spoon::Boot::Base -Base; 
    33 
    44const main_class => 'Kwiki'; 
    55const config_class => 'Kwiki::Config'; 
    66const hub_class => 'Kwiki::Hub'; 
     7 
     8sub kwiki { $self->main(@_) } 
    79 
    810sub add_configs_files { 
  • trunk/src/core/Kwiki/lib/Kwiki/Boot/V2.pm

    r194 r198  
    11package Kwiki::Boot::V2; 
    2 use Kwiki::Boot::Base -Base; 
     2use Spoon::Boot::Base -Base; 
    33 
    44const main_class => 'Kwiki'; 
    55const config_class => 'Kwiki::Config'; 
    66const hub_class => 'Kwiki::Hub'; 
     7 
     8sub kwiki { $self->main(@_) } 
    79 
    810sub add_configs_files { 
  • trunk/src/core/Kwiki/lib/Kwiki/Paths/V1.pm

    r194 r198  
    11package Kwiki::Paths::V1; 
    2 use Kwiki::Paths -Base; 
     2use Spoon::Paths -Base; 
    33 
    44sub path_values_init { 
  • trunk/src/core/Kwiki/lib/Kwiki/Paths/V2.pm

    r194 r198  
    11package Kwiki::Paths::V2; 
    2 use Kwiki::Paths -Base; 
     2use Spoon::Paths -Base; 
    33 
    44field 'all_paths_cache'; 
  • trunk/src/core/Spork/lib/Spork/Config.pm

    r168 r198  
    1919sub default_classes { 
    2020    ( 
     21        command_class => 'Spork::Command', 
    2122        config_class => 'Spork::Config', 
     23        formatter_class => 'Spork::Formatter', 
     24        hooks_class => 'Spoon::Hooks', 
     25        hub_class => 'Spork::Hub', 
    2226        registry_class => 'Spork::Registry', 
    23         hub_class => 'Spork::Hub', 
    24         formatter_class => 'Spork::Formatter', 
     27        slides_class => 'Spork::Slides', 
    2528        template_class => 'Spork::Template::TT2', 
    26         command_class => 'Spork::Command', 
    27         slides_class => 'Spork::Slides', 
    28         hooks_class => 'Spoon::Hooks', 
     29 
    2930        # For Kwiki Plugins: 
     31        cache_class => 'Kwiki::Cache', 
    3032        cgi_class => 'Kwiki::CGI', 
     33        css_class => 'Kwiki::CSS', 
     34        javascript_class => 'Kwiki::Javascript', 
     35        kwiki_command_class => 'Kwiki::Command', 
    3136        pages_class => 'Kwiki::Pages', 
    3237        preferences_class => 'Kwiki::Preferences', 
    33         css_class => 'Kwiki::CSS', 
    34         javascript_class => 'Kwiki::Javascript', 
    35         cache_class => 'Kwiki::Cache', 
    36         kwiki_command_class => 'Kwiki::Command', 
    3738    ) 
    3839} 
  • trunk/src/core/Spork/spork

    r168 r198  
    1 #!/usr/bin/perl -w 
     1#!/usr/bin/env perl 
     2use 5.008003; 
    23use strict; 
    3 use warnings; 
    4 use Spork; 
    5 our $VERSION = '0.19'; 
     4our $VERSION = '0.20'; 
     5use Cwd 'cwd', 'abs_path'; 
     6use FindBin; 
     7use Config; 
    68 
    7 use lib 'lib'; 
    8 Spork->new->load_hub->command->process(@ARGV); 
     9sub find_base { 
     10    return $ENV{SPORK_BASE} if defined $ENV{SPORK_BASE}; 
     11 
     12    my $base = $FindBin::Bin; 
     13    my $bin = $0; 
     14    $bin =~ s/.*\///; 
     15    $bin = "$base/$bin"; 
     16    my $home = cwd(); 
     17    while (-l $bin) { 
     18        chdir $base; 
     19        $bin = abs_path(readlink $bin); 
     20        $base = $bin; 
     21        $base =~ s/(.*)\/.*/$1/; 
     22    } 
     23    chdir $home; 
     24    $base = abs_path("$base/../../.."); 
     25 
     26    die "*ERROR*: Can't locate Spork base repository." 
     27        unless -d "$base/lib/Spork" and -d "$base/src/core/Spork"; 
     28    $ENV{SPORK_BASE} = $base; 
     29    return $base; 
     30}  
     31 
     32BEGIN { 
     33    my @env_files = qw(spork.env); 
     34    push @env_files, "$ENV{HOME}/.sporkrc/spork.env" if defined $ENV{HOME}; 
     35    my $fh; 
     36    for (@env_files) { 
     37        if (open $fh, $_) { 
     38            do { 
     39                $ENV{$1} ||= $2 if /^(\w+)\s*=\s*['"]?(.*?)['"]?\s*$/; 
     40            } for <$fh>; 
     41            last; 
     42        } 
     43    } 
     44 
     45    if ($ENV{SPORK_TEST_CLEAN}) { 
     46        @INC = ( 
     47            $Config::Config{archlib}, 
     48            $Config::Config{privlib}, 
     49        );  
     50    } 
     51 
     52    $ENV{SPORK_LIB_PATH} ||= find_base() . "/lib"; 
     53
     54 
     55use lib grep { -e } split /:/, $ENV{SPORK_LIB_PATH} || 'lib'; 
     56use Spork::Boot; 
     57Spork::Boot->boot->main->hub->command->process(@ARGV); 
     58 
     59=comment 
     60Lastlog: 
     6112:52 < lamech> no. Spork. not Spoon. sorry. 
     6212:53 < lamech> point being Spork's makefile doesn't specify Kwiki::Cache, it  
     63          specifies Kwiki, so you have to install Kwiki::Cache separately after  
     64          guessing. 
     6513:04 < ingy> lamech: do you have spork working? 
     6613:05 < ingy> I have pulled the spork code into  
     67          http://svn.kwiki.org/kwiki/trunk/ 
     6813:06 < ingy> need to get Spork working in there 
     6913:06 < diotalevi> Oh btw, I just consulted my notes from the last time I tried  
     70          using Spork. plugin_classes can't be set in  
     71          my-presentation/config.yaml just throws errors so it has to be set at  
     72          ~/.sporkrc/config.yaml. 
     7313:07 < ingy> yeah, I need to decide whether or not I will use spork next week  
     74          in YAPC::Tokyo 
     7513:40 < diotalevi> Hey lamech, maybe you also want to see  
     76          http://perlmonks.org/?node_id=516229 about Spork. 
     77=cut 
    978 
    1079__END__ 
  • trunk/src/core/modules.mk

    r194 r198  
    1212        Spiffy \ 
    1313        Spoon \ 
     14        Spoon/Boot \ 
    1415        Spork \ 
     16        Spork/Boot \ 
    1517        Spork/Config \ 
    1618        Spork/Formatter \ 
     
    5961        Kwiki/Pages.pm \ 
    6062        Kwiki/Pane.pm \ 
    61         Kwiki/Paths.pm \ 
    6263        Kwiki/Plugin.pm \ 
    6364        Kwiki/Preferences.pm \ 
     
    8586        Spoon/Installer.pm \ 
    8687        Spoon/MetadataObject.pm \ 
     88        Spoon/Paths.pm \ 
    8789        Spoon/Plugin.pm \ 
    8890        Spoon/Registry.pm \ 
     
    9092        Spoon/Trace.pm \ 
    9193        Spoon/Utils.pm \ 
     94        Spork/Boot.pm \ 
    9295        Spork/Command.pm \ 
    9396        Spork/Config.pm \ 
    9497        Spork/Formatter.pm \ 
    9598        Spork/Hub.pm \ 
     99        Spork/Paths.pm \ 
    96100        Spork/Plugin.pm \ 
    97101        Spork/Registry.pm \ 
     
    139143        IO/All/Temp.pm \ 
    140144        Kwiki/Archive/Simple.pm \ 
    141         Kwiki/Boot/Base.pm \ 
    142145        Kwiki/Boot/V1.pm \ 
    143146        Kwiki/Boot/V2.pm \ 
     
    149152        Kwiki/Paths/V2.pm \ 
    150153        Kwiki/Theme/Basic.pm \ 
     154        Spoon/Boot/Base.pm \ 
     155        Spork/Boot/V1.pm \ 
    151156        Spork/Config/Default.pm \ 
    152157        Spork/Formatter/Autringy.pm \