reaver 0.11.0 → 0.12.0

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: 0fa3014398fc15a35e20032c065846bff2a3e9046ee13ebfec9e2c618f6d5a1e
4
- data.tar.gz: 88d073275dcc5e1908c1156876722580bc7123995a9ddac1d7ef32104219517f
3
+ metadata.gz: cf376a05a8213d80cda26e8719e6136a556692e5c40b9ca5f3386d85c90a2c8a
4
+ data.tar.gz: fe4b5eea901be158748e1125e53b49d689a6ece8d8e5a433ec38ae353368024f
5
5
  SHA512:
6
- metadata.gz: 6333e552024a93186a22fc87be8500027117091796ffcb1c44a791d2e899fe29485c65f51340519bd7fed0f59ad44f8a9b59b3b84074357e76cf5f41c9beb1ff
7
- data.tar.gz: b148922de512faebf56e415facbc10c84bc0f6bb2af0a84e966e4feb528b39c9d62d72fb9aea97e95c36252593193e7f2b90f40a9e43825b43caefc6f0795eae
6
+ metadata.gz: af0313623876c98ac8f57edaf9ac9a6740b0a344436521dcd216d21a742b6453ee2c237e06542bd2ae669fce1591d77f857dcf0819778945b056e78c04481f6a
7
+ data.tar.gz: dd6ba131634c90d2e3c72c189ecfed6e8938c0740ce198a08f9fdba311f476890d3b75d44a75c1dcc6591aa6eec0248d1faee68c9dcd6add5de676344a1f3f14
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,8 +1,12 @@
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
4
+
1
5
  ## 0.11.0, release 10/2024
2
6
  - can extract tar.xz archive.
3
7
 
4
8
  ## 0.10.1
5
- - 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
6
10
  /home/<name>), so don't include shell variable `~` or `$HOME`.
7
11
  - unzip not interactive with `-o`.
8
12
 
data/README.md CHANGED
@@ -1,12 +1,15 @@
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.
6
9
 
7
10
  ## Dependencies
8
11
 
9
- Reaver need only `unzip` and `tar`.
12
+ Reaver need only `unzip`, `xz` and `tar`.
10
13
 
11
14
  ## Collections
12
15
 
@@ -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.0'
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 -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.0
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