vsclean 1.0.6 → 1.0.8

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: 7bb9288ea01bda31811b74055e062c5d96953b47
4
- data.tar.gz: 954fa535995068dfe0ff7090edbb3d24a44fdf0b
3
+ metadata.gz: f6f98859e63b8203d447fa82be40dec03fadc7c3
4
+ data.tar.gz: eefafe2e2410e5d899fe25ceefa3b81bd7337dd8
5
5
  SHA512:
6
- metadata.gz: 2be5f767e85430ee6d6ea06b7b0d1dcb3ff22e48e693293f6c042f6f47f0cefd8b1a40925338bde1467d965e956f3d1307053287207ecea354a44e86d1093904
7
- data.tar.gz: 0339ad305c83790c4ac7e9ed48c428425f0f0c77fdc8a44d66bc0e4883cb8d11e258f697e862062797818d0391ad7acaba2c0cab856752a5c045a1097c5bb3a4
6
+ metadata.gz: f8eb24505368914e32e9d53b392a83deb9ea07510ae851bbfef65b294d31d6554f9c2f995f0cd1e870c54152c9fae9970d2f76d9cb321d19e6ebbcfb4056ef19
7
+ data.tar.gz: 9d7d9505f4b02844f2f8a8198c1e81a6bdf9ad3a4188eed32d443fb27ad977615a4ecca649281f7fe82dd3f76105d6c4de30ce0aebf264d3ff6a6d2b8958b12b
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # Specify your gem's dependencies in binclean.gemspec
3
+ # Specify your gem's dependencies in vsclean.gemspec
4
4
  gemspec
data/README.md CHANGED
@@ -8,9 +8,25 @@ A recursive delete of temporary Visual Studio and ReSharper output files, vsclea
8
8
 
9
9
  ## Usage:
10
10
 
11
+ Note: Use `--dry-run` to simulate deletion first, for more safety.
12
+
11
13
  ### Local Cleanup
12
14
 
13
15
  $ vsclean
14
16
 
15
17
  - Deletes `**/{bin,obj}`
16
18
  - Deletes `**/.vs/**/.suo`
19
+
20
+ ### Global Cleanup
21
+
22
+ $ vsclean --global
23
+
24
+ - Deletes `~/AppData/Local/JetBrains/**/SolutionCaches`
25
+ - Deletes `~/AppData/Microsoft/WebsiteCache`
26
+ - Deletes `~//AppData/Local/Microsoft/**/ComponentModelCache`
27
+
28
+ ### Full Cleanup
29
+
30
+ $ vsclean --full
31
+
32
+ - Deletes all local and global temporary files and directories
@@ -4,6 +4,12 @@ require "console"
4
4
  require "fileutils"
5
5
 
6
6
  module VsClean
7
+ class Mode
8
+ LOCAL = 0
9
+ GLOBAL = 1
10
+ FULL = 2
11
+ end
12
+
7
13
  class Command < CLAide::Command
8
14
  self.command = "vsclean"
9
15
  self.version = VsClean::VERSION
@@ -11,19 +17,29 @@ module VsClean
11
17
 
12
18
  def self.options
13
19
  [
20
+ ['[--local]', '(DEFAULT) Delete caches and temporary files in the current directory'],
14
21
  ['[--global]', 'Delete global caches and temporary files'],
22
+ ['[--full]', 'Delete local *and* global temporary files'],
15
23
  ['[--dry-run]', 'Simulate deletion (list all files and directories that would be deleted)']
16
24
  ].concat(super)
17
25
  end
18
26
 
19
27
  def initialize(argv)
20
28
  @dryrun = argv.flag?("dry-run")
21
- @global = argv.flag?("global")
29
+
30
+ @mode = Mode::LOCAL if argv.flag?("local", true)
31
+ @mode = Mode::GLOBAL if argv.flag?("global")
32
+ @mode = Mode::FULL if argv.flag?("full")
33
+
22
34
  super
23
35
  end
24
36
 
25
37
  def run
26
- paths = @global ? collect_global_paths : collect_local_paths
38
+ paths = case @mode
39
+ when Mode::LOCAL; collect_local_paths
40
+ when Mode::GLOBAL; collect_global_paths
41
+ when Mode::FULL; collect_global_paths.push(*collect_local_paths)
42
+ end
27
43
 
28
44
  if paths.none?
29
45
  Console.log_step("All good... nothing to clean!")
@@ -37,9 +53,9 @@ module VsClean
37
53
 
38
54
  def collect_global_paths
39
55
  home = File.expand_path("~")
40
- paths = Dir.glob(home + "/AppData/Local/JetBrains/**/SolutionCaches").select { |f| File.directory?(f) }
41
- paths.push(*Dir.glob(home + "/AppData/Microsoft/WebsiteCache"))
56
+ paths = Dir.glob(home + "/AppData/Microsoft/WebsiteCache")
42
57
  paths.push(*Dir.glob(home + "/AppData/Local/Microsoft/**/ComponentModelCache"))
58
+ paths.push(*Dir.glob(home + "/AppData/Local/JetBrains/**/SolutionCaches"))
43
59
  end
44
60
 
45
61
  def collect_local_paths
@@ -1,5 +1,5 @@
1
1
  module VsClean
2
2
  NAME = "vsclean"
3
- VERSION = "1.0.6"
3
+ VERSION = "1.0.8"
4
4
  DESCRIPTION = %q{A recursive delete of temporary Visual Studio and ReSharper output files, vsclean performs.}
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vsclean
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michaël Fortin