minitest-holdify 1.1.1 → 1.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
  SHA256:
3
- metadata.gz: 48b28eeeaa320f75630822394f0f4b91a3025e081f085e39dee88ce264a5b2ab
4
- data.tar.gz: fbc6c3b837a70c44d7359495c1e58809376022a6a458f504db4d7f06ff8585ae
3
+ metadata.gz: 633215ac6e960bb4fe8e63dbf22d1247b9b684da3a2300611882b5a1251ca0ad
4
+ data.tar.gz: a80e8995767b2b3438dc809f494a473e4376da664924ba6ee117aa26ccc2d274
5
5
  SHA512:
6
- metadata.gz: 0accd428f401a337bbdbd8f9537b952c42e40508425d3353213b9795d2b0ecd4b617087d41f0abb79af508e156e7aa7149a6fe30e9cdff7b135c062f3b3caf32
7
- data.tar.gz: c71c3caff7e00b1f8fb40ec5e871d3697cec7925a76559b1c8064a512bcc5a9285c150836a013edfa3c33325da9e3256096dfc27161251467ca817cfffbf8c19
6
+ metadata.gz: '0129f206eddc8ba5683d64e6ac5c4273dd83818a43ef636a5493706816143b6b35c567bcb407aed623c3c761f0a1d954ac23b2c691c6e81b6f1affcdad0d4ac5'
7
+ data.tar.gz: e1980a9bfd4f392c40c13194bb35c6d375f26bcef76a93ac4d1173305da5d3c557e8ecf69e659194ce1515b89b8ae2f423f204db883ff0c092c13db467c9e395
data/lib/holdify/hold.rb CHANGED
@@ -17,7 +17,7 @@ module Holdify
17
17
  def call(actual, force: false)
18
18
  location = find_location
19
19
  line = location.lineno
20
- raise "Could not find holdify statement at line #{line}" unless @store.sha_at(line)
20
+ raise "Could not find holdify statement at line #{line}" unless @store.xxh_at(line)
21
21
 
22
22
  @session[line] << actual
23
23
  @forced << "#{@path}:#{line}" if force
@@ -22,7 +22,7 @@ module Holdify
22
22
 
23
23
  output = {}
24
24
  @data.keys.sort.each do |line|
25
- sha = @source.sha_at(line)
25
+ sha = @source.xxh_at(line)
26
26
  next unless sha
27
27
 
28
28
  output["L#{line} #{sha}"] = @data[line]
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'digest/sha1'
3
+ require 'xxhash'
4
4
 
5
5
  module Holdify
6
6
  # Represents the current state of the source file
7
7
  class Source
8
8
  def initialize(path) = (@line_sha, @sha_lines = parse(path))
9
9
 
10
- def sha_at(line) = @line_sha[line]
10
+ def xxh_at(line) = @line_sha[line]
11
11
 
12
12
  def lines_with(sha) = @sha_lines[sha]
13
13
 
@@ -21,7 +21,7 @@ module Holdify
21
21
  content = text.strip
22
22
  next if content.empty?
23
23
 
24
- sha = Digest::SHA1.hexdigest(content)
24
+ sha = XXhash.xxh32(content).to_s
25
25
  line_sha[line] = sha
26
26
  sha_lines[sha] << line
27
27
  end
data/lib/holdify/store.rb CHANGED
@@ -14,7 +14,7 @@ module Holdify
14
14
  @ledger = Ledger.new(path, @source)
15
15
  end
16
16
 
17
- def_delegator :@source, :sha_at
17
+ def_delegator :@source, :xxh_at
18
18
  def_delegators :@ledger, :get, :set, :save
19
19
  end
20
20
  end
data/lib/holdify.rb CHANGED
@@ -5,7 +5,7 @@ require_relative 'holdify/hold'
5
5
 
6
6
  # The container module
7
7
  module Holdify
8
- VERSION = '1.1.1'
8
+ VERSION = '1.1.2'
9
9
  CONFIG = { ext: '.yaml' }.freeze
10
10
 
11
11
  class << self
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-holdify
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Domizio Demichelis
@@ -23,6 +23,20 @@ dependencies:
23
23
  - - ">="
24
24
  - !ruby/object:Gem::Version
25
25
  version: 5.0.0
26
+ - !ruby/object:Gem::Dependency
27
+ name: xxhash
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 0.7.0
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: 0.7.0
26
40
  description: Stop maintaining large expected values in your test/fixture files! Hold
27
41
  them automatically. Update them effortlessly.
28
42
  email: