nist_randomness_beacon 0.1.4 → 0.1.5
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.
- checksums.yaml +4 -4
- data/lib/nist_randomness_beacon/client.rb +11 -9
- data/lib/nist_randomness_beacon/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: 4dca632c09a5bbdf7b85b95bff9c9a181e0b5fc0
|
|
4
|
+
data.tar.gz: c95bd5f406d9b316fb8f8ef920223f4f5cc0a9bd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eb62047409e49b4dddd809a93cd8635caf9747b614e1c38370533d8159e2d3a52ce444a6f5c4fc59a659920befa914202b848698f1172642d66771d1dd045046
|
|
7
|
+
data.tar.gz: 1f83df04fe6103865b376a34b829edfb2537dd64f10f2e1fb795a34cb5aff8433d61bfcd62930e4b4c3fd77682ecdcc77847c7ed552bf9d035c8f432ae1e5926
|
|
@@ -19,8 +19,7 @@ module NISTRandomnessBeacon
|
|
|
19
19
|
#
|
|
20
20
|
def current
|
|
21
21
|
response = self.class.get("#@uri/#@timestamp")
|
|
22
|
-
|
|
23
|
-
NISTRandomnessBeacon::Record.new(response.parsed_response['record'])
|
|
22
|
+
create_new_record(response)
|
|
24
23
|
end
|
|
25
24
|
|
|
26
25
|
# Returns the Previous Record
|
|
@@ -28,8 +27,7 @@ module NISTRandomnessBeacon
|
|
|
28
27
|
#
|
|
29
28
|
def previous
|
|
30
29
|
response = self.class.get("#@uri/previous/#@timestamp")
|
|
31
|
-
|
|
32
|
-
NISTRandomnessBeacon::Record.new(response.parsed_response['record'])
|
|
30
|
+
create_new_record(response)
|
|
33
31
|
end
|
|
34
32
|
|
|
35
33
|
# Returns the Next Record
|
|
@@ -37,8 +35,7 @@ module NISTRandomnessBeacon
|
|
|
37
35
|
#
|
|
38
36
|
def next
|
|
39
37
|
response = self.class.get("#@uri/next/#@timestamp")
|
|
40
|
-
|
|
41
|
-
NISTRandomnessBeacon::Record.new(response.parsed_response['record'])
|
|
38
|
+
create_new_record(response)
|
|
42
39
|
end
|
|
43
40
|
|
|
44
41
|
# Returns the Last Record
|
|
@@ -46,8 +43,7 @@ module NISTRandomnessBeacon
|
|
|
46
43
|
#
|
|
47
44
|
def last
|
|
48
45
|
response = self.class.get("#@uri/last")
|
|
49
|
-
|
|
50
|
-
NISTRandomnessBeacon::Record.new(response.parsed_response['record'])
|
|
46
|
+
create_new_record(response)
|
|
51
47
|
end
|
|
52
48
|
|
|
53
49
|
# Returns the Start Chain Record
|
|
@@ -55,7 +51,13 @@ module NISTRandomnessBeacon
|
|
|
55
51
|
#
|
|
56
52
|
def start_chain
|
|
57
53
|
response = self.class.get("#@uri/start-chain/#@timestamp")
|
|
58
|
-
|
|
54
|
+
create_new_record(response)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
private
|
|
58
|
+
|
|
59
|
+
def create_new_record response, response_code=200
|
|
60
|
+
raise ServiceError, response.body unless response.code.eql? response_code
|
|
59
61
|
NISTRandomnessBeacon::Record.new(response.parsed_response['record'])
|
|
60
62
|
end
|
|
61
63
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: nist_randomness_beacon
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chase Southard
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2015-01-
|
|
12
|
+
date: 2015-01-15 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: bundler
|