Skip to content
This repository
Browse code

[November::Tags] remove use of class variables

It doesn't seem necessary, and it's not yet implemented in Rakudo.
  • Loading branch information...
commit 0d56401f5f29db0e042d5ddf925e0832511475aa 1 parent 39ea975
Carl Mäsak authored November 23, 2010

Showing 1 changed file with 12 additions and 12 deletions. Show diff stats Hide diff stats

  1. 24  lib/November/Tags.pm
24  lib/November/Tags.pm
@@ -4,9 +4,9 @@ use November::Config;
4 4
 
5 5
 class November::Tags {
6 6
     my $server_root = November::Config.new.server_root;
7  
-    my $.page_tags_path  is rw = $server_root ~ 'data/page_tags/';
8  
-    my $.tags_count_path is rw = $server_root ~ 'data/tags_count';
9  
-    my $.tags_index_path is rw = $server_root ~ 'data/tags_index';
  7
+    my $page_tags_path  = $server_root ~ 'data/page_tags/';
  8
+    my $tags_count_path = $server_root ~ 'data/tags_count';
  9
+    my $tags_index_path = $server_root ~ 'data/tags_index';
10 10
 
11 11
     method update_tags($_: Str $page, Str $new_tags) {
12 12
         my $old_tags = .read_page_tags($page).chomp;
@@ -71,39 +71,39 @@ class November::Tags {
71 71
     }
72 72
 
73 73
     method read_page_tags(Str $page) {
74  
-        my $file = $.page_tags_path ~ $page;
75  
-        return '' unless $file ~~ :e;
  74
+        my $file = $page_tags_path ~ $page;
  75
+        return '' unless $file.IO ~~ :e;
76 76
         return slurp($file);
77 77
     }
78 78
 
79 79
     method write_page_tags(Str $page, Str $tags) {
80  
-        my $file = $.page_tags_path ~ $page;
  80
+        my $file = $page_tags_path ~ $page;
81 81
         my $fh = open( $file, :w );
82 82
         $fh.say($tags);
83 83
         $fh.close;
84 84
     }
85 85
    
86 86
     method read_tags_count() {
87  
-        my $file = $.tags_count_path;
88  
-        return {} unless $file ~~ :e;
  87
+        my $file = $tags_count_path;
  88
+        return {} unless $file.IO ~~ :e;
89 89
         return eval slurp $file;
90 90
     }
91 91
 
92 92
     method write_tags_count(Hash $counts) {
93  
-        my $file = $.tags_count_path;
  93
+        my $file = $tags_count_path;
94 94
         my $fh = open( $file, :w );
95 95
         $fh.say( $counts.perl );
96 96
         $fh.close;
97 97
     }
98 98
 
99 99
     method read_tags_index() {
100  
-        my $file = $.tags_index_path;
101  
-        return {} unless $file ~~ :e;
  100
+        my $file = $tags_index_path;
  101
+        return {} unless $file.IO ~~ :e;
102 102
         return eval slurp $file;
103 103
     }
104 104
 
105 105
     method write_tags_index(Hash $index) {
106  
-        my $file = $.tags_index_path;
  106
+        my $file = $tags_index_path;
107 107
         my $fh = open( $file, :w );
108 108
         $fh.say( $index.perl );
109 109
         $fh.close;

0 notes on commit 0d56401

Please sign in to comment.
Something went wrong with that request. Please try again.