adn_viewer 1.0.0 → 1.0.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/adn_viewer.rb +9 -3
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7f143f642f02cb6fa9f20ba812d640b4e850a8b0
4
- data.tar.gz: ef060d0ebf389cda24fb5d3848376c2a1a1ee1a9
3
+ metadata.gz: 5ca47a09bdd4bfeba61a3506db04caae43f9e8b6
4
+ data.tar.gz: 8f7c2da1ac90f9f54751fa224dd7b7d344d8e33a
5
5
  SHA512:
6
- metadata.gz: 4c90934f95e15d3c23cb43ef73521fbecb60940721ea473bb8d800fa1d71ed5b425db8b02e4bf7a83c486cacad3e07b76c1c4b464499d182d89558fb0de78500
7
- data.tar.gz: cb0e3d048259a6ac9d7df43214032ec92782b61131d7d7057635bb830c56a1979a79b8e42fc9fea6bd9fd3740144a1cca5d65648283c216e2d4c84062a48b84c
6
+ metadata.gz: 69977d44dc66d49759307287e98b9f48c93732c9c4f2e2d5adf79e48adaf6435e6bad360f5a0dee56c3f0f3612da823ef34874bf1d1ae420ea28e508864997c4
7
+ data.tar.gz: 0ef0c97425657f68b77208adf7115e1db57a3c5857900d4401089fb4ccd529e0e49be1551331776096b1af03ac04ebe21ea4c62298da44d31ca8600555e2e544
@@ -34,9 +34,15 @@ class Adn_Viewer
34
34
  http = Net::HTTP.new(uri.host, uri.port)
35
35
  http.use_ssl = true
36
36
  request = Net::HTTP::Put.new(uri)
37
- request.body_stream=File.open(filepath)
38
- request["content-type"] = 'application/octet-stream'
39
- request["Content-Length"] = File.size(filepath)
37
+ if filepath.include? "http"
38
+ request.body_stream=open(filepath)
39
+ request["content-type"] = 'application/octet-stream'
40
+ request["Content-Length"] = 1000000
41
+ else
42
+ request.body_stream=File.open(filepath)
43
+ request["content-type"] = 'application/octet-stream'
44
+ request["Content-Length"] = File.size(filepath)
45
+ end
40
46
  request["authorization"] = 'Bearer ' + token
41
47
  request.add_field('session', boundary)
42
48
  JSON.parse(http.request(request).read_body)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adn_viewer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pratham Makhni Alag
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-03 00:00:00.000000000 Z
11
+ date: 2015-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: curb