adn_viewer 0.0.6 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/adn_viewer.rb +8 -1
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d011f6e58a87a4ea8f33180a62962b73020393e9
4
- data.tar.gz: 755f95cf32693100f026e7b22750b8d7c4d05ad2
3
+ metadata.gz: f703f9b80a50bbca4bd05f9f6730cda7598d90a5
4
+ data.tar.gz: 53ea579e1a4be5cb00e350f384acf777be50aabf
5
5
  SHA512:
6
- metadata.gz: 9a617cd525c2f764ce43562b201ef344a6c4b45cc01cba83b315ed9a87143494304ff35971718610617ab584669adb0485a813da655e5411a3a60dd79a603276
7
- data.tar.gz: fef49ba391d145154bf58092cda24a6ed872d99bd7329f5dea49f16a3f3569f8e56bb8cd8f523a51acac22fa93ba4af2136b9c439c4178de40dfd9b986ba80cb
6
+ metadata.gz: babc8d0b25c4a097063babb7638e45ef5a10baf2723e485bc5dbf44a0c6cb1976822a9bdf3c7a195ae8bfd7c7ea1b3df51d1805e9ab957f870d28b2e14820f6e
7
+ data.tar.gz: 1b2caaec06c035e297d09bec0dd9415fcc9643845bb74371e4fa88d965ff01d75602546d06ce9c8e2881c06e4e9b5e3ee109f5a812b87142cd92eb311a12aacc
data/lib/adn_viewer.rb CHANGED
@@ -29,7 +29,14 @@ class Adn_Viewer
29
29
  end
30
30
 
31
31
  def self.upload_file(token, name, file)
32
- JSON.parse(CurbFu.get({:host => 'developer.api.autodesk.com', :path => '/oss/v1/buckets/' + name + '/objects/' + file, :protocol => "https", :headers => { "Authorization" => "Bearer " + token, "Content-Type" => "application/octet-stream" , "Content-Length" => 308331 }, "upload-file" => file }).body)
32
+ url = URI("https://developer.api.autodesk.com/oss/v1/buckets/" + name + "/objects/" + file)
33
+ http = Net::HTTP.new(url.host, url.port)
34
+ http.use_ssl = true
35
+ request = Net::HTTP::Put.new(url)
36
+ request["content-type"] = 'application/octet-stream'
37
+ request["Content-Length"] = 308331
38
+ request["authorization"] = 'Bearer ' + token
39
+ puts JSON.parse(http.request(request, file).read_body)
33
40
  end
34
41
 
35
42
  end
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: 0.0.6
4
+ version: 0.0.8
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-07-31 00:00:00.000000000 Z
11
+ date: 2015-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: curb