readonce 1.0.10 → 1.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/readonce/version.rb +1 -1
- data/lib/readonce.rb +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 607078cf98fa67cee12f883eed77fd23b6fccd43
|
4
|
+
data.tar.gz: ffc1c83b5ab728f4c60b4a1fd89898325c368773
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53ba36487462911b774661db4e47e835ef8cd855271bcb21d2e345e037ef5fe69d9ba4d6ed8640cc76d029fac6da2324245f8e8161acc9de43a12a767b25ffb3
|
7
|
+
data.tar.gz: 32cdcbd7081ee3fbf39cc35a60e210be62af84cb75fea83fb05e69dae26a5a42418a14744a8ae2ce78e76a4c14cc9db7c355ccec655b33422dde9899e34cbc25
|
data/lib/readonce/version.rb
CHANGED
data/lib/readonce.rb
CHANGED
@@ -27,7 +27,7 @@ class ReadOnce
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def self.from_data(data)
|
30
|
-
self.exit_if_gem_outdated!
|
30
|
+
self.class.exit_if_gem_outdated!
|
31
31
|
response = post '/create', body: data, headers: {'Content-type' => 'text/plain'}.merge(USER_AGENT_HEADER)
|
32
32
|
r = ReadOnce.new
|
33
33
|
r.instance_variable_set(:@key, response.body)
|
@@ -39,19 +39,19 @@ class ReadOnce
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def read?
|
42
|
-
self.exit_if_gem_outdated!
|
42
|
+
self.class.exit_if_gem_outdated!
|
43
43
|
response = self.class.get "/status/#{key}", headers: USER_AGENT_HEADER
|
44
44
|
!JSON.parse(response.body)['accessed_at'].nil?
|
45
45
|
end
|
46
46
|
|
47
47
|
def exists?
|
48
|
-
self.exit_if_gem_outdated!
|
48
|
+
self.class.exit_if_gem_outdated!
|
49
49
|
response = self.class.get "/status/#{key}", headers: USER_AGENT_HEADER
|
50
50
|
response.code == 200
|
51
51
|
end
|
52
52
|
|
53
53
|
def status
|
54
|
-
self.exit_if_gem_outdated!
|
54
|
+
self.class.exit_if_gem_outdated!
|
55
55
|
response = self.class.get "/status/#{key}", headers: USER_AGENT_HEADER
|
56
56
|
JSON.parse(response.body)
|
57
57
|
end
|