stowaway 0.0.1 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -11,8 +11,9 @@ Stowaway is a gem that searches a web project for files that aren't being used.
11
11
 
12
12
  ## Installing
13
13
 
14
- sudo gem install ecavazos-stowaway
14
+ sudo gem install stowaway
15
15
 
16
16
  ## Note
17
17
 
18
- I'll be adding support for matching on relative and absolute paths. Currently, only file names are being checked for matches. If you have two files with the same name but they reside in different directories, they will be treated as one. Comparing by path will preserve the uniqueness of the file.
18
+ I'll be adding support for matching on relative and absolute paths (Comparing by path will preserve the uniqueness of the file). Currently, only file names are being checked for matches. If you have two files with the same name but they reside in different directories, they will be treated as one. In other words, if you have multiple files with the *same name*, stowaway won't work right.
19
+
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 0
4
- :patch: 1
4
+ :patch: 4
data/bin/.stowaway.swp ADDED
Binary file
data/bin/stowaway CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'lib/stowaway/runner'
3
+ require 'stowaway/runner'
4
4
  runner = Stowaway::Runner.new(ARGV)
5
- runner.run
5
+ runner.run
@@ -7,7 +7,7 @@ module Stowaway
7
7
 
8
8
  def initialize(extensions)
9
9
  @extensions = extensions
10
- @ignore = ["^\\."]
10
+ @ignore = [/^\./]
11
11
  end
12
12
 
13
13
  def type?(file)
@@ -6,18 +6,18 @@ module Stowaway
6
6
 
7
7
  def initialize(files_to_find, ext_to_ignore = nil)
8
8
  @files_to_find = files_to_find
9
- @ignore = ext_to_ignore || ["^\\.", ".png", ".gif", ".jpg"]
9
+ @ignore = ext_to_ignore || [/^\.|\.jpg$|\.gif$|.png$/i]
10
10
  end
11
11
 
12
12
  def inspect_file(file)
13
13
  File.open(file, 'r') do |i|
14
14
  while line = i.gets
15
- remove_matches(line)
15
+ remove_match(line)
16
16
  end
17
17
  end
18
18
  end
19
19
 
20
- def remove_matches(line)
20
+ def remove_match(line)
21
21
  @files_to_find.delete_if { |file| line.include?(file.name) }
22
22
  end
23
23
 
Binary file
@@ -8,7 +8,8 @@ describe Stowaway::Sweeper do
8
8
  @f1 = Stowaway::FileObj.new('/fake/file1.jpg')
9
9
  @f2 = Stowaway::FileObj.new('/fake/file2.gif')
10
10
  @f3 = Stowaway::FileObj.new('/fake/file3.js')
11
- @files = [@f1, @f2, @f3]
11
+ @f4 = Stowaway::FileObj.new('/fake/also/file3.js')
12
+ @files = [@f1, @f2, @f3, @f4]
12
13
  @sweeper = Stowaway::Sweeper.new(@files)
13
14
  end
14
15
 
@@ -24,12 +25,12 @@ describe Stowaway::Sweeper do
24
25
 
25
26
  it "should read through the file looking for matches" do
26
27
  @sweeper.inspect_file('spec/data/testfile1.txt')
27
- @files.should == [@f3]
28
+ @files.should == [@f3, @f4]
28
29
  end
29
30
 
30
31
  it "should remove matches from the list of files to find" do
31
32
  line = 'file2.gif, file3.js'
32
- @sweeper.remove_matches line
33
+ @sweeper.remove_match line
33
34
  @files.should == [@f1]
34
35
  end
35
36
 
data/spec/runner_spec.rb CHANGED
@@ -2,7 +2,7 @@ require 'spec/spec_helper'
2
2
  require 'lib/stowaway/runner'
3
3
 
4
4
  describe Stowaway::Runner do
5
- it "should be tested" do
5
+ it "should be tested :)" do
6
6
 
7
7
  end
8
8
  end
data/stowaway.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{stowaway}
8
- s.version = "0.0.1"
8
+ s.version = "0.0.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Emilio Cavazos"]
12
- s.date = %q{2009-09-30}
12
+ s.date = %q{2009-10-02}
13
13
  s.default_executable = %q{stowaway}
14
14
  s.email = %q{ejcavazos@gmail.com}
15
15
  s.executables = ["stowaway"]
@@ -23,6 +23,7 @@ Gem::Specification.new do |s|
23
23
  "Rakefile",
24
24
  "TODO.txt",
25
25
  "VERSION.yml",
26
+ "bin/.stowaway.swp",
26
27
  "bin/stowaway",
27
28
  "lib/stowaway/file.rb",
28
29
  "lib/stowaway/fshelpyhelp.rb",
@@ -30,6 +31,7 @@ Gem::Specification.new do |s|
30
31
  "lib/stowaway/options.rb",
31
32
  "lib/stowaway/runner.rb",
32
33
  "lib/stowaway/sweeper.rb",
34
+ "pkg/stowaway-0.0.1.gem",
33
35
  "spec/data/testfile1.txt",
34
36
  "spec/data/testfile2.txt",
35
37
  "spec/lib/file_spec.rb",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stowaway
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emilio Cavazos
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-30 00:00:00 -07:00
12
+ date: 2009-10-02 00:00:00 -07:00
13
13
  default_executable: stowaway
14
14
  dependencies: []
15
15
 
@@ -28,6 +28,7 @@ files:
28
28
  - Rakefile
29
29
  - TODO.txt
30
30
  - VERSION.yml
31
+ - bin/.stowaway.swp
31
32
  - bin/stowaway
32
33
  - lib/stowaway/file.rb
33
34
  - lib/stowaway/fshelpyhelp.rb
@@ -35,6 +36,7 @@ files:
35
36
  - lib/stowaway/options.rb
36
37
  - lib/stowaway/runner.rb
37
38
  - lib/stowaway/sweeper.rb
39
+ - pkg/stowaway-0.0.1.gem
38
40
  - spec/data/testfile1.txt
39
41
  - spec/data/testfile2.txt
40
42
  - spec/lib/file_spec.rb