pulse-downloader 0.1.11 → 0.1.12

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: 608d5fcfe9c84a1c201f54a4a74b64dbe285580e733a77fe89f42c8645b6c2e4
4
- data.tar.gz: 3252a32fa9955d1d81b158c3cff4c483329dd1d610a663cd48382a0fe40c1ddc
3
+ metadata.gz: 17c6b467560188e6ccbf9549fe0be00188726daf87352d295788ccbbb986ead3
4
+ data.tar.gz: a88019ce7c0708767b8c76bb5796ec34950f1ddf02cd7f2e8b83cb09126bcbb8
5
5
  SHA512:
6
- metadata.gz: f10828967940a47f023dc610e3121f00eebe8962fea1830ccb25c9d84fc8b244749d094cfbfbc8c9ce0495cd572823058fc9557dc665e318a680c6e000703fa7
7
- data.tar.gz: 07becda8b5b3c47908c96c6ee5016980ac053c3555b4acac47f1da7d73cf42bcac692351f877cf2ffd2a33d74107a2687614d25a3a8613593d0181bd6159428b
6
+ metadata.gz: b96d3ec2c08d342d4884c8d413d5133d1a71776f12e9dfc8c12829db9f1f0fc02f784f58f07481692f13b8d7a1a2dce66bd7e2c049077d1a337a676876a15c5b
7
+ data.tar.gz: b60ca5f1204ae2efd86c31c946dbcbff3d02c4279d83fd8f36c07d9909e4103db1df98b9009b5305b8271c3ba6c6fe7bda4daf708bb0505f15aab316e08af0a5
@@ -1,8 +1,6 @@
1
1
  module Pulse
2
2
  module Downloader
3
3
  module FileDownloader
4
- require 'uri'
5
-
6
4
  # save_path and verify_ssl are defined in client.rb
7
5
  def download(file_path, progress_bar=nil)
8
6
  raise "save_path is undefined" if save_data && save_path == ''
@@ -10,7 +8,7 @@ module Pulse
10
8
 
11
9
  @start_time = get_micro_second_time
12
10
 
13
- file_data = HTTParty.get(URI.escape(compute_file_link(file_path)), verify: verify_ssl)
11
+ file_data = HTTParty.get(escape(compute_file_link(file_path)), verify: verify_ssl)
14
12
 
15
13
  @end_time = get_micro_second_time
16
14
 
@@ -68,6 +66,37 @@ module Pulse
68
66
  def section?(file_path)
69
67
  file_path[0] == '#'
70
68
  end
69
+
70
+ def escape(str)
71
+ str.gsub("Space", "%20")
72
+ str.gsub("$", "\%24")
73
+ str.gsub("&", "\%26")
74
+ str.gsub("`", "\%60")
75
+ str.gsub(":", "\%3A")
76
+ str.gsub("<", "\%3C")
77
+ str.gsub(">", "\%3E")
78
+ str.gsub("[", "\%5B")
79
+ str.gsub("]", "\%5D")
80
+ str.gsub("{", "\%7B")
81
+ str.gsub("}", "\%7D")
82
+ str.gsub("“", "\%22")
83
+ str.gsub('"', "\%22")
84
+ str.gsub("+", "\%2B")
85
+ str.gsub("#", "\%23")
86
+ str.gsub("\%", "\%25")
87
+ str.gsub("@", "\%40")
88
+ str.gsub("/", "\%2F")
89
+ str.gsub(";", "\%3B")
90
+ str.gsub("=", "\%3D")
91
+ str.gsub("?", "\%3F")
92
+ str.gsub("\\", "\%5C")
93
+ str.gsub("^", "\%5E")
94
+ str.gsub("|", "\%7C")
95
+ str.gsub("~", "\%7E")
96
+ str.gsub("‘", "\%27")
97
+ str.gsub(",", "\%2C")
98
+ str
99
+ end
71
100
  end
72
101
  end
73
102
  end
@@ -1,5 +1,5 @@
1
1
  module Pulse
2
2
  module Downloader
3
- VERSION = "0.1.11"
3
+ VERSION = "0.1.12"
4
4
  end
5
5
  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.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - trex22