From 01b3ebe04f7bbe55e1161743a4cda876b6637691 Mon Sep 17 00:00:00 2001 From: Denis Knauf Date: Mon, 6 Sep 2021 09:48:16 +0200 Subject: [PATCH] method renamed to use the same semantic like duperemove (dedupe_extent) --- deduperemoverb.gemspec | 18 +++++++++--------- lib/deduperemoverb.rb | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/deduperemoverb.gemspec b/deduperemoverb.gemspec index 214e496..bb5da2b 100644 --- a/deduperemoverb.gemspec +++ b/deduperemoverb.gemspec @@ -9,14 +9,13 @@ Gem::Specification.new do |s| s.homepage = 'https://git.denkn.at/deac/deduperemoverb' s.summary = 'Deduplication of file junks of found files by deduperemove.' s.files = - FileList[ - 'lib/**/*.rb', - 'bin/*', - 'Gemfile', - 'Gemfile.lock', - 'ext/*/*.c', - 'ext/*/extconf.rb' - ] + FileList[ %w[ + lib/**/*.rb + bin/* + Gemfile Gemfile.lock + ext/*/*.c ext/*/extconf.rb + ]] + s.bindir = %w[bin] s.require_paths = %w[lib] s.extensions = %w[ext/deduperemoverb/extconf.rb] @@ -24,5 +23,6 @@ Gem::Specification.new do |s| s.add_dependency "ffi", '~> 1.15' s.add_dependency "sqlite3", '~> 1.4' - #s.install_tasks name: 'compile' + s.requirements << 'cc' + s.requirements << 'ruby-dev' end diff --git a/lib/deduperemoverb.rb b/lib/deduperemoverb.rb index 31a3a5d..247ab35 100755 --- a/lib/deduperemoverb.rb +++ b/lib/deduperemoverb.rb @@ -111,7 +111,7 @@ class Duperemove end - def self.duperemove fd, offset, length, dupes + def self.dedupe_extent fd, offset, length, dupes rr = FileDedupeRange[dupes.size].new offset, length fds = [] dupes.each_with_index do |(fd,os),i| @@ -224,7 +224,7 @@ class Duperemove begin t1 = Time.now rs = - Duperemove.duperemove fst.file, + Duperemove.dedupe_extent fst.file, fst.offset, [ fst.size - fst.offset, block_size ].min, fs.map {|f| [f.file, f.offset] }.to_h