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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ef2304ca0cbb3407bcc2de0c91a1fddeaec8c98a
4
- data.tar.gz: e36f361c9d3f0d6ca595ddb6e30e94fe71207933
3
+ metadata.gz: 4f06e084d44efa2d19f7efada870d33bcd135d3c
4
+ data.tar.gz: 853f4e1aa04376d9982a66a0da5aab8d6fbe28ce
5
5
  SHA512:
6
- metadata.gz: 6a56d397b8461e92d8ad154870b6bfc418ffc4790e8fead648a3cbf64e2b46ed9f98d53a72bf92db4ce9affc7af0ee8c4339bdbce9bbb75b1e359902df565255
7
- data.tar.gz: e6a0c2773e5cae5ded3027573802f8e6355db64bf2c4adf0cb14be85504a5cd6df49cf2a8e01ac3dd8826f3bb3d15f4adaf91b31797a523938acc1f3f2ddea65
6
+ metadata.gz: ee20ad08ea9b7f9074473257445ad2f8fe7e480079aaaaf7dcee52fd6434d3fb894ebe7fc238a18d117399431ad5153af7ba4a5105d31dba21669ae21d4e45d9
7
+ data.tar.gz: 50780771ae9384b797403d882453e35a69918a875c61fe4d39d5e981a858d911178202cf71c61d583b1ba4fdb65ed00c08e3d79e906e74b9a605dbe9f4b0f6fd
data/Gemfile CHANGED
@@ -5,4 +5,6 @@ gemspec
5
5
 
6
6
  gem 'bigdecimal'
7
7
  gem 'timecop'
8
- gem 'test-unit'
8
+ gem 'test-unit'
9
+ gem 'pry'
10
+ gem 'awesome_print'
data/bin/console CHANGED
@@ -10,5 +10,7 @@ require "fe_core_ext"
10
10
  # require "pry"
11
11
  # Pry.start
12
12
 
13
- require "irb"
14
- IRB.start
13
+ #require "irb"
14
+ require 'pry'
15
+ Pry.start
16
+ #IRB.start
@@ -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
@@ -1,3 +1,3 @@
1
1
  module FeCoreExt
2
- VERSION = '0.5.0'
2
+ VERSION = '0.6.0'
3
3
  end
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.5.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-06-27 00:00:00.000000000 Z
11
+ date: 2018-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport