simple-images-downloader 1.0.1 → 1.0.2
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 +4 -4
- data/CHANGELOG.md +9 -0
- data/Gemfile.lock +1 -1
- data/README.md +4 -1
- data/lib/simple_images_downloader.rb +2 -0
- data/lib/simple_images_downloader/configuration.rb +0 -2
- data/lib/simple_images_downloader/dispenser.rb +5 -5
- data/lib/simple_images_downloader/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eaab3c2b2fd909ddb983e0f23b20bb4361c41288ea834ab698b972c42a3b211b
|
4
|
+
data.tar.gz: ea9be3356750b3ec278b01f439eac533c12dc757ab9c0fb26496e7b90a954302
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a127db82c6529f8c592f1a85f88f8cc7742aa5ea175a18cdca895e7f4e17a08b14213713aa1b5030cdf44fda1ddd785c7b600f7f7ad69854d09dc5179e1ba708
|
7
|
+
data.tar.gz: 32538f8dd10a8d7d3eca94819cac12a2170364b11a612b7a555cb3898eba95e19628ea8726ab95e2cbc86e5cac65dfbbab128461c5e54cae01b37a3354cfcc61
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
## 1.0.2 - 2020-09-25
|
2
|
+
- Refactored SimpleImagesDownloader::Dispenser keeping the same behaviour
|
3
|
+
- Updated README
|
4
|
+
- Moved requirement of dependenscies to the top module SimpleImagesDownloader
|
5
|
+
|
6
|
+
## 1.0.1 - 2020-09-24
|
7
|
+
- Removed extra gems from development env
|
8
|
+
- Updated README
|
9
|
+
|
1
10
|
## 1.0.0 - 2020-09-23
|
2
11
|
|
3
12
|
First release!🔥
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -8,6 +8,8 @@
|
|
8
8
|
This gem allows you download images from either source file with list of urls or plain url.
|
9
9
|
The urls must be non redirectable. For now the feature is unsupported. The gem uses `OpenURI` class under the hood and is able to download as small files less than 10KB as large files, for example 100MB.
|
10
10
|
|
11
|
+
**Supported formats: png, jpg, gif, jpeg**
|
12
|
+
|
11
13
|
## Dependencies
|
12
14
|
- Ruby >= 2.7.1
|
13
15
|
|
@@ -65,7 +67,8 @@ Downloading https://test-for-simple-images-downloader.s3.eu-central-1.amazonaws.
|
|
65
67
|
Downloading is finished
|
66
68
|
```
|
67
69
|
|
68
|
-
|
70
|
+
**By default the images stored in a directory the script is run.**
|
71
|
+
You can also configure the place where the images would be stored to:
|
69
72
|
|
70
73
|
```ruby
|
71
74
|
[1] pry(main)> require 'simple_images_downloader'
|
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
module SimpleImagesDownloader
|
4
4
|
class Dispenser
|
5
|
+
extend Forwardable
|
6
|
+
|
7
|
+
def_delegator 'SimpleImagesDownloader::Configuration', :destination, :destination_dir
|
8
|
+
|
5
9
|
def initialize(source, remote_path)
|
6
10
|
@source = source
|
7
11
|
@remote_path = remote_path
|
@@ -13,8 +17,6 @@ module SimpleImagesDownloader
|
|
13
17
|
FileUtils.mv @source, destination
|
14
18
|
end
|
15
19
|
|
16
|
-
private
|
17
|
-
|
18
20
|
def destination
|
19
21
|
@destination ||= destination_dir + file_name
|
20
22
|
end
|
@@ -23,8 +25,6 @@ module SimpleImagesDownloader
|
|
23
25
|
@file_name ||= File.basename(@source) + File.extname(@remote_path)
|
24
26
|
end
|
25
27
|
|
26
|
-
|
27
|
-
Configuration.destination
|
28
|
-
end
|
28
|
+
private :destination_dir, :destination, :file_name
|
29
29
|
end
|
30
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple-images-downloader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- IlkhamGaysin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09-
|
11
|
+
date: 2020-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: zeitwerk
|