dcm 0.1.12 → 0.1.14

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
  SHA256:
3
- metadata.gz: 11e9d24e733e62e42b866c0fb8962ec3111228f273bf4864f15878e42dfdb90f
4
- data.tar.gz: 243c17924c3e8486b33dc48c667e478d29615d079207069064e3263d53844aa5
3
+ metadata.gz: a2f35533dd709a691905434997a33700a7b253df40a6a81f92fe005d3be7bfbc
4
+ data.tar.gz: 3e283425bc98f028523089aab15b54c7156c9ab92b434101cf7a4eb37b0632b2
5
5
  SHA512:
6
- metadata.gz: 3bbf6481b825392ad56a76e03f2d32580d4c55cfa35076179eaa6b43b946b3499fdac08351549ad846420ce919b0aaf03225f63ba3f98f1f4fddd6b895031a78
7
- data.tar.gz: 4f7b4fb2e361eaedd33c0ab0f559fa654d31147238bd6f3f7d2904031a27f3c2658ff09ff5b486c2e60675bd7987948530af5bfa8043d4dfc80113676fa47cf3
6
+ metadata.gz: 4a0cb85837bac7d6bffcd882edfd5e36e93441caa6e8c69581451f92912a0a4afc05d3277ac58fc9f7cd17baccbfdd0f7884811b7085910b44e61952e6b0256b
7
+ data.tar.gz: b3348ff3af42a2261b5b33602e5a82ffd413e520d43f63780bc7d46cd3cf76e9b9a07ec686db26832cc161cb66e21ae17ddf356a848547bb77425bb52783e92a
data/lib/cli.rb CHANGED
@@ -166,6 +166,15 @@ module Dcm
166
166
  parse_file(file)
167
167
  end
168
168
 
169
+ desc "clearcache [FILE]", "Clear cache(s)"
170
+ def clearcache(file=nil)
171
+ if file
172
+ FileCache.clear(file)
173
+ else
174
+ FileCache.clear_all
175
+ end
176
+ end
177
+
169
178
  desc "compare FILE1 FILE2", "Compare contents of FILE1 and FILE2"
170
179
  option :left, type: :boolean, aliases: ["-l"]
171
180
  option :right, type: :boolean, aliases: ["-r"]
data/lib/codinginfo.rb CHANGED
File without changes
data/lib/core_ext.rb CHANGED
File without changes
data/lib/diff_viewer.rb CHANGED
File without changes
data/lib/file_cache.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require "tmpdir"
2
+ require "fileutils"
2
3
  require "digest"
3
4
 
4
5
  class FileCache
@@ -8,6 +9,16 @@ class FileCache
8
9
  new(filepath).cache!(&blk)
9
10
  end
10
11
 
12
+ def self.clear(filepath)
13
+ new(filepath).clear!
14
+ end
15
+
16
+ def self.clear_all
17
+ File.join(Dir.tmpdir, "dcm-*.dump")
18
+ .then { Dir.glob(_1) }
19
+ .each { FileUtils.rm(_1) }
20
+ end
21
+
11
22
  attr_reader :filepath
12
23
  def initialize(filepath)
13
24
  @filepath = filepath
@@ -16,7 +27,11 @@ class FileCache
16
27
  def cache!
17
28
  return read_cache if cached?
18
29
 
19
- yield.tap { write_cache }
30
+ yield.tap { write_cache(_1) }
31
+ end
32
+
33
+ def clear!
34
+ FileUtils.rm(cachefilepath)
20
35
  end
21
36
 
22
37
  private
@@ -42,6 +57,8 @@ class FileCache
42
57
  end
43
58
 
44
59
  def cachefilepath
45
- File.join(Dir.tmpdir, "dcm-#{Digest::MD5.hexdigest(filepath)}.dump")
60
+ File.expand_path(filepath)
61
+ .then { Digest::MD5.hexdigest(_1) }
62
+ .then { File.join(Dir.tmpdir, "dcm-#{_1}.dump") }
46
63
  end
47
64
  end
data/lib/file_reader.rb CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Dcm
2
- VERSION = "0.1.12"
2
+ VERSION = "0.1.14"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dcm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Mueller
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-05-06 00:00:00.000000000 Z
11
+ date: 2025-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: automotive-ecu