pulse-downloader 0.1.16 → 0.1.17

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: 2b4edaf42a90782470ab4956cc6d9cf4214d6bb81c03b8e5b55193ac1867330e
4
- data.tar.gz: 81da683b9c0aa82f17197a280318b529ab4f6630dd20fa385925739f02165ca2
3
+ metadata.gz: 0b50ec4293c1d064d672f7b9c8271837420deb866826a85d8c3016ca348bfd39
4
+ data.tar.gz: d4b35e8706bece03ba778320bb524fd8164f3b7e1933a3f79939b38abe5f9d20
5
5
  SHA512:
6
- metadata.gz: d8771a9ece20d74d44bb8e365d7f51be288ee8a9f5ff5dbec826013aec57998147d58d0e17ffd6ab5c7213f2dc441bfd4b471716f99e8df40e06cf2c7c00ddf0
7
- data.tar.gz: 053c925e99adeeb3cae3f277bb0e3ceda00d327ac57fdc76ce25e9a86220d66a291c0f388aa1aebe66a92e7b9b8971409c7b59dc4d188fa87ee4504914b52052
6
+ metadata.gz: e8626f65c533de9ca6422d6a1ea18c018e2ca23316ecd2678a5c9a733fe65d72eb1fd921e9a1215839e8501849cc36cb3c96d4e9cfa39e107fbc5422bc2d7be7
7
+ data.tar.gz: 70cc3bb87274c39ee93060292ee343144157806dd8900f78a564363bfad2a997182b2ae104ec0941603256fc8d38583d041f01e541d520ed169dc51989fb1f1b
@@ -18,7 +18,8 @@ module Pulse
18
18
  :report_time,
19
19
  :start_time,
20
20
  :end_time,
21
- :progress_bar
21
+ :progress_bar,
22
+ :base_url
22
23
 
23
24
  # Does not continue downloads-
24
25
  # Will only save once the file has been downloaded in memory
@@ -51,6 +52,8 @@ module Pulse
51
52
  @save_and_dont_return = save_and_dont_return
52
53
  @report_time = report_time
53
54
  @progress_bar = progress_bar
55
+
56
+ @base_url = get_base_url
54
57
  end
55
58
 
56
59
  def call!
@@ -76,6 +79,16 @@ module Pulse
76
79
 
77
80
  private
78
81
 
82
+ def get_base_url
83
+ url_breakdown = url.split('/')
84
+
85
+ if url_breakdown.first.include?('https')
86
+ url_breakdown[2]
87
+ else
88
+ url_breakdown.first
89
+ end
90
+ end
91
+
79
92
  def get_micro_second_time
80
93
  (Time.now.to_f * 1000).to_i
81
94
  end
@@ -1,5 +1,5 @@
1
1
  module Pulse
2
2
  module Downloader
3
- VERSION = "0.1.16"
3
+ VERSION = "0.1.17"
4
4
  end
5
5
  end
@@ -49,13 +49,7 @@ module Pulse
49
49
  end
50
50
 
51
51
  def add_base_url(str)
52
- url_breakdown = url.split('/')
53
-
54
- if url_breakdown.first.include?('https')
55
- url_breakdown.third
56
- else
57
- url_breakdown.first
58
- end
52
+ "#{base_url}#{str}"
59
53
  end
60
54
  end
61
55
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pulse-downloader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - trex22