onename 0.1 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/onename.rb +4 -4
- data/lib/onename/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: 2e4c527589e27372a6a405d5b889587d0393a8e9
|
4
|
+
data.tar.gz: f0dd9f214572f3ca91acafcd2f4956fdd084ad13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70a81fd63638ac293cf40717519fb14dcc3f44923ad6d3425ee191b3c2e267cd89706a94dd9ed22b573d868d54a8d91ad157042081a8591684b7b3fb6caf21b8
|
7
|
+
data.tar.gz: b150858c98b8eba059711b98bedcd316b39af9e77d025cdfba195cdac70f405be0f50a2aa1a66cd47a5da65f59cfb6a8fa5e106a34008ca9764ecc9de0c5ceff
|
data/lib/onename.rb
CHANGED
@@ -42,12 +42,12 @@ module Onename
|
|
42
42
|
##
|
43
43
|
# Retrieve JSON data stored in OneName record
|
44
44
|
def self.get_json(onename)
|
45
|
-
|
45
|
+
raise ArgumentError.new("#{onename} is not a valid OneName") if !self.valid?(onename)
|
46
46
|
uri = URI(self.endpoint + "/#{onename.downcase}.json")
|
47
|
-
|
48
|
-
|
47
|
+
http = Net::HTTP.new(uri.host,uri.port)
|
48
|
+
http.use_ssl = uri.scheme == "https" ? true : false
|
49
49
|
req = Net::HTTP::Get.new(uri.path, {'User-Agent' => USERAGENT})
|
50
|
-
res =
|
50
|
+
res = http.request(req)
|
51
51
|
case res.code
|
52
52
|
when 404 then raise NameError.new("User with OneName \"#{onename}\" does not exist")
|
53
53
|
when res.code != 200 then
|
data/lib/onename/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: onename
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Larry Salibra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|