reaver 0.17.0 → 0.18.1

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: 149dbd0eae5bd1597a5e66059cc765c25f9f63d05d9bfdf2d7ec6484564b7bbb
4
- data.tar.gz: 30e91e2d44090b1f0be9383eba41b25f854c453622de4173a910da6c12fbecf0
3
+ metadata.gz: 137f52f4df99e56407d711cf500344f4d6dbd77616b3ff9a4bcabe4ad973ea68
4
+ data.tar.gz: 3d308ca92833ad46fe7cc90c7d77b356a58619dc630c73d9440db8e60ad1b77b
5
5
  SHA512:
6
- metadata.gz: 34db056ae50024e6358bf14edab543a80466485ffcc5896bc17bd462ba5b33658d50adc366e328c4f43fdb99a463423753e2e49042ca965e77dd38666eec71b1
7
- data.tar.gz: 0c5147410254e9019022093668db7347c3d8c41c02c94d93ddb825ccedd6a6390674aa275c1881986ee0f8f75378af056f0b8d44348aa45fbfad3dbcd2388edf
6
+ metadata.gz: 98b0be9ab2dbf8681de1b09a790d5b9407f4e229bb072da470cae53bb941b7c39ddaef0f01e5a5aae442270e790891e95865cc37e2a5b9b555a83ca035724c44
7
+ data.tar.gz: 072eedc65a9875d449e9d60b29a238ed2e7fdcb71c3d6f0f061ff77eb855fd61e3d3065de73f4429d5efcac05fbf625ac51591bd9aba7d5605df99ce5cb549a9
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,11 +1,17 @@
1
- ## 0.17.0 - Oct. 2025
1
+ ## 0.18.1
2
2
 
3
+ - Remove threading, need more test.
4
+
5
+ ## 0.18.0 - Oct. 2025
6
+
7
+ - Adding threads on tasks
3
8
  - Random user-agent on each download
4
9
  - Code improvement with Rubocop
5
10
 
6
11
  ### Fixes
7
12
 
8
13
  - Skip in not things or things[] is nil
14
+ - Error on download with file.path
9
15
 
10
16
  ## 0.16.0, release 01/2025
11
17
 
@@ -17,10 +17,10 @@ module Reaver
17
17
  def load_yaml
18
18
  puts ">> Loading #{@file}..."
19
19
  @tasks = if RUBY_VERSION >= '3.0'
20
- YAML.load_file(@file, permitted_classes: [Time, Symbol])
21
- else
22
- @tasks = YAML.load_file(@file)
23
- end
20
+ YAML.load_file(@file, permitted_classes: [Time, Symbol])
21
+ else
22
+ @tasks = YAML.load_file(@file)
23
+ end
24
24
  rescue StandardError => e
25
25
  raise e, "loading YAML fail for #{@file}: #{e.message}"
26
26
  end
@@ -33,21 +33,25 @@ module Reaver
33
33
  def launch(metadata)
34
34
  return if !@tasks['things'] || @tasks['things'].nil?
35
35
 
36
- @tasks['things'].each do |task|
36
+ get_each_files(@tasks)
37
+ @tasks['things'].each { |task| move_thing(task) unless task['git'] }
38
+ metadata.info['changed'] = @changed
39
+ end
40
+
41
+ protected
42
+
43
+ def get_each_files(tasks)
44
+ tasks['things'].each do |task|
37
45
  if task['git']
38
46
  Reaver::Git.new(task['url'], task['dest_dir'])
39
47
  else
40
- do_thing(task)
48
+ hash_exist(task['name'])
49
+ Reaver.download(task['url'], task['name'])
41
50
  end
42
- metadata.info['changed'] = @changed
43
51
  end
44
52
  end
45
53
 
46
- protected
47
-
48
- def do_thing(task)
49
- hash_exist(task['name'])
50
- Reaver.download(task['url'], task['name'])
54
+ def move_thing(task)
51
55
  compare_to_old_hash(task['name']) if @old_hash
52
56
  need_to_do_something_with(task) if @changed || !@old_hash
53
57
  @tasks['force_download'] = false
@@ -17,7 +17,7 @@ module Reaver
17
17
  options = {}
18
18
 
19
19
  Whirly.start do
20
- Whirly.status = "downloading #{dest}"
20
+ Whirly.status = "Downloading #{dest}"
21
21
  options['User-Agent'] = agent_list
22
22
  downloaded_file = URI.open(url, options)
23
23
 
@@ -43,7 +43,7 @@ module Reaver
43
43
  if file.is_a?(StringIO)
44
44
  tempfile = Tempfile.new('open-uri', binmode: true)
45
45
  IO.copy_stream(file, tempfile.path)
46
- FileUtils.mv file.path, dest
46
+ FileUtils.mv tempfile.path, dest
47
47
  else
48
48
  IO.copy_stream(file, dest)
49
49
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Reaver
4
- VERSION = '0.17.0'
4
+ VERSION = '0.18.1'
5
5
  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.17.0
4
+ version: 0.18.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - szorfein
metadata.gz.sig CHANGED
Binary file