fe_core_ext 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -1
- data/bin/console +4 -2
- data/lib/fe_core_ext/core_ext/uri.rb +9 -0
- data/lib/fe_core_ext/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f06e084d44efa2d19f7efada870d33bcd135d3c
|
4
|
+
data.tar.gz: 853f4e1aa04376d9982a66a0da5aab8d6fbe28ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee20ad08ea9b7f9074473257445ad2f8fe7e480079aaaaf7dcee52fd6434d3fb894ebe7fc238a18d117399431ad5153af7ba4a5105d31dba21669ae21d4e45d9
|
7
|
+
data.tar.gz: 50780771ae9384b797403d882453e35a69918a875c61fe4d39d5e981a858d911178202cf71c61d583b1ba4fdb65ed00c08e3d79e906e74b9a605dbe9f4b0f6fd
|
data/Gemfile
CHANGED
data/bin/console
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'uri'
|
2
2
|
require 'open-uri'
|
3
|
+
require 'net/http'
|
3
4
|
|
4
5
|
module FeCoreExt::CoreExt
|
5
6
|
end
|
@@ -9,6 +10,14 @@ module URI
|
|
9
10
|
binary = OpenURI.open_uri(self).read
|
10
11
|
File.open(file, 'wb') {|f| f.write(binary)}
|
11
12
|
end
|
13
|
+
|
14
|
+
def exists?
|
15
|
+
req = Net::HTTP.new(host, port)
|
16
|
+
req.use_ssl = true if scheme == 'https'
|
17
|
+
res = req.request_head(path)
|
18
|
+
return URI(res['location']).exists? if %w(301 302).include?(res.code)
|
19
|
+
res.code == '200'
|
20
|
+
end
|
12
21
|
end
|
13
22
|
|
14
23
|
class URI::Generic
|
data/lib/fe_core_ext/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fe_core_ext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tetsu
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|