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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9e30d4d84458e05078a7cf533a81232c6b9b5ab8f7a23af6ba7eb7d6c4888ad6
4
- data.tar.gz: b777465fad42e5f64fa453b517b0580dfee08fe58de96f95ee33d0037e7d366d
3
+ metadata.gz: eaab3c2b2fd909ddb983e0f23b20bb4361c41288ea834ab698b972c42a3b211b
4
+ data.tar.gz: ea9be3356750b3ec278b01f439eac533c12dc757ab9c0fb26496e7b90a954302
5
5
  SHA512:
6
- metadata.gz: a4e506b03da3563e420a6b9bd73b621d18e90d257345ee494fcc3f92003f55928399ff77346bef949b32a2366af449655b4889e7859860818b9c85aaa7088f0b
7
- data.tar.gz: 2874026b259f142d19fda1be7bd7c3d52b603a8f865bde0320d7f26907efbb32d3a2218ed4b76355fd472a6b90ee5221a73fb0696b5b4bd08c24690782a30b5e
6
+ metadata.gz: a127db82c6529f8c592f1a85f88f8cc7742aa5ea175a18cdca895e7f4e17a08b14213713aa1b5030cdf44fda1ddd785c7b600f7f7ad69854d09dc5179e1ba708
7
+ data.tar.gz: 32538f8dd10a8d7d3eca94819cac12a2170364b11a612b7a555cb3898eba95e19628ea8726ab95e2cbc86e5cac65dfbbab128461c5e54cae01b37a3354cfcc61
@@ -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!🔥
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simple-images-downloader (1.0.1)
4
+ simple-images-downloader (1.0.2)
5
5
  zeitwerk (~> 2.4.0)
6
6
 
7
7
  GEM
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
- You can also configure the place where the images would be stored to by using **by default the images stored in a directory the script is run**:
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,8 @@
2
2
 
3
3
  require 'open-uri'
4
4
  require 'tempfile'
5
+ require 'forwardable'
6
+ require 'singleton'
5
7
  require 'zeitwerk'
6
8
 
7
9
  loader = Zeitwerk::Loader.for_gem
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'singleton'
4
-
5
3
  module SimpleImagesDownloader
6
4
  class Configuration
7
5
  include Singleton
@@ -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
- def destination_dir
27
- Configuration.destination
28
- end
28
+ private :destination_dir, :destination, :file_name
29
29
  end
30
30
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SimpleImagesDownloader
4
- VERSION = '1.0.1'
4
+ VERSION = '1.0.2'
5
5
  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.1
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-24 00:00:00.000000000 Z
11
+ date: 2020-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: zeitwerk