coverband 5.2.3 → 5.2.3.2

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
  SHA256:
3
- metadata.gz: 462b2cd367311f51a377ec76be8d73e4df260b6e473430c5eca87b5f834e6e98
4
- data.tar.gz: f62521bd4123a1da8f07988d192e2655767d9357c0929d414d006260f6b32f41
3
+ metadata.gz: b86ea2f59a09e6e1aa19962a0c040a799c779ad315ddb4638f83a00e1ce83d6b
4
+ data.tar.gz: 4b7ec38f2f1907cd0403ac6202f945a177afb745c8ee914ac4e10d7643f39bee
5
5
  SHA512:
6
- metadata.gz: 48d7f783030a72a077b228d3358ed8cce0d04fd17f3b452efa30f7e6e9ba4b7904eb8c9ed2d2b5c6a54400f41af9e33c9b505c36a350157f9b97626315651233
7
- data.tar.gz: 3c6b884f98122c7f5d383ddff9b31e424c4c69e12e13e868bd6c0ddab1a3913525d7d9bb3d832cd4f5fa8e5501c188da6aae957d3b0059f6a4e5cf7a683f3b68
6
+ metadata.gz: af8fdb3b98d8350cabf01e5ddca9321fccd838e4da80ef5260cde7d4e31c17041707e703761193d27b35f1ba1ea3c7363843b80506a7dfa7152ceb82ac5b68bc
7
+ data.tar.gz: 12f81c55f8bec44ebaf4fc4296484de0c28acae104f546240b278ffb27fbcd9775c03ddc803d1e5234a34fdcd1a8c579dd08808d732b67982d520c5d9aec17bd
@@ -93,7 +93,7 @@ module Coverband
93
93
  end
94
94
 
95
95
  def file_hash(file)
96
- Coverband::Utils::FileHasher.hash(file)
96
+ Coverband::Utils::FileHasher.hash_file(file)
97
97
  end
98
98
 
99
99
  # TODO: modify to extend report inline?
@@ -30,6 +30,11 @@ module Coverband
30
30
  Coverband.configuration.password == Base64.decode64(auth_header.split[1]).split(":")[1]
31
31
  end
32
32
 
33
+ def self.call(env)
34
+ @app ||= new
35
+ @app.call(env)
36
+ end
37
+
33
38
  def call(env)
34
39
  @request = Rack::Request.new(env)
35
40
 
@@ -5,7 +5,7 @@ module Coverband
5
5
  class FileHasher
6
6
  @cache = {}
7
7
 
8
- def self.hash(file, path_converter: AbsoluteFileConverter.instance)
8
+ def self.hash_file(file, path_converter: AbsoluteFileConverter.instance)
9
9
  @cache[file] ||= begin
10
10
  file = path_converter.convert(file)
11
11
  Digest::MD5.file(file).hexdigest if File.exist?(file)
@@ -5,5 +5,5 @@
5
5
  # use format "4.2.1.rc.1" ~> 4.2.1.rc to prerelease versions like v4.2.1.rc.2 and v4.2.1.rc.3
6
6
  ###
7
7
  module Coverband
8
- VERSION = '5.2.3'
8
+ VERSION = "5.2.3.2"
9
9
  end
@@ -6,17 +6,17 @@ module Coverband
6
6
  module Utils
7
7
  class FileHasherTest < Minitest::Test
8
8
  def test_hash_same_file
9
- refute_nil FileHasher.hash("./test/dog.rb")
10
- assert_equal(FileHasher.hash("./test/dog.rb"), FileHasher.hash("./test/dog.rb"))
11
- assert_equal(FileHasher.hash(File.expand_path("./test/dog.rb")), FileHasher.hash("./test/dog.rb"))
9
+ refute_nil FileHasher.hash_file("./test/dog.rb")
10
+ assert_equal(FileHasher.hash_file("./test/dog.rb"), FileHasher.hash_file("./test/dog.rb"))
11
+ assert_equal(FileHasher.hash_file(File.expand_path("./test/dog.rb")), FileHasher.hash_file("./test/dog.rb"))
12
12
  end
13
13
 
14
14
  def test_hash_different_files
15
- refute_equal(FileHasher.hash("./test/dog.rb"), FileHasher.hash("./lib/coverband.rb"))
15
+ refute_equal(FileHasher.hash_file("./test/dog.rb"), FileHasher.hash_file("./lib/coverband.rb"))
16
16
  end
17
17
 
18
18
  def test_hash_file_not_exists
19
- assert_nil(FileHasher.hash("./made_up_file.py"))
19
+ assert_nil(FileHasher.hash_file("./made_up_file.py"))
20
20
  end
21
21
  end
22
22
  end
data/test/test_helper.rb CHANGED
@@ -100,7 +100,7 @@ def test(name, &block)
100
100
  end
101
101
 
102
102
  def mock_file_hash(hash: "abcd")
103
- Coverband::Utils::FileHasher.expects(:hash).at_least_once.returns(hash)
103
+ Coverband::Utils::FileHasher.expects(:hash_file).at_least_once.returns(hash)
104
104
  end
105
105
 
106
106
  def example_line
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coverband
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.3
4
+ version: 5.2.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Mayer
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-04-05 00:00:00.000000000 Z
12
+ date: 2023-07-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: benchmark-ips
@@ -499,7 +499,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
499
499
  - !ruby/object:Gem::Version
500
500
  version: '0'
501
501
  requirements: []
502
- rubygems_version: 3.0.3
502
+ rubygems_version: 3.2.32
503
503
  signing_key:
504
504
  specification_version: 4
505
505
  summary: Rack middleware to measure production code usage (LOC runtime usage)