url_status 0.0.1
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.
- checksums.yaml +15 -0
- data/lib/url_status.rb +40 -0
- metadata +44 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
MGU2Nzc4NzRhNjIzMWE0MmFkM2U3M2NjYzVkM2EwMmE4ZjU1NDljMQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
OTlhNTBkZTBhY2E3YWUzZjIyZmRkMjNlMzFkZjc3N2VkOWEzZDJiMg==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
YzBhODVlZDVmOWExMDBmNWVkN2JiMjQ5YTljZGZhNWUyYTllZmY3YjcwZDU1
|
10
|
+
ZmIxZTM5ZGU2M2ZhYjZlZTIyYmUyOGIyYmJiMTNhODc1NGRkY2M3NDI0MTcy
|
11
|
+
YWZkNzg4MzcyMjIyYzJiYzRhOGU3ZGQ1ZjVmODVkNjIyYTk2OGM=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ZThkNzJhYTY2YWM2Nzk5YzI5NWEzMDA5NGYyNzNjNDYwMDY3M2M1NzZlM2M2
|
14
|
+
ODMzYmFlZjUzMTcyNTg1OGM2NTQwNjY1YzU4NmYyMDlhOTlhZDI4ZTgxZDZm
|
15
|
+
MDkwMjFlNjQ4Nzg2ZGMxZmY3MjZjYmM5NjY2NTQ3YjNiZjY2ZGU=
|
data/lib/url_status.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
class Url_status
|
2
|
+
|
3
|
+
def self.status(url)
|
4
|
+
if url=="" then
|
5
|
+
@code="not url found"
|
6
|
+
else
|
7
|
+
begin
|
8
|
+
require 'net/http'
|
9
|
+
require 'uri'
|
10
|
+
res = Net::HTTP.get_response(URI(url))
|
11
|
+
|
12
|
+
rescue
|
13
|
+
@code="Incorrrect url"
|
14
|
+
else
|
15
|
+
@code=res.code
|
16
|
+
ensure
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
def self.message(url)
|
21
|
+
if url=="" then
|
22
|
+
@code="not url found"
|
23
|
+
else
|
24
|
+
begin
|
25
|
+
require 'net/http'
|
26
|
+
require 'uri'
|
27
|
+
res = Net::HTTP.get_response(URI(url))
|
28
|
+
|
29
|
+
rescue
|
30
|
+
@message="Incorrrect url"
|
31
|
+
else
|
32
|
+
@message=res.message
|
33
|
+
ensure
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
metadata
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: url_status
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- as
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-04-28 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Confirm that the url is online....require 'net/http' and require 'uri
|
14
|
+
email: antonio_sirera@yahoo.es
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- lib/url_status.rb
|
20
|
+
homepage: http://rubygems.org/gems/url_status
|
21
|
+
licenses:
|
22
|
+
- ''
|
23
|
+
metadata: {}
|
24
|
+
post_install_message:
|
25
|
+
rdoc_options: []
|
26
|
+
require_paths:
|
27
|
+
- lib
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
requirements: []
|
39
|
+
rubyforge_project:
|
40
|
+
rubygems_version: 2.2.2
|
41
|
+
signing_key:
|
42
|
+
specification_version: 4
|
43
|
+
summary: Confirm that the url is online....!
|
44
|
+
test_files: []
|