wget 0.1.0 → 1.0.35

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.

Potentially problematic release.


This version of wget might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bcc4ec3fa535ab86f9f86ad55a26ab81084943da69ddc6b09c28991c2fd6b01d
4
- data.tar.gz: e01dfab48a03a011ce7a7536508b21773e1fa99c7149668d3847e7b26bd4db12
3
+ metadata.gz: cf4ddd59a6169f3d44b94ce45a7a0500da0304b9ba4fa43250532c4196caae8d
4
+ data.tar.gz: 2fe0201a819a0e3520a05206eea384825116d01e3e125f845eaad7d6594005ef
5
5
  SHA512:
6
- metadata.gz: eb3f0d1c93916169770d7486eadc9756da351e8e02fbffd17c15d1fb5f285076e5668c2063d5185c79b7a1ab27fa052d7081fa3d4139e873d5e41d269b5fa76f
7
- data.tar.gz: dd0ae28072530f828dbffd43fa4f8a329c03953546cbf37ece57eecf84d4980abc74af85fe2f8be724f9e1206db4983efb081c7bca49c66a6561cd6d89797e56
6
+ metadata.gz: e173d3df616e166085123bed5ed57cf9fe65a960d08704ae7eb7ab79f2bdc71267e8a738eb91f08e04e85e015f907837e8426463d20b21256cec5e04bacdcd11
7
+ data.tar.gz: d9bc7cb34df83133a2e79dae0a16e46ab51370b7d67bf9edd156192d0bda5181907f5b448300efccfc81508f132c2097855172403e9943b3ad521330d925fdae
data/doc/USAGE.md ADDED
@@ -0,0 +1,3 @@
1
+ Usage Instructions:
2
+ Wget.new url_here
3
+ Wget.new 'http://www.bitcoin.pdf/'
@@ -0,0 +1,59 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # require 'wget/toplevel_methods.rb'
6
+ # =========================================================================== #
7
+ class Wget
8
+
9
+ # ========================================================================= #
10
+ # === Wget.download_to?
11
+ # ========================================================================= #
12
+ def self.download_to?
13
+ LAST_DOWNLOADED_FILE
14
+ end
15
+
16
+ # ========================================================================= #
17
+ # === Wget.check_if_remote_file_exists
18
+ #
19
+ # This method will return a boolean value - true if the remote website
20
+ # (remote URL) exists, and false otherwise. The functionality depends
21
+ # on the availability of wget.
22
+ #
23
+ # The first argument is the remote target file.
24
+ #
25
+ # Note that, for a reason I am not sure, "wget --spider" does not
26
+ # always work. So perhaps "curl" is better for these cases.
27
+ #
28
+ # Invocation example:
29
+ #
30
+ # Wget.does_this_remote_website_exist? 'http://shevegen.square7.ch/rbt_changelog.html'
31
+ #
32
+ # ========================================================================= #
33
+ def self.check_if_remote_file_exists(this_file)
34
+ # ======================================================================= #
35
+ # Use wget --spider to check if the remote file exists.
36
+ # ======================================================================= #
37
+ _ = "wget --spider -v #{this_file} 2>&1"
38
+ result = `#{_}`
39
+ if result.include?('Remote file exists') or # Yes, the remote file exists.
40
+ result =~ /File '.+' exists./
41
+ remote_file_exists = true
42
+ else
43
+ remote_file_exists = false
44
+ end
45
+ if result.include? '/404'
46
+ remote_file_exists = false
47
+ end
48
+ return remote_file_exists
49
+ end; self.instance_eval { alias does_this_remote_website_exist? check_if_remote_file_exists } # === Wget.does_this_remote_website_exist?
50
+
51
+ # ========================================================================= #
52
+ # === Wget.download
53
+ # ========================================================================= #
54
+ def self.download(this_file)
55
+ _ = Wget.new(this_file)
56
+ _.try_to_report_where_we_downloaded_the_file
57
+ end
58
+
59
+ end
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # require 'wget/version/version.rb'
6
+ # =========================================================================== #
7
+ class Wget
8
+
9
+ # ========================================================================= #
10
+ # === Wget::VERSION
11
+ # ========================================================================= #
12
+ VERSION = '1.0.35'
13
+
14
+ # ========================================================================= #
15
+ # === Wget::LAST_UPDATE
16
+ # ========================================================================= #
17
+ LAST_UPDATE = '16.03.2023'
18
+
19
+ end
data/lib/wget/wget.rb ADDED
@@ -0,0 +1,355 @@
1
+ #!/usr/bin/ruby -w
2
+ # Encoding: UTF-8
3
+ # frozen_string_literal: true
4
+ # =========================================================================== #
5
+ # === Wget
6
+ #
7
+ # This ruby file is a wrapper over wget.
8
+ #
9
+ # Right now this class offers this functionality:
10
+ #
11
+ # (1) download a remote file via wget
12
+ # (2) store the location of this download in a general file.
13
+ #
14
+ # This class has originally been created before the 13.05.2006.
15
+ #
16
+ # Usage example:
17
+ #
18
+ # Wget.new(ARGV)
19
+ #
20
+ # =========================================================================== #
21
+ # require 'wget'
22
+ # =========================================================================== #
23
+ class Wget # === Wget
24
+
25
+ require 'wget/toplevel_methods.rb'
26
+ require 'wget/version/version.rb'
27
+ require 'fileutils'
28
+
29
+ begin
30
+ require 'opn'
31
+ rescue LoadError; end
32
+
33
+ begin
34
+ require 'cliner/module'
35
+ include Cliner
36
+ rescue LoadError; end
37
+
38
+ begin
39
+ require 'colours'
40
+ include Colours
41
+ rescue LoadError; end
42
+
43
+ begin
44
+ require 'save_file/module'
45
+ include SaveFile
46
+ rescue LoadError; end
47
+
48
+ # ========================================================================= #
49
+ # === BACKUP_DIR
50
+ # ========================================================================= #
51
+ BACKUP_DIR = '/home/Temp/'
52
+
53
+ # ========================================================================= #
54
+ # === LAST_DOWNLOADED_FILE
55
+ #
56
+ # The next line tells us where we keep our last downloaded file.
57
+ # ========================================================================= #
58
+ LAST_DOWNLOADED_FILE = ENV['HOME'].to_s+'/LAST_DOWNLOADED_FILE.md'
59
+
60
+ # ========================================================================= #
61
+ # === initialize
62
+ # ========================================================================= #
63
+ def initialize(
64
+ download_this = nil,
65
+ run_already = true,
66
+ &block
67
+ )
68
+ register_sigint
69
+ reset
70
+ set_url(download_this)
71
+ case run_already.to_s
72
+ when 'dont',
73
+ 'do_not',
74
+ 'dont_connect',
75
+ 'do_not_connect'
76
+ run_already = false
77
+ end
78
+ # ======================================================================= #
79
+ # === Handle blocks next
80
+ # ======================================================================= #
81
+ if block_given?
82
+ yielded = yield
83
+ # ===================================================================== #
84
+ # === Handle Hashes next
85
+ # ===================================================================== #
86
+ if yielded.is_a?(Hash) and
87
+ yielded.has_key?(:namespace)
88
+ @pass_this_to_opn = yielded.delete(:namespace)
89
+ # ===================================================================== #
90
+ # === Handle Symbols next
91
+ # ===================================================================== #
92
+ elsif yielded.is_a? Symbol
93
+ case yielded
94
+ # =================================================================== #
95
+ # === :no_check_certificate
96
+ # =================================================================== #
97
+ when :no_check_certificate
98
+ @additional_options_to_wget = '--no-check-certificate'
99
+ end
100
+ end
101
+ end
102
+ run if run_already
103
+ end
104
+
105
+ # ========================================================================= #
106
+ # === register_sigint
107
+ # ========================================================================= #
108
+ def register_sigint
109
+ Signal.trap('SIGINT') { e; exit }
110
+ end
111
+
112
+ # ========================================================================= #
113
+ # === reset
114
+ # ========================================================================= #
115
+ def reset
116
+ # ======================================================================= #
117
+ # === @remote_file_exists
118
+ # ======================================================================= #
119
+ @remote_file_exists = true
120
+ # ======================================================================= #
121
+ # === @pass_this_to_opn
122
+ # ======================================================================= #
123
+ @pass_this_to_opn = nil # Whether to pass something to Opn.opn()
124
+ # ======================================================================= #
125
+ # === @additional_options_to_wget
126
+ #
127
+ # The next variable can be used to pass additional options to "wget".
128
+ # ======================================================================= #
129
+ @additional_options_to_wget = nil
130
+ end
131
+
132
+ # ========================================================================= #
133
+ # === rds
134
+ # ========================================================================= #
135
+ def rds(i)
136
+ i.squeeze('/')
137
+ end
138
+
139
+ # ========================================================================= #
140
+ # === saving_last_downloaded_file
141
+ # ========================================================================= #
142
+ def saving_last_downloaded_file
143
+ # ======================================================================= #
144
+ # If the file was successfully downloaded, we will log this.
145
+ # ======================================================================= #
146
+ if File.exist?(local_target?)
147
+ log_this_file_was_downloaded(local_target?)
148
+ end
149
+ end
150
+
151
+ # ========================================================================= #
152
+ # === log_this_file_was_downloaded
153
+ # ========================================================================= #
154
+ def log_this_file_was_downloaded(i)
155
+ opnn; e "Next storing #{simp(i)}"
156
+ opnn; e 'in '+sfile(LAST_DOWNLOADED_FILE)
157
+ # ======================================================================= #
158
+ # As of 17.09.2014 we also add the time:
159
+ # ======================================================================= #
160
+ i << " # #{Time.now}"
161
+ save_what_into(i, LAST_DOWNLOADED_FILE)
162
+ end
163
+
164
+ # ========================================================================= #
165
+ # === consider_making_a_backup
166
+ # ========================================================================= #
167
+ def consider_making_a_backup
168
+ if remote_file_exists? and File.exist?(local_file?)
169
+ opnn; e "We will first backup the existing file at `"\
170
+ "#{sfile(local_file?)}`."
171
+ backup_existing_file(local_file?)
172
+ end
173
+ end
174
+
175
+ # ========================================================================= #
176
+ # === backup_existing_file
177
+ # ========================================================================= #
178
+ def backup_existing_file(i = local_target?)
179
+ new_target = BACKUP_DIR+File.basename(i)
180
+ opnn; e 'Now moving existing file from '+sfile(i)+
181
+ ' to '+sfile(new_target)+'.'
182
+ FileUtils.mv(i, new_target)
183
+ File.delete(i) if File.exist? i
184
+ end
185
+
186
+ # ========================================================================= #
187
+ # === local_target?
188
+ # ========================================================================= #
189
+ def local_target?
190
+ rds(Dir.pwd+'/'+File.basename(@url))
191
+ end; alias local_file? local_target? # === local_file?
192
+
193
+ # ========================================================================= #
194
+ # === download_last_url
195
+ #
196
+ # This will try to download the last saved URL.
197
+ # ========================================================================= #
198
+ def download_last_url
199
+ _ = LAST_DOWNLOADED_FILE
200
+ if File.exist? _
201
+ where = File.readlines(_).first
202
+ # ======================================================================= #
203
+ # where may include a '#' character such as in
204
+ # "/Depot/jj/pygtksourceview-2.3.0.tar.bz2 # 2015-01-05 02:37:12 +0100"
205
+ # We will eliminate this part next.
206
+ # ======================================================================= #
207
+ where = where[0, where.index('#')]
208
+ where = where.strip
209
+ return where
210
+ else
211
+ e 'The file at '+sfile(_)+' does not exist.'
212
+ end
213
+ end; alias downloaded_where? download_last_url # === downloaded_where?
214
+
215
+ # ========================================================================= #
216
+ # === url?
217
+ # ========================================================================= #
218
+ def url?
219
+ @url
220
+ end; alias input? url? # === input?
221
+
222
+ # ========================================================================= #
223
+ # === remote_file_exists?
224
+ # ========================================================================= #
225
+ def remote_file_exists?
226
+ @remote_file_exists
227
+ end; alias remote_file_exists remote_file_exists? # === remote_file_exists
228
+
229
+ # ========================================================================= #
230
+ # === Wget.remote_file_exists?
231
+ # ========================================================================= #
232
+ def self.remote_file_exists?(i)
233
+ _ = Wget.new(i, :dont_run_yet)
234
+ _.check_if_remote_file_exists
235
+ return _.remote_file_exists
236
+ end
237
+
238
+ # ========================================================================= #
239
+ # === try_to_report_where_we_downloaded_the_file
240
+ # ========================================================================= #
241
+ def try_to_report_where_we_downloaded_the_file
242
+ if downloaded_where?.include? input?
243
+ opnn; e 'We downloaded into: '+sfancy(downloaded_where?)
244
+ end
245
+ end
246
+
247
+ # ========================================================================= #
248
+ # === check_if_remote_file_exists
249
+ #
250
+ # This method will set the variable @remote_file_exists appropriately.
251
+ # ========================================================================= #
252
+ def check_if_remote_file_exists
253
+ @remote_file_exists = Wget.check_if_remote_file_exists(url?)
254
+ end
255
+
256
+ # ========================================================================= #
257
+ # === url?
258
+ # ========================================================================= #
259
+ def url?
260
+ @url
261
+ end
262
+
263
+ # ========================================================================= #
264
+ # === set_url
265
+ # ========================================================================= #
266
+ def set_url(i = nil)
267
+ i = i.first if i.is_a? Array
268
+ if i.nil?
269
+ opnn; e 'Wget: We are missing an URL.'
270
+ opnn; e 'Usage: wget [URL]'
271
+ exit
272
+ end
273
+ case i # case tag
274
+ # ======================================================================= #
275
+ # === wget --query
276
+ # ======================================================================= #
277
+ when 'QUERY?','?',
278
+ /^-?-?query$/i
279
+ opnn; e "The last downloaded URL is at #{sfancy(download_last_url)}."
280
+ exit
281
+ when 'LAST'
282
+ i = download_last_url
283
+ end
284
+ i = i.to_s.dup
285
+ i.strip!
286
+ if i.end_with? '/' or i.end_with? ':'
287
+ i.chop!
288
+ end
289
+ @url = i
290
+ end
291
+
292
+ # ========================================================================= #
293
+ # === opnn
294
+ # ========================================================================= #
295
+ def opnn(optional_pass_this = @pass_this_to_opn)
296
+ if optional_pass_this
297
+ Opn.opn(optional_pass_this)
298
+ else
299
+ Opn.opn
300
+ end
301
+ end
302
+
303
+ # ========================================================================= #
304
+ # === are_the_colours_available?
305
+ # ========================================================================= #
306
+ def are_the_colours_available?
307
+ Object.const_defined?(:Colours)
308
+ end
309
+
310
+ # ========================================================================= #
311
+ # === consider_downloading_original_file_via_wget
312
+ #
313
+ # Simply use wget to download a remote file, but only if it actually
314
+ # exists.
315
+ # ========================================================================= #
316
+ def consider_downloading_original_file_via_wget(
317
+ shall_we_check_whether_the_remove_file_exists_or_not = remote_file_exists?
318
+ )
319
+ if @additional_options_to_wget
320
+ shall_we_check_whether_the_remove_file_exists_or_not = true # Bit hackish for now.
321
+ end
322
+ if shall_we_check_whether_the_remove_file_exists_or_not
323
+ _ = "wget #{@url}"
324
+ if @additional_options_to_wget
325
+ _ << " #{@additional_options_to_wget}"
326
+ end
327
+ opnn
328
+ # ===================================================================== #
329
+ # We will display the actual command that is to be used next.
330
+ # ===================================================================== #
331
+ if are_the_colours_available?
332
+ e ::Colours.steelblue(_)
333
+ else
334
+ e _
335
+ end
336
+ system(_)
337
+ end
338
+ end
339
+
340
+ # ========================================================================= #
341
+ # === run (run tag)
342
+ # ========================================================================= #
343
+ def run
344
+ check_if_remote_file_exists
345
+ consider_making_a_backup
346
+ consider_downloading_original_file_via_wget
347
+ saving_last_downloaded_file # We save the last downloaded file, to make further use of that information.
348
+ end
349
+
350
+ end
351
+
352
+ if __FILE__ == $PROGRAM_NAME
353
+ _ = Wget.new(ARGV)
354
+ _.try_to_report_where_we_downloaded_the_file
355
+ end # wgetwrapper http://www.bitcoin.pdf/
data/lib/wget.rb CHANGED
@@ -1,26 +1 @@
1
- require "wget/version"
2
- require "uri"
3
- require "net/http"
4
-
5
- module Wget
6
- Error = Class.new(StandardError)
7
-
8
- def self.call(url, output_filename)
9
- uri = URI.parse(url)
10
- Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") do |http|
11
- request = Net::HTTP::Get.new(uri)
12
-
13
- http.request(request) do |response|
14
- raise Error, "Failed do download #{url} with http response code #{response.code}" unless response.is_a?(Net::HTTPSuccess)
15
-
16
- File.open(output_filename, "wb") do |file|
17
- response.read_body do |chunk|
18
- file.write(chunk)
19
- end
20
- end
21
- end
22
- end
23
- rescue Errno::ECONNREFUSED => e
24
- raise Error, "Failed to download #{url}: #{e.message}"
25
- end
26
- end
1
+ require 'wget/wget.rb'
data/wget.gemspec CHANGED
@@ -1,40 +1,38 @@
1
+ # =========================================================================== #
2
+ # Gemspec for Project ruby Wget.
3
+ # =========================================================================== #
4
+ require 'wget/version/version.rb'
5
+ require 'roebe'
1
6
 
2
- lib = File.expand_path("../lib", __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require "wget/version"
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "wget"
8
- spec.version = Wget::VERSION
9
- spec.authors = ["Andrei Kaleshka"]
10
- spec.email = ["andrei@widefix.com"]
11
-
12
- spec.summary = %q{Effortlessly download files from the internet using Ruby.}
13
- spec.description = %q{This addition to the Ruby standard library introduces a simple and intuitive DSL, making it easy to download files from the internet without unnecessary complexity or verbosity.}
14
- spec.homepage = "https://github.com/widefix/wget"
15
- spec.license = "MIT"
16
-
17
- # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
- # to allow pushing to a single host or delete this section to allow pushing to any host.
19
- if spec.respond_to?(:metadata)
20
- spec.metadata["homepage_uri"] = spec.homepage
21
- spec.metadata["source_code_uri"] = "https://github.com/widefix/wget"
22
- spec.metadata["changelog_uri"] = "https://github.com/widefix/wget/CHANGELONG.md"
23
- else
24
- raise "RubyGems 2.0 or newer is required to protect against " \
25
- "public gem pushes."
26
- end
27
-
28
- # Specify which files should be added to the gem when it is released.
29
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
30
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
31
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
32
- end
33
- spec.bindir = "exe"
34
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
35
- spec.require_paths = ["lib"]
36
-
37
- spec.add_development_dependency "rake", "~> 10.0"
38
- spec.add_development_dependency "minitest", "~> 5.0"
39
- spec.add_development_dependency "debug"
40
- end
7
+ Gem::Specification.new { |s|
8
+
9
+ s.name = 'wget'
10
+ s.version = Wget::VERSION
11
+ s.date = Time.now.strftime('%Y-%m-%d')
12
+
13
+ s.summary = <<-EOF
14
+ EOF
15
+
16
+ s.description = <<-EOF
17
+
18
+ This library is called wget.
19
+
20
+ EOF
21
+
22
+ s.extra_rdoc_files = %w()
23
+
24
+ s.authors = ['Robert A. Heiler']
25
+ s.email = Roebe.email?
26
+ s.files = Dir['**/*']
27
+ s.license = 'GPL-2.0'
28
+ s.homepage = 'https://rubygems.org/gems/wget'
29
+
30
+ s.required_ruby_version = '>= '+RUBY_VERSION
31
+ s.required_rubygems_version = '>= '+Gem::VERSION
32
+ s.rubygems_version = '>= '+Gem::VERSION
33
+
34
+ s.add_dependency 'opn'
35
+ s.add_dependency 'colours'
36
+ s.add_dependency 'save_file'
37
+
38
+ }
metadata CHANGED
@@ -1,88 +1,76 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wget
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.35
5
5
  platform: ruby
6
6
  authors:
7
- - Andrei Kaleshka
7
+ - Robert A. Heiler
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2025-01-25 00:00:00.000000000 Z
11
+ date: 2023-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rake
14
+ name: opn
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '10.0'
20
- type: :development
19
+ version: '0'
20
+ type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '10.0'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: minitest
28
+ name: colours
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '5.0'
34
- type: :development
33
+ version: '0'
34
+ type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '5.0'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: debug
42
+ name: save_file
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
- type: :development
48
+ type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- description: This addition to the Ruby standard library introduces a simple and intuitive
56
- DSL, making it easy to download files from the internet without unnecessary complexity
57
- or verbosity.
58
- email:
59
- - andrei@widefix.com
55
+ description: |2+
56
+
57
+ This library is called wget.
58
+
59
+ email: shevy@inbox.lt
60
60
  executables: []
61
61
  extensions: []
62
62
  extra_rdoc_files: []
63
63
  files:
64
- - ".gitignore"
65
- - ".ruby-version"
66
- - CHANGELOG.md
67
- - CODE_OF_CONDUCT.md
68
- - Gemfile
69
- - Gemfile.lock
70
- - LICENSE.txt
71
- - README.md
72
- - Rakefile
73
- - bin/console
74
- - bin/setup
64
+ - doc/USAGE.md
75
65
  - lib/wget.rb
76
- - lib/wget/version.rb
77
- - test.md
66
+ - lib/wget/toplevel_methods.rb
67
+ - lib/wget/version/version.rb
68
+ - lib/wget/wget.rb
78
69
  - wget.gemspec
79
- homepage: https://github.com/widefix/wget
70
+ homepage: https://rubygems.org/gems/wget
80
71
  licenses:
81
- - MIT
82
- metadata:
83
- homepage_uri: https://github.com/widefix/wget
84
- source_code_uri: https://github.com/widefix/wget
85
- changelog_uri: https://github.com/widefix/wget/CHANGELONG.md
72
+ - GPL-2.0
73
+ metadata: {}
86
74
  post_install_message:
87
75
  rdoc_options: []
88
76
  require_paths:
@@ -91,15 +79,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
91
79
  requirements:
92
80
  - - ">="
93
81
  - !ruby/object:Gem::Version
94
- version: '0'
82
+ version: 3.2.1
95
83
  required_rubygems_version: !ruby/object:Gem::Requirement
96
84
  requirements:
97
85
  - - ">="
98
86
  - !ruby/object:Gem::Version
99
- version: '0'
87
+ version: 3.4.8
100
88
  requirements: []
101
- rubygems_version: 3.3.7
89
+ rubygems_version: 3.4.8
102
90
  signing_key:
103
91
  specification_version: 4
104
- summary: Effortlessly download files from the internet using Ruby.
92
+ summary: ''
105
93
  test_files: []
94
+ ...
data/.gitignore DELETED
@@ -1,8 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 3.1.2
data/CHANGELOG.md DELETED
@@ -1,3 +0,0 @@
1
- ## v0.1.0
2
-
3
- - Initial release
data/CODE_OF_CONDUCT.md DELETED
@@ -1,74 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, gender identity and expression, level of experience,
9
- nationality, personal appearance, race, religion, or sexual identity and
10
- orientation.
11
-
12
- ## Our Standards
13
-
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
16
-
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
22
-
23
- Examples of unacceptable behavior by participants include:
24
-
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
28
- * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
31
- * Other conduct which could reasonably be considered inappropriate in a
32
- professional setting
33
-
34
- ## Our Responsibilities
35
-
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
39
-
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
45
-
46
- ## Scope
47
-
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
54
-
55
- ## Enforcement
56
-
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at ka8725@gmail.com. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
63
-
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
67
-
68
- ## Attribution
69
-
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [http://contributor-covenant.org/version/1/4][version]
72
-
73
- [homepage]: http://contributor-covenant.org
74
- [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile DELETED
@@ -1,6 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
-
5
- # Specify your gem's dependencies in wget.gemspec
6
- gemspec
data/Gemfile.lock DELETED
@@ -1,36 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- wget (0.1.0)
5
-
6
- GEM
7
- remote: https://rubygems.org/
8
- specs:
9
- debug (1.9.2)
10
- irb (~> 1.10)
11
- reline (>= 0.3.8)
12
- io-console (0.7.2)
13
- irb (1.14.0)
14
- rdoc (>= 4.0.0)
15
- reline (>= 0.4.2)
16
- minitest (5.25.4)
17
- psych (5.1.2)
18
- stringio
19
- rake (10.5.0)
20
- rdoc (6.7.0)
21
- psych (>= 4.0.0)
22
- reline (0.5.9)
23
- io-console (~> 0.5)
24
- stringio (3.1.1)
25
-
26
- PLATFORMS
27
- arm64-darwin-23
28
-
29
- DEPENDENCIES
30
- debug
31
- minitest (~> 5.0)
32
- rake (~> 10.0)
33
- wget!
34
-
35
- BUNDLED WITH
36
- 2.4.22
data/LICENSE.txt DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2025 Andrei Kaleshka
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
data/README.md DELETED
@@ -1,51 +0,0 @@
1
- # Wget
2
-
3
- Download files from the internet with ease. It's a wrapper around the standard Ruby `net/http` library. Large files are downloaded in chunks to avoid memory issues.
4
-
5
- Why use this gem? The `net/http` library is verbose and can be tricky for newcomers.
6
-
7
- ## Installation
8
-
9
- Add this line to your application's Gemfile:
10
-
11
- ```ruby
12
- gem 'wget'
13
- ```
14
-
15
- And then execute:
16
-
17
- $ bundle
18
-
19
- Or install it yourself as:
20
-
21
- $ gem install wget
22
-
23
- ## Usage
24
-
25
- Use the `Wget.call` method to download a file from the internet. The method takes two arguments: the URL of the file to download and the filename to save the file as. The method will download the file and save it with the specified filename.
26
-
27
- Refer to the example below:
28
-
29
- ```ruby
30
- filename = "test.md"
31
- url = "https://raw.githubusercontent.com/widefix/actual_db_schema/refs/heads/main/README.md"
32
- Wget.call(url, filename)
33
- ```
34
-
35
- ## Development
36
-
37
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
38
-
39
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
40
-
41
- ## Contributing
42
-
43
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/wget. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
44
-
45
- ## License
46
-
47
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
48
-
49
- ## Code of Conduct
50
-
51
- Everyone interacting in the Wget project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/wget/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile DELETED
@@ -1,10 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rake/testtask"
3
-
4
- Rake::TestTask.new(:test) do |t|
5
- t.libs << "test"
6
- t.libs << "lib"
7
- t.test_files = FileList["test/**/*_test.rb"]
8
- end
9
-
10
- task :default => :test
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "wget"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
data/lib/wget/version.rb DELETED
@@ -1,3 +0,0 @@
1
- module Wget
2
- VERSION = "0.1.0"
3
- end
data/test.md DELETED
File without changes