Permalink
Browse files

small tweaks, add gitignore

  • Loading branch information...
1 parent f71c8f8 commit 0154169c7d5119eb97a6ebc74bad19d19bce50ef @hotarubi committed Feb 26, 2013
Showing with 3 additions and 1 deletion.
  1. +1 −0 .gitignore
  2. +2 −1 directory_counter.rb
  3. BIN spec/.DS_Store
  4. BIN spec/fixtures/.DS_Store
View
@@ -0,0 +1 @@
+.DS_Store
View
@@ -6,7 +6,7 @@ def initialize(argv)
end
def count(path = @path)
- filter = lambda {|p| p =~ /^(.+\.)*[^\.]+$/ }
+ filter = lambda {|p| p =~ /^(.+\.)*[^\.]+$/ } # only files start not with dot
Dir.entries(path).select(&filter).each do |filename|
full_path = "#{path}/#{filename}"
count full_path if @recursive && File.directory?(full_path)
@@ -15,6 +15,7 @@ def count(path = @path)
@map
end
+ private
def accumulate(file)
extname = File.extname(file.path)[1..-1]
size = File.size file.path
View
Binary file not shown.
View
Binary file not shown.

0 comments on commit 0154169

Please sign in to comment.