reaver 0.13.0 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +3 -0
- data/README.md +3 -2
- data/lib/reaver/collection.rb +5 -1
- data/lib/reaver/git.rb +39 -0
- data/lib/reaver/version.rb +1 -1
- data/lib/reaver.rb +1 -0
- data.tar.gz.sig +0 -0
- metadata +4 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11f9df0aabd618b5bf7aab285589005337370b29d434aa31609299a859a3a3df
|
4
|
+
data.tar.gz: 1a7cd410c41212268eb2a7d4f481d514912f5a337ab3d1619423c11d2b1263ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a30ca1a17864e1f7bfa169d357df180125b362d84cc36e115a43e6f08a6b1a9c92b1f287fa7c22d6fa1be0d6d8d7f9464d24132bee83b3d577e8ec14a43d784c
|
7
|
+
data.tar.gz: 042e5aaa0569b07318f6a9437bf6463bea0a282946edebae1242a6035fafea1eeb3b63ef96792fe7f5c68d59ccf48cf397fdbf30341ed68682465e2c7537a713
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -9,7 +9,7 @@ move things to the right spot.
|
|
9
9
|
|
10
10
|
## Dependencies
|
11
11
|
|
12
|
-
Reaver need only `unzip`, `xz` and `
|
12
|
+
Reaver need only `unzip`, `xz`, `tar` and `git`, depending what you'll use.
|
13
13
|
|
14
14
|
## Collections
|
15
15
|
|
@@ -48,13 +48,14 @@ To see more examples, go
|
|
48
48
|
A collection can include:
|
49
49
|
- `all_into_dir: <dirname>` if all files go in a directory. Directory is created
|
50
50
|
if not exist.
|
51
|
-
- `keep_name: <boolean>`, if `true`,
|
51
|
+
- `keep_name: <boolean>`, if `true`, create a directory with the name of the thing, e.g, for a name `ombre.tar.gz`, the final dest will be `all_into_dir/ombre` or `dest_dir/ombre`.
|
52
52
|
- `force_download: <boolean>`, if you make change and want to download now, change to `true`.
|
53
53
|
- `things[].dest_dir: <dirname>`, if each files go in differents directory, use this.
|
54
54
|
- `things[].name` the new name after download, may include the file extension.
|
55
55
|
- `things[].strip_components: <number>`, used on `tar`, default to 1, skip the first
|
56
56
|
directory from an archive, if no subdirectory exist, you should set to 0.
|
57
57
|
- `things[].url: <string>`
|
58
|
+
- `things[].git: <boolean>`, If the thing need to be managed with git.
|
58
59
|
- `time: 86000` (in second) is for search every day ( 60 * 60 * 24 ).
|
59
60
|
|
60
61
|
If `all_into_dir` is defined, `things[].dest_dir` is not used.
|
data/lib/reaver/collection.rb
CHANGED
@@ -34,7 +34,11 @@ module Reaver
|
|
34
34
|
return unless @tasks || @tasks['things'].length.zero?
|
35
35
|
|
36
36
|
@tasks['things'].each do |task|
|
37
|
-
|
37
|
+
if task['git']
|
38
|
+
Reaver::Git.new(task['url'], task['dest_dir'])
|
39
|
+
else
|
40
|
+
do_thing(task)
|
41
|
+
end
|
38
42
|
metadata.info['changed'] = @changed
|
39
43
|
end
|
40
44
|
end
|
data/lib/reaver/git.rb
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'fileutils'
|
4
|
+
|
5
|
+
module Reaver
|
6
|
+
# Treat git
|
7
|
+
class Git
|
8
|
+
def initialize(url, dest)
|
9
|
+
@dest = "#{ENV['HOME']}/#{dest}"
|
10
|
+
@url = url
|
11
|
+
x
|
12
|
+
end
|
13
|
+
|
14
|
+
protected
|
15
|
+
|
16
|
+
def x
|
17
|
+
if !Dir.exist?(@dest)
|
18
|
+
git_clone
|
19
|
+
elsif Dir.exist?(@dest) && !Dir.exist?("#{@dest}/.git")
|
20
|
+
FileUtils.rm_rf @dest
|
21
|
+
git_clone
|
22
|
+
elsif Dir.exist?(@dest) && Dir.exist?("#{@dest}/.git")
|
23
|
+
git_sync
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def git_clone
|
30
|
+
puts "Git cloning #{@url} to #{@dest}..."
|
31
|
+
`git clone #{@url} #{@dest}`
|
32
|
+
end
|
33
|
+
|
34
|
+
def git_sync
|
35
|
+
puts "Git fetching update(s) on #{@dest}..."
|
36
|
+
`cd #{@dest} && git pull`
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
data/lib/reaver/version.rb
CHANGED
data/lib/reaver.rb
CHANGED
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.
|
4
|
+
version: 0.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- szorfein
|
@@ -34,7 +34,7 @@ cert_chain:
|
|
34
34
|
1Eu31LqT9K75BZgLoHDybDlvVJ1B2hZI31jZOFjqpCgVxwoHmuigy2iCUcLsCTJJ
|
35
35
|
6ct0vZN7gCQ/YSLa3jJf1N/CH4rQokbof1fehel4SPA=
|
36
36
|
-----END CERTIFICATE-----
|
37
|
-
date: 2024-
|
37
|
+
date: 2024-11-29 00:00:00.000000000 Z
|
38
38
|
dependencies:
|
39
39
|
- !ruby/object:Gem::Dependency
|
40
40
|
name: marcel
|
@@ -96,6 +96,7 @@ files:
|
|
96
96
|
- lib/reaver/banner.rb
|
97
97
|
- lib/reaver/collection.rb
|
98
98
|
- lib/reaver/download.rb
|
99
|
+
- lib/reaver/git.rb
|
99
100
|
- lib/reaver/metadata.rb
|
100
101
|
- lib/reaver/version.rb
|
101
102
|
- lib/reaver/walk.rb
|
@@ -124,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
125
|
- !ruby/object:Gem::Version
|
125
126
|
version: '0'
|
126
127
|
requirements: []
|
127
|
-
rubygems_version: 3.
|
128
|
+
rubygems_version: 3.5.16
|
128
129
|
signing_key:
|
129
130
|
specification_version: 4
|
130
131
|
summary: A tool to downloads and track updates of things on the Net.
|
metadata.gz.sig
CHANGED
Binary file
|