realrand 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/random/online.rb +7 -5
  3. metadata +6 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 30208eee2412e835c9bcbb47463f01cf829a2795
4
- data.tar.gz: 6c646456e0d5e6baab364d7a17f29daa209f9519
3
+ metadata.gz: f8c8fc900e4f6aa7e96bb5dff2bb8d29066df60b
4
+ data.tar.gz: 1cab2c65c439046cd58b841978a7800380f1315d
5
5
  SHA512:
6
- metadata.gz: c8f425a06a9b55a7e42828b5939fd4ad87515cf699b0ea3bbe4b679b784e232af8e13aff43fbe4382a82c43f84d264d444f0dfc07e4c4c3ef9aba44efb8f9822
7
- data.tar.gz: 009704070d2a781e9f9a0f30902794d28c9a52513ae3340aa31bc558697802f8eacd919d10b25afd373bafdddb06400ff0c6473b5a637c3a33ba6aa12b776744
6
+ metadata.gz: 29b1a0bf709d249111833cda3c11c527d80f63fde3ee52ee6fe1ac728b541426fde64b3cec4a3cf0ce378f0f51028182d987d9e743de69287b830fdfc8db11d2
7
+ data.tar.gz: f94e4e38cdc12e216ac4a90b1f4e2426e1c27a6c3d31f5ca127d97eedef9bc68d148e40a9618f1ba58a81d8ca1cbc7e5573ccf8e606db61d30985a696ad9a709
@@ -1,19 +1,21 @@
1
1
  # = RealRand
2
2
  #
3
3
  # Author:: Maik Schmidt <contact@maik-schmidt.de>
4
- # Copyright:: Copyright (c) 2003-2011 Maik Schmidt
4
+ # Copyright:: Copyright (c) 2003-2015 Maik Schmidt
5
5
  # License:: Distributes under the same terms as Ruby.
6
6
  #
7
7
 
8
8
  require 'net/http'
9
+ require 'openssl'
9
10
 
10
11
  module RealRand
11
12
  class OnlineGenerator
12
13
  attr_reader :host
13
- attr_accessor :proxy_host, :proxy_port, :proxy_usr, :proxy_pwd
14
+ attr_accessor :ssl, :proxy_host, :proxy_port, :proxy_usr, :proxy_pwd
14
15
 
15
- def initialize(host)
16
+ def initialize(host,ssl = false)
16
17
  @host = host
18
+ @ssl = ssl
17
19
  @proxy_host = nil
18
20
  @proxy_port = -1
19
21
  @proxy_usr = nil
@@ -28,7 +30,7 @@ module RealRand
28
30
  @proxy_port,
29
31
  @proxy_usr,
30
32
  @proxy_pwd
31
- ).start(@host) { |h|
33
+ ).start(@host,nil,:use_ssl => @ssl) { |h|
32
34
  response = h.get("#{script}?#{parameters}")
33
35
  if response.class == Net::HTTPOK
34
36
  return check_response(response)
@@ -51,7 +53,7 @@ module RealRand
51
53
 
52
54
  class RandomOrg < OnlineGenerator
53
55
  def initialize
54
- super("www.random.org")
56
+ super("www.random.org",true)
55
57
  end
56
58
 
57
59
  def randnum(num = 100, min = 1, max = 100, args = {})
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: realrand
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maik Schmidt
8
8
  autorequire: random/online
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-15 00:00:00.000000000 Z
11
+ date: 2015-02-26 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: contact@maik-schmidt.de
@@ -17,7 +17,7 @@ extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
19
  - lib/random/online.rb
20
- homepage: http://realrand.rubyforge.org
20
+ homepage: https://github.com/maik/RealRand
21
21
  licenses:
22
22
  - Ruby
23
23
  metadata: {}
@@ -27,17 +27,17 @@ require_paths:
27
27
  - lib
28
28
  required_ruby_version: !ruby/object:Gem::Requirement
29
29
  requirements:
30
- - - '>='
30
+ - - ">="
31
31
  - !ruby/object:Gem::Version
32
32
  version: '0'
33
33
  required_rubygems_version: !ruby/object:Gem::Requirement
34
34
  requirements:
35
- - - '>='
35
+ - - ">="
36
36
  - !ruby/object:Gem::Version
37
37
  version: '0'
38
38
  requirements: []
39
39
  rubyforge_project: realrand
40
- rubygems_version: 2.0.6
40
+ rubygems_version: 2.4.6
41
41
  signing_key:
42
42
  specification_version: 4
43
43
  summary: A simple API for creating real random numbers.