reaver 0.11.1 → 0.12.0

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: 383dabbf4efb260aab57ed47fd941e745e3b41e96e091256d617f761aec8caaf
4
- data.tar.gz: 144a702aa351e1e6e20b77aa6f203f1f8bf12db13d5007c7b668703ef29be93c
3
+ metadata.gz: cf376a05a8213d80cda26e8719e6136a556692e5c40b9ca5f3386d85c90a2c8a
4
+ data.tar.gz: fe4b5eea901be158748e1125e53b49d689a6ece8d8e5a433ec38ae353368024f
5
5
  SHA512:
6
- metadata.gz: 3d1e21da7de1424b899405afe9e34c131fda1107670ce8c68f1146bee46210ec43083b5aa990b66ee712bd6efdd82c04e576a503d6dce788491028a7a8425e8f
7
- data.tar.gz: 6c21d4d8a493ec66d0429719299731a5814d1ded064e514335d4dbb64c6eaa349763bbf5be50017168aad240a862374fc4b1d092432d7d2b9f1bede4588e3a35
6
+ metadata.gz: af0313623876c98ac8f57edaf9ac9a6740b0a344436521dcd216d21a742b6453ee2c237e06542bd2ae669fce1591d77f857dcf0819778945b056e78c04481f6a
7
+ data.tar.gz: dd6ba131634c90d2e3c72c189ecfed6e8938c0740ce198a08f9fdba311f476890d3b75d44a75c1dcc6591aa6eec0248d1faee68c9dcd6add5de676344a1f3f14
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,10 +1,12 @@
1
- - add `--strip-components=1` to tar
1
+ ## 0.12.0
2
+ - Add `--strip-components=1` to tar, by default set to `1` may be changed by
3
+ `things[].strip_components: <number>` variable
2
4
 
3
5
  ## 0.11.0, release 10/2024
4
6
  - can extract tar.xz archive.
5
7
 
6
8
  ## 0.10.1
7
- - For `all_to_dir_path` or `things.dest_dir`, all paths are relative to `$HOME` (or
9
+ - For `all_to_dir_path` or `things[].dest_dir`, all paths are relative to `$HOME` (or
8
10
  /home/<name>), so don't include shell variable `~` or `$HOME`.
9
11
  - unzip not interactive with `-o`.
10
12
 
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # reaver
2
2
 
3
+ [![Gem
4
+ Version](https://badge.fury.io/rb/reaver.svg)](https://badge.fury.io/rb/reaver)
5
+
3
6
  A tool that allows to download and track the latest version of stuff on the net.
4
7
  Define your collections in .yml and launch Reaver to retrieve everything and
5
8
  move things to the right spot.
@@ -47,12 +50,14 @@ A collection can include:
47
50
  if not exist.
48
51
  - `keep_name: <boolean>`, if `true`, use the name of the thing for the dest, e.g, for a name `ombre.tar.gz`, the final dest will be `all_into_dir/ombre` or `dest_dir/ombre`.
49
52
  - `force_download: <boolean>`, if you make change and want to download now, change to `true`.
50
- - `things.dest_dir: <dirname>`, if each files go in differents directory, use this.
51
- - `things.name` the new name after download, may include the file extension.
52
- - `things.url: <string>`
53
+ - `things[].dest_dir: <dirname>`, if each files go in differents directory, use this.
54
+ - `things[].name` the new name after download, may include the file extension.
55
+ - `things[].strip_components: <number>`, used on `tar`, default to 1, skip the first
56
+ directory from an archive, if no subdirectory exist, you should set to 0.
57
+ - `things[].url: <string>`
53
58
  - `time: 86000` (in second) is for search every day ( 60 * 60 * 24 ).
54
59
 
55
- If `all_into_dir` is defined, `things.dest_dir` is not used.
60
+ If `all_into_dir` is defined, `things[].dest_dir` is not used.
56
61
  All paths given are relative to `$HOME` so don't include `~` or any shell
57
62
  variables.
58
63
 
@@ -68,7 +68,13 @@ module Reaver
68
68
  def need_to_do_something_with(file)
69
69
  dest = @tasks['all_to_dest_dir'] || file['dest_dir']
70
70
  keep_name = @tasks['keep_name'] || false
71
- Reaver::Walk.new(file['name'], dest, keep_name) if dest
71
+ strip_components = file['strip_components'] || '1'
72
+ return unless dest
73
+
74
+ Reaver::Walk.new(file['name'],
75
+ dest,
76
+ keep_name,
77
+ strip_components)
72
78
  end
73
79
  end
74
80
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Reaver
4
- VERSION = '0.11.1'
4
+ VERSION = '0.12.0'
5
5
  end
data/lib/reaver/walk.rb CHANGED
@@ -6,10 +6,11 @@ require 'fileutils'
6
6
  module Reaver
7
7
  # extract, move file if need
8
8
  class Walk
9
- def initialize(filename, dest, keep_name)
9
+ def initialize(filename, dest, keep_name, strip)
10
10
  @filename = filename
11
11
  @dest = dest
12
12
  @keep_name = keep_name || false
13
+ @strip = strip
13
14
  check_extension
14
15
  check_name
15
16
  x
@@ -63,7 +64,7 @@ module Reaver
63
64
  ext = @extension.split('/').last
64
65
  puts "Extracting #{ext} archive #{@filename} at #{@final_dest}..."
65
66
  FileUtils.mkdir_p @final_dest
66
- `tar x --strip-components=1 -f #{@filename} --one-top-level=#{@final_dest}`
67
+ `tar x --strip-components=#{@strip} -f #{@filename} --one-top-level=#{@final_dest}`
67
68
  end
68
69
  end
69
70
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reaver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.1
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - szorfein
@@ -36,7 +36,7 @@ cert_chain:
36
36
  urXgRIzALxd/xazPCnoLSXPzfJSI6Y77S1EBvhPd9RaSO8IyH9RhPDP9mnTvW2Kl
37
37
  NAUnoL+txK5a
38
38
  -----END CERTIFICATE-----
39
- date: 2024-10-07 00:00:00.000000000 Z
39
+ date: 2024-10-08 00:00:00.000000000 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: marcel
metadata.gz.sig CHANGED
Binary file