reaver 0.11.1 → 0.13.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: 383dabbf4efb260aab57ed47fd941e745e3b41e96e091256d617f761aec8caaf
4
- data.tar.gz: 144a702aa351e1e6e20b77aa6f203f1f8bf12db13d5007c7b668703ef29be93c
3
+ metadata.gz: 71aeb61cce0d233f4805e0c63a95fd171638a4d0142379bc63d18f2e459be020
4
+ data.tar.gz: 4d5b980f10d77ff049425246af3860e1c4a3742c1d1248036afb622e472b90b6
5
5
  SHA512:
6
- metadata.gz: 3d1e21da7de1424b899405afe9e34c131fda1107670ce8c68f1146bee46210ec43083b5aa990b66ee712bd6efdd82c04e576a503d6dce788491028a7a8425e8f
7
- data.tar.gz: 6c21d4d8a493ec66d0429719299731a5814d1ded064e514335d4dbb64c6eaa349763bbf5be50017168aad240a862374fc4b1d092432d7d2b9f1bede4588e3a35
6
+ metadata.gz: db92437ff4c2a4ccb20455fed86107dc5a7d5739552ff77a8c2053cfe6b4d047ed025db3553b1c537242948b157686b86c5e02726e578c7f728798e7409f3d27
7
+ data.tar.gz: fd890ce9dc9e2d74d14b4f838e892082761d3862e284ccab3781792289a8263460b9a65378a5d2894ab1929d7234730d950b7090fa0bf66810d7858911dea06d
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.13.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
@@ -25,6 +26,8 @@ module Reaver
25
26
  extract_gzip
26
27
  when %r{^font/ttf}
27
28
  copy_file
29
+ when %r{^application/(x-elf|x-sh)}
30
+ copy_file_with_x
28
31
  else
29
32
  puts "Filetype #{@extension} not yet supported, skipping..."
30
33
  end
@@ -51,6 +54,13 @@ module Reaver
51
54
  puts "Copying file #{@filename} at #{@final_dest}..."
52
55
  FileUtils.mkdir_p @final_dest
53
56
  FileUtils.cp @filename, "#{@final_dest}/#{@filename}"
57
+ rescue Errno::ETXTBSY => e
58
+ puts "You should stop program before update > #{e}"
59
+ end
60
+
61
+ def copy_file_with_x
62
+ copy_file
63
+ File.chmod 0700, "#{@final_dest}/#{@filename}"
54
64
  end
55
65
 
56
66
  def extract_zip
@@ -63,7 +73,7 @@ module Reaver
63
73
  ext = @extension.split('/').last
64
74
  puts "Extracting #{ext} archive #{@filename} at #{@final_dest}..."
65
75
  FileUtils.mkdir_p @final_dest
66
- `tar x --strip-components=1 -f #{@filename} --one-top-level=#{@final_dest}`
76
+ `tar x --strip-components=#{@strip} -f #{@filename} --one-top-level=#{@final_dest}`
67
77
  end
68
78
  end
69
79
  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.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - szorfein
@@ -10,9 +10,9 @@ bindir: bin
10
10
  cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
- MIIE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woHmuigy2iCUcLsCTJJ
35
+ 6ct0vZN7gCQ/YSLa3jJf1N/CH4rQokbof1fehel4SPA=
38
36
  -----END CERTIFICATE-----
39
- date: 2024-10-07 00:00:00.000000000 Z
37
+ date: 2024-10-25 00:00:00.000000000 Z
40
38
  dependencies:
41
39
  - !ruby/object:Gem::Dependency
42
40
  name: marcel
metadata.gz.sig CHANGED
Binary file