darkhelmet-darkext 0.5.6 → 0.6.0

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.
Files changed (3) hide show
  1. data/Manifest.txt +1 -0
  2. data/lib/darkext/net.rb +16 -0
  3. metadata +3 -2
data/Manifest.txt CHANGED
@@ -13,6 +13,7 @@ lib/darkext/float.rb
13
13
  lib/darkext/hash.rb
14
14
  lib/darkext/integer.rb
15
15
  lib/darkext/io.rb
16
+ lib/darkext/net.rb
16
17
  lib/darkext/numeric.rb
17
18
  lib/darkext/object.rb
18
19
  lib/darkext/sitemap_generator.rb
@@ -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.5.6
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-10 00:00:00 -08:00
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