readonce 1.0.5 → 1.0.6
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 707d6901c4d914a60402dfcc2c23e0dc4d515e9b
|
4
|
+
data.tar.gz: ead33fc7dc1814f8a287c3871564531867572fbe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c38ae10573ed6e52b7368395849dbde36990d2d6064b96d93f0c12db9f05b2ef0a3bfe5aa9fdc8be68c31556a885de35f750974306ad48f027655775dc677269
|
7
|
+
data.tar.gz: 02b2588def674e61210faddfbb8229c935bb144358e112f2194077d343def27d0a5499cd00223b9b394ca59e8c9ba48a79f9559855ced0fe6fddc5530da72cbc
|
data/bin/readonce
CHANGED
data/lib/readonce/version.rb
CHANGED
data/lib/readonce.rb
CHANGED
@@ -3,7 +3,7 @@ require 'readonce/version'
|
|
3
3
|
require 'httparty'
|
4
4
|
|
5
5
|
class ReadOnce
|
6
|
-
BASE_URI = '
|
6
|
+
BASE_URI = 'http://localhost:9292'
|
7
7
|
|
8
8
|
def self.from_key(key)
|
9
9
|
r = ReadOnce.new
|
@@ -12,7 +12,7 @@ class ReadOnce
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def self.from_data(data)
|
15
|
-
response = HTTParty.post "#{BASE_URI}/create", body: data
|
15
|
+
response = HTTParty.post "#{BASE_URI}/create", body: data, headers: {'Content-type' => 'text/plain'}
|
16
16
|
r = ReadOnce.new
|
17
17
|
r.instance_variable_set(:@key, response.body)
|
18
18
|
r
|
@@ -24,7 +24,7 @@ class ReadOnce
|
|
24
24
|
|
25
25
|
def exists?
|
26
26
|
response = HTTParty.get "#{BASE_URI}/status/#{key}"
|
27
|
-
response.code == 200
|
27
|
+
response.code == 200
|
28
28
|
end
|
29
29
|
|
30
30
|
def block_while_exists
|