Permalink
Browse files

removed Viper, added Squerl to Makefile

  • Loading branch information...
1 parent 9766314 commit 922cd160c9ecc53ad026f3cb7fd346d9a64366b3 @masak committed Sep 19, 2009
Showing with 2 additions and 47 deletions.
  1. +1 −1 Makefile.in
  2. +1 −1 deps.proto
  3. +0 −45 lib/Viper.pm
View
@@ -8,7 +8,7 @@ SOURCES=lib/Routes.pm lib/Routes/Route.pm \
lib/Web/Utils.pm \
lib/Web/Request.pm lib/Web/Response.pm \
lib/Web/Handler/HTTPDaemon.pm \
- lib/Astaire.pm lib/Viper.pm
+ lib/Astaire.pm lib/Squerl.pm
PIRS=$(SOURCES:.pm=.pir)
View
@@ -1,3 +1,3 @@
# These are the dependencies needed by Web.pm
http-daemon
-csv
+perl6-sqlite
View
@@ -1,45 +0,0 @@
-use Text::CSV;
-
-class Viper {
- has $.db;
- has %.objects;
-
- submethod BUILD(:@types!, :$db!) {
- $!db = $db;
- if $db !~~ :e {
- run("mkdir $db");
- }
- for @types -> $type {
- my $filename = $!db ~ '/' ~ $type.substr(0,-2);
- if $filename !~~ :e {
- self.create-new-db-file($type, $filename);
- %!objects{$type} = [];
- }
- else {
- %!objects{$type}
- = Text::CSV.parse-file($filename, :output($type));
- }
- }
- }
-
- submethod create-new-db-file($type, $filename) {
- my @columns = $type.^attributes>>.name>>.substr(2); # w/o sigil/twigil
- my $dbfile = open($filename, :w)
- or die $!;
- $dbfile.say: join(',', map { quote($_) }, @columns);
- }
-
- sub quote($s) { qq["$s"] }
-}
-
-class Viper::Base {
- has $.id is persisted;
- has $.name is persisted;
-
- method find(Viper $session, :$all) {
- return $session.objects{self}.list;
- }
-}
-
-multi trait_mod:<is>(AttributeDeclarand $a, :$persisted!) {
-}

0 comments on commit 922cd16

Please sign in to comment.