cleanup 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 96e1b3e39779eed100352ac10ad5fae7fc7d46d7
4
- data.tar.gz: 43f9422236030f8dc26242ae343d61c239c7df74
3
+ metadata.gz: 417f985a5e163167d4e1b99dbea2c50b3c335082
4
+ data.tar.gz: 08f5d9f53e758eb780543ff3f61d8dc2f8a4de03
5
5
  SHA512:
6
- metadata.gz: e8a3236d25d8684633b906c6913b0fd649b3080ac5046af7ec9ab6c33a7376c79387368f5609e79c46c1d36012a60420d8d31668acaee1f45737660d70b8a733
7
- data.tar.gz: 56e64239d474557c93560e65f093603c52a4af5d32e8b6d47794a1efaec10f298144c9d3c4058c9eb0d6254b6ba265a074a327ec84d2d794d1e562652b9b76c9
6
+ metadata.gz: f09692bce128adf9dcc5c848f3e3b782a6f91cfacffa2e4a02638c18456fa678de697f85298a20a48f705b1ab9d264b444d85e2c185e1760c6eb438c75041b49
7
+ data.tar.gz: 993a70cb14bd037e390a0311e3749f53c9bb6322c1d3909e78b6093ee3d36015fa6ac9f0dfb240a8e84ac435c43fbca3e4e8acba2918cbd886a085ed404ed780
data/bin/cleanup CHANGED
@@ -10,7 +10,7 @@ OptionParser.new do |opts|
10
10
  opts.banner = "Usage: cleanup [options]"
11
11
 
12
12
  opts.on('-c', '--config [path]', 'Default: full path to rules.rb file') do |path|
13
- options[:path] = path if path
13
+ options[:path] = File.expand_path(path) if path
14
14
  end
15
15
 
16
16
  opts.on('-v', '--version') { puts "CleanUp v#{CleanUp::VERSION}"; exit(0) }
data/lib/clean_up.rb CHANGED
@@ -32,7 +32,7 @@ module CleanUp
32
32
 
33
33
  def dir_entries(folder)
34
34
  (Dir.entries(folder) - IGNORED_ENTRIES).map do |entry|
35
- File.expand_path(entry, folder)
35
+ File.absolute_path(entry, folder)
36
36
  end
37
37
  end
38
38
  end
@@ -22,7 +22,12 @@ module CleanUp
22
22
  if SUPPORTED_BLOCK_OPTIONS.include?(method.to_s)
23
23
  @options[method.to_s] = block
24
24
  elsif SUPPORTED_OPTIONS.include?(method.to_s)
25
- @options[method.to_s] = args
25
+ case method
26
+ when 'dir'
27
+ @options[method.to_s] = args.first.end_with?('/') ? args.first : "#{args.first}/"
28
+ else
29
+ @options[method.to_s] = args
30
+ end
26
31
  end
27
32
  end
28
33
  end
@@ -23,7 +23,7 @@ module CleanUp
23
23
  end
24
24
 
25
25
  def full_target_folder(target)
26
- File.join(File.expand_path(target), options['dir'])
26
+ [File.absolute_path(target), options['dir']].join(File::SEPARATOR)
27
27
  end
28
28
  end
29
29
  end
@@ -1,3 +1,3 @@
1
1
  module CleanUp
2
- VERSION = '0.1.1'.freeze
2
+ VERSION = '0.1.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cleanup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nickolai Smirnov