cleanser 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cleanser/version.rb +1 -1
- data/lib/cleanser.rb +8 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 968067f1fb0ff77ade2ef354c2c9251c328ca9f8
|
4
|
+
data.tar.gz: d4a15510a4bee42aa052a6e4b9a187d5709118b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bb547aeea2abd8b20a79f441e3281285a00d249083af168c4e8722b9d2a7954c1e6c772bbba63d04691704a08e1ade68070c7ba622a23e2fe04b1a9cc6c1903
|
7
|
+
data.tar.gz: 37ed521429d51591cded18d864bce682b0fdc8da9b5b680d073842b706c2b836bacaa8f42335d67dc4cb81be59f3da48cbcf659e9c3a86f6554b276dabf072b6
|
data/lib/cleanser/version.rb
CHANGED
data/lib/cleanser.rb
CHANGED
@@ -6,8 +6,9 @@ module Cleanser
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def find_polluter(files, options={})
|
9
|
-
failing = files.pop
|
9
|
+
failing = localize_file(files.pop)
|
10
10
|
expand_folders(files, failing)
|
11
|
+
files.map! { |f| localize_file(f) }
|
11
12
|
|
12
13
|
if !files.include?(failing)
|
13
14
|
abort "Files have to include the failing file"
|
@@ -73,6 +74,10 @@ module Cleanser
|
|
73
74
|
end.flatten!
|
74
75
|
end
|
75
76
|
|
77
|
+
def localize_file(file)
|
78
|
+
file.sub(/^#{Regexp.escape(Dir.pwd)}/, "")
|
79
|
+
end
|
80
|
+
|
76
81
|
def files_from_folder(folder, pattern)
|
77
82
|
nested = "{,/*/**}" # follow one symlink and direct children
|
78
83
|
Dir[File.join(folder, nested, pattern)].map{|f|f.gsub("//", "/")}
|
@@ -115,11 +120,8 @@ module Cleanser
|
|
115
120
|
command = if options[:rspec]
|
116
121
|
"bundle exec rspec #{files.join(" ")}#{addition}"
|
117
122
|
else
|
118
|
-
|
119
|
-
|
120
|
-
"-r #{f.sub(/\.rb$/, "")}"
|
121
|
-
end.join(" ")
|
122
|
-
"bundle exec ruby #{require} -e ''#{addition}"
|
123
|
+
require_list = files.map { |file| file.sub(" ", "\\ ") }.join(" ")
|
124
|
+
"bundle exec ruby -e '%w[#{require_list}].each { |f| require %{./\#{f}} }'#{addition}"
|
123
125
|
end
|
124
126
|
puts "Running: #{command}"
|
125
127
|
status = system(command)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cleanser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: michael@grosser.it
|