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: c317868b4f055d0b9cb81e248677f5e326634638
4
- data.tar.gz: e24c01a6fe136867eece30816dab5a1276b1f6a6
3
+ metadata.gz: 707d6901c4d914a60402dfcc2c23e0dc4d515e9b
4
+ data.tar.gz: ead33fc7dc1814f8a287c3871564531867572fbe
5
5
  SHA512:
6
- metadata.gz: c9091d284a3dcf7f1f11d21e804ae129eb9e61977b17470dcf469b21b35c3f092d0a4dfdcc05b1fede6ea9163c1d1c423ae94cb3b7898df7abf62093e5c3d3e1
7
- data.tar.gz: 0768e1f9781a379370bc4f601be6ef35abc0e0adbd909c2676c1fe787ea0319a2279d5ee2b9bbfe34488a0278f684fcb95aa04787e06c250a321297926a14349
6
+ metadata.gz: c38ae10573ed6e52b7368395849dbde36990d2d6064b96d93f0c12db9f05b2ef0a3bfe5aa9fdc8be68c31556a885de35f750974306ad48f027655775dc677269
7
+ data.tar.gz: 02b2588def674e61210faddfbb8229c935bb144358e112f2194077d343def27d0a5499cd00223b9b394ca59e8c9ba48a79f9559855ced0fe6fddc5530da72cbc
data/bin/readonce CHANGED
@@ -1,6 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'rubygems'
4
+ require 'bundler'
5
+ Bundler.setup
4
6
  require 'readonce'
5
7
 
6
8
  # No arguments: we stash a file, nothing else.
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: http://readonce-production.herokuapp.com/create
5
+ uri: https://readonce-production.herokuapp.com/create
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: dummydata
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: http://readonce-production.herokuapp.com/status/a2b7385319449527d87468a3833365c4
5
+ uri: https://readonce-production.herokuapp.com/status/a2b7385319449527d87468a3833365c4
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: http://readonce-production.herokuapp.com/status/63d2e85319449527d87468a3833365c4
5
+ uri: https://readonce-production.herokuapp.com/status/63d2e85319449527d87468a3833365c4
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -1,3 +1,3 @@
1
1
  module Readonce
2
- VERSION = "1.0.5"
2
+ VERSION = "1.0.6"
3
3
  end
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 = 'https://readonce-production.herokuapp.com'
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 ? true : false
27
+ response.code == 200
28
28
  end
29
29
 
30
30
  def block_while_exists
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: readonce
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robby Grossman