randomorg 0.1.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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 21b8e640f9b337d4da571416f275dddd8194b9652673e4db54f1496c807b1837
4
+ data.tar.gz: d778635082b4f72db4ccdc5868c20f74a36c64492ed77d80a93e79ad26b5dac6
5
+ SHA512:
6
+ metadata.gz: dffbbf853530851eb38fbaacae08be997e2dfca5036915b939339d4511c01448bed2e2cfbfdbc00fce0d3a08a70a151f95afe5aaed2a6b2a7d6f4c6e280c1eb2
7
+ data.tar.gz: 8c3352cd676ca25ea495f10170e812afbb9b57e0a6c4158a2c1719b4aab1d1c057ed4c691c21ebe67c431fd2cfd3ab352e014df4efbe28ef5eb2f89d8baa02c4
@@ -0,0 +1,8 @@
1
+ root = true
2
+
3
+ [*]
4
+ indent_style = space
5
+ indent_size = 2
6
+ charset = utf-8
7
+ trim_trailing_whitespace = true
8
+ insert_final_newline = true
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.un~
11
+ .env
data/.rspec ADDED
@@ -0,0 +1,6 @@
1
+ --format RspecJunitFormatter
2
+ --out spec/reports/rspec.xml
3
+ --format html
4
+ --out spec/reports/rspec.html
5
+ --format documentation
6
+ --color
@@ -0,0 +1,49 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, and in the interest of
4
+ fostering an open and welcoming community, we pledge to respect all people who
5
+ contribute through reporting issues, posting feature requests, updating
6
+ documentation, submitting pull requests or patches, and other activities.
7
+
8
+ We are committed to making participation in this project a harassment-free
9
+ experience for everyone, regardless of level of experience, gender, gender
10
+ identity and expression, sexual orientation, disability, personal appearance,
11
+ body size, race, ethnicity, age, religion, or nationality.
12
+
13
+ Examples of unacceptable behavior by participants include:
14
+
15
+ * The use of sexualized language or imagery
16
+ * Personal attacks
17
+ * Trolling or insulting/derogatory comments
18
+ * Public or private harassment
19
+ * Publishing other's private information, such as physical or electronic
20
+ addresses, without explicit permission
21
+ * Other unethical or unprofessional conduct
22
+
23
+ Project maintainers have the right and responsibility to remove, edit, or
24
+ reject comments, commits, code, wiki edits, issues, and other contributions
25
+ that are not aligned to this Code of Conduct, or to ban temporarily or
26
+ permanently any contributor for other behaviors that they deem inappropriate,
27
+ threatening, offensive, or harmful.
28
+
29
+ By adopting this Code of Conduct, project maintainers commit themselves to
30
+ fairly and consistently applying these principles to every aspect of managing
31
+ this project. Project maintainers who do not follow or enforce the Code of
32
+ Conduct may be permanently removed from the project team.
33
+
34
+ This code of conduct applies both within project spaces and in public spaces
35
+ when an individual is representing the project or its community.
36
+
37
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
38
+ reported by contacting a project maintainer at janlindblom@fastmail.fm. All
39
+ complaints will be reviewed and investigated and will result in a response that
40
+ is deemed necessary and appropriate to the circumstances. Maintainers are
41
+ obligated to maintain confidentiality with regard to the reporter of an
42
+ incident.
43
+
44
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
45
+ version 1.3.0, available at
46
+ [http://contributor-covenant.org/version/1/3/0/][version]
47
+
48
+ [homepage]: http://contributor-covenant.org
49
+ [version]: http://contributor-covenant.org/version/1/3/0/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in ruby-random_org.gemspec
4
+ gemspec
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Jan Lindblom
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,60 @@
1
+ # RandomOrg
2
+
3
+ [![Bitbucket Pipelines](https://img.shields.io/bitbucket/pipelines/janlindblom/ruby-randomorg.png)](https://bitbucket.org/janlindblom/ruby-randomorg)
4
+
5
+ Access true random numbers through the random.org API!
6
+
7
+ See https://random.org/ for the specifics of the random.org services and their [API](https://api.random.org/json-rpc/1/).
8
+
9
+ ## Installation
10
+
11
+ Add this line to your application's Gemfile:
12
+
13
+ ```ruby
14
+ gem 'randomorg'
15
+ ```
16
+
17
+ And then execute:
18
+
19
+ $ bundle
20
+
21
+ Or install it yourself as:
22
+
23
+ $ gem install randomorg
24
+
25
+ ## Usage
26
+
27
+ Before you can get your random numbers, you will need an API key. You can request one from here: https://api.random.org/api-keys/beta
28
+
29
+ Then you need to configure the module with this key in order to use the service:
30
+
31
+ ```
32
+ RandomOrg.configure do |config|
33
+ config.api_key = "YOUR_API_KEY"
34
+ end
35
+ ```
36
+
37
+ After which you can use it in pretty much the same way as you would the SecureRandom library:
38
+
39
+ ```
40
+ > RandomOrg.random_number(100)
41
+ => 78
42
+ > RandomOrg.base64
43
+ => "r1nwqJksqKacn26UBI1GkQ=="
44
+ ```
45
+
46
+ ## Development
47
+
48
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
49
+
50
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
51
+
52
+ ## Contributing
53
+
54
+ Bug reports and pull requests are welcome on Bitbucket at https://bitbucket.org/janlindblom/ruby-randomorg. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
55
+
56
+ ## License
57
+
58
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
59
+
60
+ Use of the random.org service and API is subject to their Terms and Conditions: https://www.random.org/terms/
@@ -0,0 +1,69 @@
1
+ lib = File.expand_path('lib', __dir__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+
4
+ require 'rake/version_task'
5
+ require 'bundler/gem_tasks'
6
+ require 'rspec/core/rake_task'
7
+ require 'rubocop/rake_task'
8
+ require 'yard'
9
+ require 'yard/rake/yardoc_task'
10
+ require 'random_org'
11
+
12
+ s = Gem::Specification.new do |spec|
13
+ spec.name = 'randomorg'
14
+ spec.version = RandomOrg::VERSION
15
+ spec.authors = ['Jan Lindblom']
16
+ spec.email = ['janlindblom@fastmail.fm']
17
+
18
+ spec.summary = 'Ruby-RandomOrg leverages the random.org API for true ' \
19
+ 'random.'
20
+ spec.description = 'Ruby-RandomOrg helps you make sure that random number ' \
21
+ 'of yours really is, you know, random.'
22
+ spec.homepage = 'https://bitbucket.org/janlindblom/ruby-randomorg'
23
+ spec.license = 'MIT'
24
+
25
+ spec.files = `git ls-files -z`.split("\x0").reject { |f|
26
+ f.match(%r{^(bin|test|spec|features)/}) ||
27
+ f == '.travis.yml' ||
28
+ f == 'buildspec.yml' ||
29
+ f == 'bitbucket-pipelines.yml'
30
+ }
31
+ spec.bindir = 'exe'
32
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
33
+ spec.require_paths = ['lib']
34
+
35
+ spec.add_development_dependency 'bundler', '~> 1.11'
36
+ spec.add_development_dependency 'dotenv', '~> 2.2'
37
+ spec.add_development_dependency 'pry', '~> 0.11'
38
+ spec.add_development_dependency 'rake', '~> 12.3'
39
+ spec.add_development_dependency 'rspec', '~> 3.7'
40
+ spec.add_development_dependency 'rspec_junit_formatter', '~> 0.3'
41
+ spec.add_development_dependency 'rubocop', '~> 0.54'
42
+ spec.add_development_dependency 'simplecov', '~> 0.16'
43
+ spec.add_development_dependency 'simplecov-rcov', '~> 0.2'
44
+ spec.add_development_dependency 'yard', '~> 0.9'
45
+ spec.add_runtime_dependency 'rest-client', '~> 2.0'
46
+ spec.add_runtime_dependency 'version', '~> 1.1'
47
+ end
48
+
49
+ Rake::VersionTask.new do |task|
50
+ task.with_gemspec = s
51
+ task.with_git = false
52
+ end
53
+
54
+ RuboCop::RakeTask.new(:rubocop) do |task|
55
+ task.patterns = ['lib/**/*.rb']
56
+ # only show the files with failures
57
+ # task.formatters = ['worst']
58
+ # don't abort rake on failure
59
+ task.fail_on_error = true
60
+ end
61
+
62
+ YARD::Rake::YardocTask.new do |t|
63
+ t.files = ['lib/**/*.rb']
64
+ t.stats_options = ['--list-undoc']
65
+ end
66
+
67
+ RSpec::Core::RakeTask.new(:spec)
68
+
69
+ task default: %i[build yard rubocop spec]
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.1
@@ -0,0 +1,159 @@
1
+ require 'version'
2
+ require 'random_org/argument_error'
3
+ require 'random_org/api_error'
4
+ require 'random_org/api_server_error'
5
+ require 'random_org/wrong_api_key_error'
6
+ require 'random_org/configuration'
7
+ require 'random_org/api_client'
8
+ require 'random_org/rng'
9
+
10
+ # This library is an interface to the random.org random number generator API
11
+ # which generates true random numbers through data gathered from atmospheric
12
+ # noise.
13
+ #
14
+ # This library is implemented as a drop-in replacement for SecureRandom, giving
15
+ # you the same methods with the same parameters and mimicing the behaviour of
16
+ # the corresponding method in SecureRandom.
17
+ module RandomOrg
18
+ is_versioned
19
+ # Modify the current configuration.
20
+ #
21
+ # @example
22
+ # RandomOrg.configure do |config|
23
+ # config.api_key = "YOUR_API_KEY"
24
+ # end
25
+ #
26
+ # @yieldparam [RandomOrg::Configuration] config current configuration
27
+ def self.configure
28
+ self.configuration ||= RandomOrg::Configuration.new
29
+ yield self.configuration
30
+ end
31
+
32
+ # RandomOrg.random_bytes generates a random binary string.
33
+ #
34
+ # @param [Numeric] length the length of the result string, if not specified,
35
+ # 16 is assumed.
36
+ def self.random_bytes(length = 16)
37
+ [hex(length)].pack('H*')
38
+ end
39
+
40
+ # RandomOrg.random_number generates a random number.
41
+ #
42
+ # If a positive integer is given as +maximum+,
43
+ # RandomOrg.random_number returns an integer:
44
+ # +0 <= RandomOrg.random_number(maximum) < maximum+.
45
+ #
46
+ # If 0 is given or an argument is not given,
47
+ # RandomOrg.random_number returns a float:
48
+ # +0.0 <= RandomOrg.random_number() < 1.0+.
49
+ #
50
+ # @param [Numeric] maximum maximum if the value given is +> 0+
51
+ def self.random_number(maximum = 0)
52
+ min = 0
53
+ req = if maximum.zero?
54
+ request_default
55
+ else
56
+ # random.org treats the range as inclusive so set max=max-1
57
+ request_with_min_max(min, maximum - 1)
58
+ end
59
+ response = RandomOrg::ApiClient.perform_request(req)
60
+ process_response(response)
61
+ end
62
+
63
+ # RandomOrg.hex generates a random hex string.
64
+ #
65
+ # The length of the result string is twice of +length+.
66
+ #
67
+ # @param [Numeric] length the length of the random string, if not specified,
68
+ # 16 is assumed.
69
+ def self.hex(length = 16)
70
+ size = length * 8
71
+ req = RandomOrg::ApiClient.build_request(:generate_blobs,
72
+ n: 1,
73
+ size: size,
74
+ format: 'hex')
75
+ response = RandomOrg::ApiClient.perform_request(req)
76
+ process_response(response)
77
+ end
78
+
79
+ # RandomOrg.base64 generates a random base64 string.
80
+ #
81
+ # The length of the result string is about 4/3 of +length+.
82
+ #
83
+ # @param [Numeric] length the length of the random string, if not specified,
84
+ # 16 is assumed.
85
+ def self.base64(length = 16)
86
+ size = length * 8
87
+ req = RandomOrg::ApiClient.build_request(:generate_blobs,
88
+ n: 1,
89
+ size: size,
90
+ format: 'base64')
91
+ response = RandomOrg::ApiClient.perform_request(req)
92
+ process_response(response)
93
+ end
94
+
95
+ # RandomOrg.urlsafe_base64 generates a random URL-safe base64 string.
96
+ #
97
+ # The length of the result string is about 4/3 of +n+.
98
+ #
99
+ # By default, padding is not generated because "=" may be used as a URL
100
+ # delimiter.
101
+ #
102
+ # @param [Numeric] length the length of the random length, if not specified,
103
+ # 16 is assumed.
104
+ # @param [Boolean] padding specifies the padding: if false or nil, padding is
105
+ # not generated, otherwise padding is generated.
106
+ def self.urlsafe_base64(length = nil, padding = false)
107
+ s = base64 length
108
+ s.tr!('+/', '-_')
109
+ s.delete!('=') unless padding
110
+ s
111
+ end
112
+
113
+ # RandomOrg.uuid generates a v4 random UUID (Universally Unique IDentifier).
114
+ #
115
+ # The version 4 UUID is purely random (except the version). It doesn't
116
+ # contain meaningful information such as MAC address, time, etc.
117
+ #
118
+ # See RFC 4122 for details of UUID.
119
+ def self.uuid
120
+ req = RandomOrg::ApiClient.build_request(:generate_uuids, n: 1)
121
+ response = RandomOrg::ApiClient.perform_request(req)
122
+ response['result']['random']['data'].first
123
+ end
124
+
125
+ class << self
126
+ attr_accessor :configuration
127
+
128
+ private
129
+
130
+ def request_with_min_max(min, max)
131
+ RandomOrg::ApiClient.build_request(:generate_integers,
132
+ n: 1,
133
+ min: min,
134
+ max: max,
135
+ replacement: true,
136
+ base: 10)
137
+ end
138
+
139
+ def request_default
140
+ RandomOrg::ApiClient.build_request(:generate_decimal_fractions,
141
+ n: 1,
142
+ 'decimalPlaces' => 16,
143
+ replacement: true)
144
+ end
145
+
146
+ def process_response(response)
147
+ bad_response_error(response) unless response.key? 'result'
148
+ result = response['result']
149
+ bad_response_error(response) unless result.key? 'random'
150
+ random = result['random']
151
+ bad_response_error(response) unless random.key? 'data'
152
+ random['data'].first
153
+ end
154
+
155
+ def bad_response_error(response)
156
+ raise ApiError, "Something is wrong with the response: #{response}"
157
+ end
158
+ end
159
+ end
@@ -0,0 +1,71 @@
1
+ require 'random_org/wrong_api_key_error'
2
+ require 'random_org/api_server_error'
3
+ require 'rest-client'
4
+
5
+ module RandomOrg
6
+ # The API client responsible for making all the calls.
7
+ #
8
+ # @api private
9
+ class ApiClient
10
+ # Constructs a request to the API
11
+ # @param [Symbol] which_request request to build
12
+ # @param [Hash,nil] args arguments
13
+ # @return [Hash] prebuilt request
14
+ def self.build_request(which_request, args = nil)
15
+ req = base_request
16
+ req[:params] = args.merge('apiKey' => RandomOrg.configuration.api_key)
17
+
18
+ req[:method] = setup_request_method(which_request)
19
+
20
+ req
21
+ end
22
+
23
+ # Performs a request to the API
24
+ # @param [Hash] req prebuilt request to perform
25
+ # @return [Hash] parsed response
26
+ def self.perform_request(req)
27
+ response = RestClient.post(@endpoint_uri, req.to_json)
28
+ case response.code
29
+ when 200
30
+ return JSON.parse(response.body)
31
+ when 400
32
+ wrong_api_key_error
33
+ when 500
34
+ api_server_error
35
+ end
36
+ nil
37
+ end
38
+
39
+ @endpoint_uri = 'https://api.random.org/json-rpc/1/invoke'
40
+
41
+ private_class_method def self.base_request
42
+ {
43
+ jsonrpc: '2.0',
44
+ id: 1 + (Random.rand * 9999).to_i
45
+ }
46
+ end
47
+
48
+ private_class_method def self.setup_request_method(which_request)
49
+ case which_request
50
+ when :generate_integers
51
+ 'generateIntegers'
52
+ when :generate_decimal_fractions
53
+ 'generateDecimalFractions'
54
+ when :generate_blobs
55
+ 'generateBlobs'
56
+ when :generate_uuids
57
+ 'generateUUIDs'
58
+ end
59
+ end
60
+
61
+ private_class_method def self.api_server_error
62
+ raise ApiServerError, 'Something went wrong from the random.org API. ' \
63
+ 'Try again or check their service for information.'
64
+ end
65
+
66
+ private_class_method def self.wrong_api_key_error
67
+ raise WrongApiKeyError, 'Wrong or missing API key, ' \
68
+ 'check your configuration.'
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,5 @@
1
+ module RandomOrg
2
+ # Raised when there is a problem accessing the API.
3
+ class ApiError < StandardError
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module RandomOrg
2
+ # Raised when the API service endpoint is experiencing problems.
3
+ class ApiServerError < StandardError
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module RandomOrg
2
+ # Raised when there is a problem with input arguments.
3
+ class ArgumentError < StandardError
4
+ end
5
+ end
@@ -0,0 +1,12 @@
1
+ module RandomOrg
2
+ # Holds configuration of the module required for it to work.
3
+ class Configuration
4
+ # Sets the random.org API key.
5
+ # @return [String]
6
+ attr_accessor :api_key
7
+
8
+ def initialize
9
+ @api_key = ''
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,65 @@
1
+ require 'random_org/api_client'
2
+
3
+ module RandomOrg
4
+ # Use random.org as a Random Number Generator (RNG). Suitable for use in
5
+ # things like:
6
+ #
7
+ # [1,3,5,78,9,5,3].sample(random: RandomOrg::Rng.new)
8
+ # # => 5
9
+ class Rng
10
+ # Returns a random binary string containing +size+ bytes.
11
+ # @return [String] a random binary string containing +size+ bytes
12
+ def bytes(size = nil)
13
+ RandomOrg::Rng.random_bytes(size)
14
+ end
15
+
16
+ # Returns a random binary string containing +size+ bytes.
17
+ # @return [String] a random binary string containing +size+ bytes
18
+ def self.bytes(size = nil)
19
+ RandomOrg.random_bytes(size)
20
+ end
21
+
22
+ # When +max+ is an Integer, +rand+ returns a random integer greater than or
23
+ # equal to zero and less than +max+.
24
+ #
25
+ # When +max+ is a Float, +rand+ returns a random floating point number
26
+ # between +0.0+ and +max+, including +0.0+ and excluding +max+.
27
+ #
28
+ # When +max+ is a Range, +rand+ returns a random number where
29
+ # +range.member?(number) == true+.
30
+ #
31
+ # @param [Numeric] max maximum
32
+ # @return [Numeric] a random number in the interval +0 <= n < max+
33
+ def rand(max = nil)
34
+ RandomOrg::Rng.rand(max)
35
+ end
36
+
37
+ # When +max+ is an Integer, +rand+ returns a random integer greater than or
38
+ # equal to zero and less than +max+.
39
+ #
40
+ # When +max+ is a Float, +rand+ returns a random floating point number
41
+ # between +0.0+ and +max+, including +0.0+ and excluding +max+.
42
+ #
43
+ # When +max+ is a Range, +rand+ returns a random number where
44
+ # +range.member?(number) == true+.
45
+ #
46
+ # @param [nil, Integer, Float, Range] max maximum
47
+ # @return [Numeric] a random number in the interval +0 <= n < max+
48
+ def self.rand(max = nil)
49
+ return max.to_a.sample(random: RandomOrg::Rng.new) if max.is_a? Range
50
+ return RandomOrg.random_number if max.nil? || max.zero?
51
+ return RandomOrg.random_number(max) if max.is_a? Integer
52
+ return build_float_rand(max) if max.is_a? Float
53
+
54
+ raise ArgumentError, 'Given argument must be correct type.'
55
+ end
56
+
57
+ private_class_method def self.build_float_rand(max)
58
+ whole = max.to_i
59
+ rem = ((max - whole) * (10**9)).round
60
+ whole = RandomOrg.random_number(whole)
61
+ rem = RandomOrg.random_number(rem).to_f / (10**9)
62
+ whole + rem
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,5 @@
1
+ module RandomOrg
2
+ # Raised when the API returns an error due to a nonexisting API key.
3
+ class WrongApiKeyError < StandardError
4
+ end
5
+ end
@@ -0,0 +1,65 @@
1
+ # -*- encoding: utf-8 -*-
2
+ # stub: randomorg 0.1.1 ruby lib
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "randomorg".freeze
6
+ s.version = "0.1.1"
7
+
8
+ s.required_rubygems_version = Gem::Requirement.new("> 1.3.1".freeze) if s.respond_to? :required_rubygems_version=
9
+ s.require_paths = ["lib".freeze]
10
+ s.authors = ["Jan Lindblom".freeze]
11
+ s.bindir = "exe".freeze
12
+ s.date = "2018-04-13"
13
+ s.description = "Ruby-RandomOrg helps you make sure that random number of yours really is, you know, random.".freeze
14
+ s.email = ["janlindblom@fastmail.fm".freeze]
15
+ s.files = [".editorconfig".freeze, ".gitignore".freeze, ".rspec".freeze, "CODE_OF_CONDUCT.md".freeze, "Gemfile".freeze, "LICENSE.txt".freeze, "README.md".freeze, "Rakefile".freeze, "VERSION".freeze, "lib/random_org.rb".freeze, "lib/random_org/api_client.rb".freeze, "lib/random_org/api_error.rb".freeze, "lib/random_org/api_server_error.rb".freeze, "lib/random_org/argument_error.rb".freeze, "lib/random_org/configuration.rb".freeze, "lib/random_org/rng.rb".freeze, "lib/random_org/wrong_api_key_error.rb".freeze, "randomorg.gemspec".freeze]
16
+ s.homepage = "https://bitbucket.org/janlindblom/ruby-randomorg".freeze
17
+ s.licenses = ["MIT".freeze]
18
+ s.rubygems_version = "2.7.3".freeze
19
+ s.summary = "Ruby-RandomOrg leverages the random.org API for true random.".freeze
20
+
21
+ if s.respond_to? :specification_version then
22
+ s.specification_version = 4
23
+
24
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
25
+ s.add_development_dependency(%q<bundler>.freeze, ["~> 1.11"])
26
+ s.add_development_dependency(%q<dotenv>.freeze, ["~> 2.2"])
27
+ s.add_development_dependency(%q<pry>.freeze, ["~> 0.11"])
28
+ s.add_development_dependency(%q<rake>.freeze, ["~> 12.3"])
29
+ s.add_development_dependency(%q<rspec>.freeze, ["~> 3.7"])
30
+ s.add_development_dependency(%q<rspec_junit_formatter>.freeze, ["~> 0.3"])
31
+ s.add_development_dependency(%q<rubocop>.freeze, ["~> 0.54"])
32
+ s.add_development_dependency(%q<simplecov>.freeze, ["~> 0.16"])
33
+ s.add_development_dependency(%q<simplecov-rcov>.freeze, ["~> 0.2"])
34
+ s.add_development_dependency(%q<yard>.freeze, ["~> 0.9"])
35
+ s.add_runtime_dependency(%q<rest-client>.freeze, ["~> 2.0"])
36
+ s.add_runtime_dependency(%q<version>.freeze, ["~> 1.1"])
37
+ else
38
+ s.add_dependency(%q<bundler>.freeze, ["~> 1.11"])
39
+ s.add_dependency(%q<dotenv>.freeze, ["~> 2.2"])
40
+ s.add_dependency(%q<pry>.freeze, ["~> 0.11"])
41
+ s.add_dependency(%q<rake>.freeze, ["~> 12.3"])
42
+ s.add_dependency(%q<rspec>.freeze, ["~> 3.7"])
43
+ s.add_dependency(%q<rspec_junit_formatter>.freeze, ["~> 0.3"])
44
+ s.add_dependency(%q<rubocop>.freeze, ["~> 0.54"])
45
+ s.add_dependency(%q<simplecov>.freeze, ["~> 0.16"])
46
+ s.add_dependency(%q<simplecov-rcov>.freeze, ["~> 0.2"])
47
+ s.add_dependency(%q<yard>.freeze, ["~> 0.9"])
48
+ s.add_dependency(%q<rest-client>.freeze, ["~> 2.0"])
49
+ s.add_dependency(%q<version>.freeze, ["~> 1.1"])
50
+ end
51
+ else
52
+ s.add_dependency(%q<bundler>.freeze, ["~> 1.11"])
53
+ s.add_dependency(%q<dotenv>.freeze, ["~> 2.2"])
54
+ s.add_dependency(%q<pry>.freeze, ["~> 0.11"])
55
+ s.add_dependency(%q<rake>.freeze, ["~> 12.3"])
56
+ s.add_dependency(%q<rspec>.freeze, ["~> 3.7"])
57
+ s.add_dependency(%q<rspec_junit_formatter>.freeze, ["~> 0.3"])
58
+ s.add_dependency(%q<rubocop>.freeze, ["~> 0.54"])
59
+ s.add_dependency(%q<simplecov>.freeze, ["~> 0.16"])
60
+ s.add_dependency(%q<simplecov-rcov>.freeze, ["~> 0.2"])
61
+ s.add_dependency(%q<yard>.freeze, ["~> 0.9"])
62
+ s.add_dependency(%q<rest-client>.freeze, ["~> 2.0"])
63
+ s.add_dependency(%q<version>.freeze, ["~> 1.1"])
64
+ end
65
+ end
metadata ADDED
@@ -0,0 +1,231 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: randomorg
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Jan Lindblom
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2018-04-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.11'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.11'
27
+ - !ruby/object:Gem::Dependency
28
+ name: dotenv
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.2'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.2'
41
+ - !ruby/object:Gem::Dependency
42
+ name: pry
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.11'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.11'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '12.3'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '12.3'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '3.7'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '3.7'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec_junit_formatter
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '0.3'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '0.3'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rubocop
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '0.54'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '0.54'
111
+ - !ruby/object:Gem::Dependency
112
+ name: simplecov
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '0.16'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '0.16'
125
+ - !ruby/object:Gem::Dependency
126
+ name: simplecov-rcov
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '0.2'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '0.2'
139
+ - !ruby/object:Gem::Dependency
140
+ name: yard
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '0.9'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '0.9'
153
+ - !ruby/object:Gem::Dependency
154
+ name: rest-client
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '2.0'
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '2.0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: version
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '1.1'
174
+ type: :runtime
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '1.1'
181
+ description: Ruby-RandomOrg helps you make sure that random number of yours really
182
+ is, you know, random.
183
+ email:
184
+ - janlindblom@fastmail.fm
185
+ executables: []
186
+ extensions: []
187
+ extra_rdoc_files: []
188
+ files:
189
+ - ".editorconfig"
190
+ - ".gitignore"
191
+ - ".rspec"
192
+ - CODE_OF_CONDUCT.md
193
+ - Gemfile
194
+ - LICENSE.txt
195
+ - README.md
196
+ - Rakefile
197
+ - VERSION
198
+ - lib/random_org.rb
199
+ - lib/random_org/api_client.rb
200
+ - lib/random_org/api_error.rb
201
+ - lib/random_org/api_server_error.rb
202
+ - lib/random_org/argument_error.rb
203
+ - lib/random_org/configuration.rb
204
+ - lib/random_org/rng.rb
205
+ - lib/random_org/wrong_api_key_error.rb
206
+ - randomorg.gemspec
207
+ homepage: https://bitbucket.org/janlindblom/ruby-randomorg
208
+ licenses:
209
+ - MIT
210
+ metadata: {}
211
+ post_install_message:
212
+ rdoc_options: []
213
+ require_paths:
214
+ - lib
215
+ required_ruby_version: !ruby/object:Gem::Requirement
216
+ requirements:
217
+ - - ">="
218
+ - !ruby/object:Gem::Version
219
+ version: '0'
220
+ required_rubygems_version: !ruby/object:Gem::Requirement
221
+ requirements:
222
+ - - ">"
223
+ - !ruby/object:Gem::Version
224
+ version: 1.3.1
225
+ requirements: []
226
+ rubyforge_project:
227
+ rubygems_version: 2.7.3
228
+ signing_key:
229
+ specification_version: 4
230
+ summary: Ruby-RandomOrg leverages the random.org API for true random.
231
+ test_files: []