File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -3,10 +3,11 @@ class AppStatistics
3
3
attr_reader :statistics , :total , :test
4
4
5
5
def initialize ( directory )
6
+ @directories = [ ]
6
7
@test = false
7
- @directory = directory
8
- @statistics = calculate_statistics
9
- @total = calculate_total
8
+ @directory = directory
9
+ @statistics = calculate_statistics
10
+ @total = calculate_total
10
11
end
11
12
12
13
def key_concepts
@@ -28,15 +29,15 @@ def calculate_statistics
28
29
end
29
30
30
31
def directories
31
- return @directories if @directories
32
- out = [ ]
32
+ return @directories if @directories . any?
33
+
33
34
Dir . foreach ( @directory ) do |file_name |
34
35
path = File . join ( @directory , file_name )
35
36
next unless File . directory? ( path )
36
37
next if ( /^\. / =~ file_name )
37
38
next if file_name == "assets" # doing separately
38
39
next if file_name == "views" # TODO
39
- out << path
40
+ @directories << path
40
41
end
41
42
42
43
assets = File . join ( @directory , "assets" )
@@ -48,13 +49,13 @@ def directories
48
49
49
50
case file_name
50
51
when "javascripts"
51
- out << path
52
+ @directories << path
52
53
# TODO when "css"
53
54
end
54
55
end
55
56
end
56
57
57
- out
58
+ @directories
58
59
end
59
60
end
60
61
You can’t perform that action at this time.
0 commit comments