wget 0.1.0 → 1.0.32

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: ad31778ad08cc8108dcf5cdfeefc022cf7568581138e6a9bfe6052c7ba8f248d
4
+ data.tar.gz: 12bc4475b3332e1e335662861fb26917c21819af41e9c0c6612d093b087f3efa
5
5
  SHA512:
6
- metadata.gz: eb3f0d1c93916169770d7486eadc9756da351e8e02fbffd17c15d1fb5f285076e5668c2063d5185c79b7a1ab27fa052d7081fa3d4139e873d5e41d269b5fa76f
7
- data.tar.gz: dd0ae28072530f828dbffd43fa4f8a329c03953546cbf37ece57eecf84d4980abc74af85fe2f8be724f9e1206db4983efb081c7bca49c66a6561cd6d89797e56
6
+ metadata.gz: bf4360c29c0254e8ca7b6907cf3bc0285b6de2494c434029b4f63e2b8f32acf163f6a6f0954949f1e6576df908724f0582f7744e5531f160e6e65f746ae1fa15
7
+ data.tar.gz: fc70df81e7b78edb1466bfd2653f4a22d460d7d4fdf926593b1830fd4e7882f037f82bd7274248cf4d6a560b3c38f640e175374956e1dac95687f3addb101a37
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,56 @@
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 target file.
24
+ #
25
+ # Invocation example:
26
+ #
27
+ # Wget.does_this_remote_website_exist? 'http://shevegen.square7.ch/rbt_changelog.html'
28
+ #
29
+ # ========================================================================= #
30
+ def self.check_if_remote_file_exists(this_file)
31
+ # ======================================================================= #
32
+ # Use wget --spider to check if the remote file exists.
33
+ # ======================================================================= #
34
+ _ = "wget --spider -v #{this_file} 2>&1"
35
+ result = `#{_}`
36
+ if result.include?('Remote file exists') or # Yes, the remote file exists.
37
+ result =~ /File '.+' exists./
38
+ remote_file_exists = true
39
+ else
40
+ remote_file_exists = false
41
+ end
42
+ if result.include? '/404'
43
+ remote_file_exists = false
44
+ end
45
+ return remote_file_exists
46
+ end; self.instance_eval { alias does_this_remote_website_exist? check_if_remote_file_exists } # === Wget.does_this_remote_website_exist?
47
+
48
+ # ========================================================================= #
49
+ # === Wget.download
50
+ # ========================================================================= #
51
+ def self.download(this_file)
52
+ _ = Wget.new(this_file)
53
+ _.try_to_report_where_we_downloaded_the_file
54
+ end
55
+
56
+ end
@@ -0,0 +1,14 @@
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.32'
13
+
14
+ end
data/lib/wget/wget.rb ADDED
@@ -0,0 +1,303 @@
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
+ # Usage example:
15
+ #
16
+ # Wget.new(ARGV)
17
+ #
18
+ # =========================================================================== #
19
+ # require 'wget'
20
+ # =========================================================================== #
21
+ require 'wget/toplevel_methods.rb'
22
+ require 'wget/version/version.rb'
23
+
24
+ class Wget # === Wget.new
25
+
26
+ require 'fileutils'
27
+
28
+ begin
29
+ require 'opn'
30
+ rescue LoadError; end
31
+
32
+ begin
33
+ require 'cliner/module'
34
+ include Cliner
35
+ rescue LoadError; end
36
+
37
+ begin
38
+ require 'colours'
39
+ include Colours
40
+ rescue LoadError; end
41
+
42
+ begin
43
+ require 'save_file/module'
44
+ include SaveFile
45
+ rescue LoadError; end
46
+
47
+ # ========================================================================= #
48
+ # === BACKUP_DIR
49
+ # ========================================================================= #
50
+ BACKUP_DIR = '/home/Temp/'
51
+
52
+ # ========================================================================= #
53
+ # === LAST_DOWNLOADED_FILE
54
+ #
55
+ # The next line tells us where we keep our last downloaded file.
56
+ # ========================================================================= #
57
+ LAST_DOWNLOADED_FILE = ENV['HOME'].to_s+'/LAST_DOWNLOADED_FILE.md'
58
+
59
+ # ========================================================================= #
60
+ # === initialize
61
+ # ========================================================================= #
62
+ def initialize(
63
+ download_this = nil,
64
+ run_already = true
65
+ )
66
+ register_sigint
67
+ reset
68
+ set_url(download_this)
69
+ case run_already.to_s
70
+ when 'dont','do_not','dont_connect','do_not_connect'
71
+ run_already = false
72
+ end
73
+ if block_given?
74
+ yielded = yield
75
+ if yielded.is_a?(Hash) and
76
+ yielded.has_key?(:namespace)
77
+ @pass_this_to_opn = yielded.delete(:namespace)
78
+ end
79
+ end
80
+ run if run_already
81
+ end
82
+
83
+ # ========================================================================= #
84
+ # === register_sigint
85
+ # ========================================================================= #
86
+ def register_sigint
87
+ Signal.trap('SIGINT') { e; exit }
88
+ end
89
+
90
+ # ========================================================================= #
91
+ # === reset
92
+ # ========================================================================= #
93
+ def reset
94
+ # ======================================================================= #
95
+ # === @remote_file_exists
96
+ # ======================================================================= #
97
+ @remote_file_exists = true
98
+ # ======================================================================= #
99
+ # === @pass_this_to_opn
100
+ # ======================================================================= #
101
+ @pass_this_to_opn = nil # Whether to pass something to Opn.opn()
102
+ end
103
+
104
+ # ========================================================================= #
105
+ # === rds
106
+ # ========================================================================= #
107
+ def rds(i)
108
+ i.squeeze('/')
109
+ end
110
+
111
+ # ========================================================================= #
112
+ # === saving_last_downloaded_file
113
+ # ========================================================================= #
114
+ def saving_last_downloaded_file
115
+ # ======================================================================= #
116
+ # If the file was successfully downloaded, we will log this.
117
+ # ======================================================================= #
118
+ if File.exist?(local_target?)
119
+ log_this_file_was_downloaded(local_target?)
120
+ end
121
+ end
122
+
123
+ # ========================================================================= #
124
+ # === log_this_file_was_downloaded
125
+ # ========================================================================= #
126
+ def log_this_file_was_downloaded(i)
127
+ opnn; e "Next storing #{simp(i)}"
128
+ opnn; e 'in '+sfile(LAST_DOWNLOADED_FILE)
129
+ # ======================================================================= #
130
+ # As of 17.09.2014 we also add the time:
131
+ # ======================================================================= #
132
+ i << " # #{Time.now}"
133
+ save_what_into(i, LAST_DOWNLOADED_FILE)
134
+ end
135
+
136
+ # ========================================================================= #
137
+ # === consider_making_a_backup
138
+ # ========================================================================= #
139
+ def consider_making_a_backup
140
+ if remote_file_exists? and File.exist?(local_file?)
141
+ opnn; e "We will first backup the existing file at `"\
142
+ "#{sfile(local_file?)}`."
143
+ backup_existing_file(local_file?)
144
+ end
145
+ end
146
+
147
+ # ========================================================================= #
148
+ # === backup_existing_file
149
+ # ========================================================================= #
150
+ def backup_existing_file(i = local_target?)
151
+ new_target = BACKUP_DIR+File.basename(i)
152
+ opnn; e 'Now moving existing file from '+sfile(i)+
153
+ ' to '+sfile(new_target)+'.'
154
+ FileUtils.mv(i, new_target)
155
+ File.delete(i) if File.exist? i
156
+ end
157
+
158
+ # ========================================================================= #
159
+ # === local_target?
160
+ # ========================================================================= #
161
+ def local_target?
162
+ rds(Dir.pwd+'/'+File.basename(@url))
163
+ end; alias local_file? local_target? # === local_file?
164
+
165
+ # ========================================================================= #
166
+ # === consider_downloading_original_file_via_wget
167
+ #
168
+ # Simply use wget to download a remote file, but only if it actually
169
+ # exists.
170
+ # ========================================================================= #
171
+ def consider_downloading_original_file_via_wget
172
+ if remote_file_exists?
173
+ _ = "wget #{@url}"
174
+ opnn; e _
175
+ system(_)
176
+ end
177
+ end
178
+
179
+ # ========================================================================= #
180
+ # === download_last_url
181
+ #
182
+ # This will try to download the last saved URL.
183
+ # ========================================================================= #
184
+ def download_last_url
185
+ _ = LAST_DOWNLOADED_FILE
186
+ if File.exist? _
187
+ where = File.readlines(_).first
188
+ # ======================================================================= #
189
+ # where may include a '#' character such as in
190
+ # "/Depot/jj/pygtksourceview-2.3.0.tar.bz2 # 2015-01-05 02:37:12 +0100"
191
+ # We will eliminate this part next.
192
+ # ======================================================================= #
193
+ where = where[0, where.index('#')]
194
+ where = where.strip
195
+ return where
196
+ else
197
+ e 'The file at '+sfile(_)+' does not exist.'
198
+ end
199
+ end; alias downloaded_where? download_last_url # === downloaded_where?
200
+
201
+ # ========================================================================= #
202
+ # === url?
203
+ # ========================================================================= #
204
+ def url?
205
+ @url
206
+ end; alias input? url? # === input?
207
+
208
+ # ========================================================================= #
209
+ # === remote_file_exists?
210
+ # ========================================================================= #
211
+ def remote_file_exists?
212
+ @remote_file_exists
213
+ end; alias remote_file_exists remote_file_exists? # === remote_file_exists
214
+
215
+ # ========================================================================= #
216
+ # === Wget.remote_file_exists?
217
+ # ========================================================================= #
218
+ def self.remote_file_exists?(i)
219
+ _ = Wget.new(i, :dont_run_yet)
220
+ _.check_if_remote_file_exists
221
+ return _.remote_file_exists
222
+ end
223
+
224
+ # ========================================================================= #
225
+ # === try_to_report_where_we_downloaded_the_file
226
+ # ========================================================================= #
227
+ def try_to_report_where_we_downloaded_the_file
228
+ if downloaded_where?.include? input?
229
+ opnn; e 'We downloaded into: '+sfancy(downloaded_where?)
230
+ end
231
+ end
232
+
233
+ # ========================================================================= #
234
+ # === check_if_remote_file_exists
235
+ #
236
+ # This method will set the variable @remote_file_exists appropriately.
237
+ # ========================================================================= #
238
+ def check_if_remote_file_exists
239
+ @remote_file_exists = Wget.check_if_remote_file_exists(url?)
240
+ end
241
+
242
+ # ========================================================================= #
243
+ # === url?
244
+ # ========================================================================= #
245
+ def url?
246
+ @url
247
+ end
248
+
249
+ # ========================================================================= #
250
+ # === set_url
251
+ # ========================================================================= #
252
+ def set_url(i = nil)
253
+ i = i.first if i.is_a? Array
254
+ if i.nil?
255
+ opnn; e 'Wget: We are missing an URL.'
256
+ opnn; e 'Usage: wget [URL]'
257
+ exit
258
+ end
259
+ case i # case tag
260
+ # ======================================================================= #
261
+ # === wget --query
262
+ # ======================================================================= #
263
+ when 'QUERY?','?','--query'
264
+ opnn; e 'The last downloaded URL is at '+sfancy(download_last_url)+'.'
265
+ exit
266
+ when 'LAST'
267
+ i = download_last_url
268
+ end
269
+ i = i.to_s.dup
270
+ i.strip!
271
+ if i.end_with? '/' or i.end_with? ':'
272
+ i.chop!
273
+ end
274
+ @url = i
275
+ end
276
+
277
+ # ========================================================================= #
278
+ # === opnn
279
+ # ========================================================================= #
280
+ def opnn(optional_pass_this = @pass_this_to_opn)
281
+ if optional_pass_this
282
+ Opn.opn(optional_pass_this)
283
+ else
284
+ Opn.opn
285
+ end
286
+ end
287
+
288
+ # ========================================================================= #
289
+ # === run (run tag)
290
+ # ========================================================================= #
291
+ def run
292
+ check_if_remote_file_exists
293
+ consider_making_a_backup
294
+ consider_downloading_original_file_via_wget
295
+ saving_last_downloaded_file # We save the last downloaded file, to make further use of that information.
296
+ end
297
+
298
+ end
299
+
300
+ if __FILE__ == $PROGRAM_NAME
301
+ _ = Wget.new(ARGV)
302
+ _.try_to_report_where_we_downloaded_the_file
303
+ 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,43 @@
1
+ # =========================================================================== #
2
+ # Gemspec for Project ruby Wget.
3
+ # =========================================================================== #
4
+ require 'wget/version/version.rb'
1
5
 
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
6
+ Gem::Specification.new { |s|
7
+
8
+ s.name = 'wget'
9
+ s.version = Wget::VERSION
10
+ s.date = Time.now.strftime('%Y-%m-%d')
11
+
12
+ s.summary = <<-EOF
13
+
14
+ If you have specific suggestions to make this gem more
15
+ useful for others, please drop me an email at:
16
+ shevegen@gmail.com
17
+ Thank you.
18
+
19
+ EOF
20
+
21
+ s.description = <<-EOF
22
+
23
+ This library is called wget.
24
+
25
+ EOF
26
+
27
+ s.extra_rdoc_files = %w()
28
+
29
+ s.authors = ['Robert A. Heiler']
30
+ s.email = 'shevegen@gmail.com'
31
+ s.files = Dir['**/*']
32
+ s.license = 'GPL-2.0'
33
+ s.homepage = 'http://rubygems.org/gems/wget'
34
+
35
+ s.required_ruby_version = '>= '+RUBY_VERSION
36
+ s.required_rubygems_version = '>= '+Gem::VERSION
37
+ s.rubygems_version = '>= '+Gem::VERSION
38
+
39
+ s.add_dependency 'opn'
40
+ s.add_dependency 'colours'
41
+ s.add_dependency 'save_file'
42
+
43
+ }
metadata CHANGED
@@ -1,89 +1,77 @@
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.32
5
5
  platform: ruby
6
6
  authors:
7
- - Andrei Kaleshka
8
- autorequire:
9
- bindir: exe
7
+ - Robert A. Heiler
8
+ autorequire:
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2025-01-25 00:00:00.000000000 Z
11
+ date: 2020-11-10 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: shevegen@gmail.com
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: http://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
86
- post_install_message:
72
+ - GPL-2.0
73
+ metadata: {}
74
+ post_install_message:
87
75
  rdoc_options: []
88
76
  require_paths:
89
77
  - lib
@@ -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: 2.7.2
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.1.4
100
88
  requirements: []
101
- rubygems_version: 3.3.7
102
- signing_key:
89
+ rubygems_version: 3.1.4
90
+ signing_key:
103
91
  specification_version: 4
104
- summary: Effortlessly download files from the internet using Ruby.
92
+ summary: 'If you have specific suggestions to make this gem more useful for others,
93
+ please drop me an email at: shevegen@gmail.com Thank you.'
105
94
  test_files: []
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