grd 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +8 -8
  2. data/bin/grd +3 -10
  3. data/lib/grd/version.rb +1 -1
  4. data/lib/grd.rb +14 -1
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MzE1MWRjMDdiNzgzZDdkZTYxNjZmOTBiNTg5ODFiY2NjMmZhYzQzNQ==
4
+ MjdmODQ1Y2MwOGM3YWMzYzA1MzA2MDRmMjVkNmQ0YjI3YmMxY2M1Yw==
5
5
  data.tar.gz: !binary |-
6
- ZGU4NWExOTYzMmRjMjU4YTExZGRlODM5YTc3ODNiYTc2M2Q1ZTE2MQ==
6
+ YzRmYzViYzhkNjU3ZDI3N2QzZTc5Y2MxM2E4MTdkN2E3NTg5Yzc0Nw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NmE0MDZjY2I1ZTBiZDZiNTkwMDc1YTY0NzQ5N2UzMGU0NGZhODhjNDEyNDQx
10
- YTViZjJjODk1NzEzNzMxYjBkNTFhYzYyOTg1NzFiZTRjMDhlYjY4Y2VhOWU0
11
- ZDc3YTBjYTc2OGI5OTQzNDlhNmM1ZjViNzVhYmY3OGNmY2ZjMmE=
9
+ Yjk5Yzc1MGYxMDhhMTFjZGJlMGIxMDgxOWJkY2Y5YjhmY2U1Y2FjMmZiNTFl
10
+ YWIyMTlkNTZjNDBkMjM1ZDU4ZGZjMzMxYzQzYmFkYTdkNzcyMzdlNTBkYjVj
11
+ MWVmYzgwNjYyZDAwM2Q2ZTU4ZWU5OWI1ZWRjNDMzNTM1YzBhOWE=
12
12
  data.tar.gz: !binary |-
13
- ODI3YmEzY2VhNDQwNjhiYjM0Y2Y1YTBiY2IxZGM1ZmM3YTY5MjgyMDM0ZTc0
14
- OGY0ZGNlNjRkZDM0YTg1NTNkNGJiYTBkY2VjMGMyZmU5OGVjNzQ2OWQ2OGQ4
15
- NDhmZjJiNWE4MTYxNWRlOWViNjljMTNiOGNhMmIzNjNjZDg2MTE=
13
+ OTg3OWZiZmQ0ZmExZTkyODBmN2NhNTdiYjg4YTdlZDM4NTU4ZWRlZWM1MDdk
14
+ ZTNhOTk2ZGRlNjY3ZjdjYmZlYTNjNjJlMWJiNzM1MzVlYjdhMGEzZDBmOTcy
15
+ YjAxNTAwMDY2NDk5N2JiODFiN2Y0MDU4MDY4MzMxNzk0ZWRmODE=
data/bin/grd CHANGED
@@ -1,17 +1,10 @@
1
1
  #!/usr/bin/ruby
2
-
2
+ #$: << File.join(File.dirname(__FILE__), '../lib')
3
+ require 'grd'
3
4
  # GRD (Get ReDirect)
4
5
 
5
6
  begin
6
- require 'net/http'
7
-
8
- val = ARGV[0].dup
9
- val.prepend('http://') unless !!val['http://']
10
- uri = URI.parse val
11
- req = Net::HTTP::Get.new(uri.request_uri)
12
- puts Net::HTTP.new(uri.host).start { |server|
13
- server.request(req)
14
- }["location"]
7
+ GRD::getredirect(ARGV[0])
15
8
  rescue Exception => e
16
9
  puts "Get ReDirect: Get the URL redirection."
17
10
  puts "by Daniel P. Clark / License: The MIT License"
data/lib/grd/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module GRD
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/grd.rb CHANGED
@@ -1 +1,14 @@
1
- require 'grd/version'
1
+ require 'grd/version'
2
+ require 'net/http'
3
+
4
+ module GRD
5
+ def self.getredirect(in_url)
6
+ val = in_url.dup
7
+ val.prepend('http://') unless !!val['http://']
8
+ uri = URI.parse val
9
+ req = Net::HTTP::Get.new(uri.request_uri)
10
+ puts Net::HTTP.new(uri.host).start { |server|
11
+ server.request(req)
12
+ }["location"]
13
+ end
14
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel P. Clark / 6ftDan(TM)