onename 0.1 → 0.2

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: 18c3c0ad91f44ea48651d449bab5f6d5e6b4bca8
4
- data.tar.gz: 34f62ee837084a8767b37f79a90c8bb2d23f4bfb
3
+ metadata.gz: 2e4c527589e27372a6a405d5b889587d0393a8e9
4
+ data.tar.gz: f0dd9f214572f3ca91acafcd2f4956fdd084ad13
5
5
  SHA512:
6
- metadata.gz: d9d84369ee46c65a399aecbd3992245a95d38ed830779f4e4d678e86d0ddfa1e2929c29a0a5f93f15fea92124e12bd067e986aa07f03b83aa52e4182ac3e2f26
7
- data.tar.gz: b9ded855f931ce6eb4eead10d78f8b36319a09912fcbf9e5ae21f247e4e6083f41cde5007fd3f795a4b796b9af57a7ee60f3f8ce143b9c0d89d9e3ca4bfdaeec
6
+ metadata.gz: 70a81fd63638ac293cf40717519fb14dcc3f44923ad6d3425ee191b3c2e267cd89706a94dd9ed22b573d868d54a8d91ad157042081a8591684b7b3fb6caf21b8
7
+ data.tar.gz: b150858c98b8eba059711b98bedcd316b39af9e77d025cdfba195cdac70f405be0f50a2aa1a66cd47a5da65f59cfb6a8fa5e106a34008ca9764ecc9de0c5ceff
@@ -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
- https = Net::HTTP.new(uri.host,uri.port)
48
- https.use_ssl = true
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 = https.request(req)
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
@@ -1,3 +1,3 @@
1
1
  module Onename
2
- VERSION = "0.1"
2
+ VERSION = "0.2"
3
3
  end
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.1'
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-06 00:00:00.000000000 Z
11
+ date: 2014-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler