filecount 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/filecount.rb +5 -6
  2. metadata +4 -4
data/lib/filecount.rb CHANGED
@@ -4,13 +4,12 @@ class Filecount
4
4
  @filecount = 0
5
5
  end
6
6
 
7
- def run (dir)
8
- Dir.entries(dir).each do |file|
7
+ def run (directory)
8
+ Dir.foreach(directory) do |file|
9
9
  if file != '.' && file != '..' then
10
- if File.directory?(file)
11
- fc = Filecount.new
12
- fc.run(file)
13
- @filecount += fc.filecount
10
+ f = "#{directory}/#{file}"
11
+ if File.directory?(f)
12
+ run(f)
14
13
  else
15
14
  @filecount += 1
16
15
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: filecount
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Markus Nilsson
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-27 00:00:00 +02:00
18
+ date: 2010-07-28 00:00:00 +02:00
19
19
  default_executable: filecount
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency