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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4034b23cc70ed278b97971411d35077e0370b9ff
4
- data.tar.gz: 3405d833ad2d8966b4b78fa8e8ccb21b591debe8
3
+ metadata.gz: 968067f1fb0ff77ade2ef354c2c9251c328ca9f8
4
+ data.tar.gz: d4a15510a4bee42aa052a6e4b9a187d5709118b5
5
5
  SHA512:
6
- metadata.gz: 6fa3c33352c4ab3d5909a4bf3b434aefb70869cb215224ac3e3cd74e7a65e63845a42616ab4081084a9dcda5d76695ed556d21d72ab4d5f9b4bc6e1ed214fe5f
7
- data.tar.gz: 769d978bf8d3e1e07ebfceb50f88142edadeecb55deae154cf91d338c3cce6ae958e1aefbad1619af8fcdcabc98fb45f535c61e4b1e22f73a972964dd09bc2cf
6
+ metadata.gz: 8bb547aeea2abd8b20a79f441e3281285a00d249083af168c4e8722b9d2a7954c1e6c772bbba63d04691704a08e1ade68070c7ba622a23e2fe04b1a9cc6c1903
7
+ data.tar.gz: 37ed521429d51591cded18d864bce682b0fdc8da9b5b680d073842b706c2b836bacaa8f42335d67dc4cb81be59f3da48cbcf659e9c3a86f6554b276dabf072b6
@@ -1,3 +1,3 @@
1
1
  module Cleanser
2
- VERSION = "0.2.1"
2
+ VERSION = "0.3.0"
3
3
  end
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
- require = files.map do |f|
119
- f = "./#{f}" unless f.start_with?("/")
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.2.1
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-02-26 00:00:00.000000000 Z
11
+ date: 2015-03-04 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: michael@grosser.it