darkhelmet-darkext 0.5.6 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest.txt +1 -0
- data/lib/darkext/net.rb +16 -0
- metadata +3 -2
data/Manifest.txt
CHANGED
data/lib/darkext/net.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'net/http'
|
2
|
+
|
3
|
+
module Net
|
4
|
+
def self.download(url)
|
5
|
+
Net::HTTP.get_response(URI.parse(url))
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.download_and_save(url,path = nil)
|
9
|
+
if path.nil?
|
10
|
+
path = File.expand_path(url.split('/').last)
|
11
|
+
else
|
12
|
+
path = File.expand_path(path)
|
13
|
+
end
|
14
|
+
open(path,'w') { |file| file.write(download(url)) }
|
15
|
+
end
|
16
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: darkhelmet-darkext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Huckstep
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-02-
|
12
|
+
date: 2009-02-11 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -56,6 +56,7 @@ files:
|
|
56
56
|
- lib/darkext/hash.rb
|
57
57
|
- lib/darkext/integer.rb
|
58
58
|
- lib/darkext/io.rb
|
59
|
+
- lib/darkext/net.rb
|
59
60
|
- lib/darkext/numeric.rb
|
60
61
|
- lib/darkext/object.rb
|
61
62
|
- lib/darkext/sitemap_generator.rb
|