boxr 0.6.0 → 0.7.0
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.
- checksums.yaml +4 -4
- data/lib/boxr.rb +19 -0
- data/lib/boxr/client.rb +1 -19
- data/lib/boxr/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0c27f80c271f3f13e8b2fb13946467f136b1955
|
4
|
+
data.tar.gz: 1ad858f6831a877a0f03dccf822941a4d6a91bb3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c62b62f3fd96d3a71edc34c636f7df4b1280ab91af52a4f899d7cde3250b3c9cafd0dc31e1b3ecee1cdf05e4f7a564cc4cb23961b2a355cd9f3729afe16b7924
|
7
|
+
data.tar.gz: 7d6fd3a95d20051270074956ed1379ade4bc2fbd999b58033056bf7967e5a5c59cb790d502094af23b9a55dc7a0f8a0c7ae1923059fd1d4c0f072c21ceba457d
|
data/lib/boxr.rb
CHANGED
@@ -38,4 +38,23 @@ module Boxr
|
|
38
38
|
|
39
39
|
#The root folder in Box is always identified by 0
|
40
40
|
ROOT = 0
|
41
|
+
|
42
|
+
#HTTPClient is high-performance, thread-safe, and supports persistent HTTPS connections
|
43
|
+
#http://bibwild.wordpress.com/2012/04/30/ruby-http-performance-shootout-redux/
|
44
|
+
BOX_CLIENT = HTTPClient.new
|
45
|
+
BOX_CLIENT.send_timeout = 3600 #one hour; needed for lengthy uploads
|
46
|
+
BOX_CLIENT.agent_name = "Boxr/#{Boxr::VERSION}"
|
47
|
+
BOX_CLIENT.transparent_gzip_decompression = true
|
48
|
+
|
49
|
+
def self.turn_on_debugging(device=STDOUT)
|
50
|
+
BOX_CLIENT.debug_dev = device
|
51
|
+
BOX_CLIENT.transparent_gzip_decompression = false
|
52
|
+
nil
|
53
|
+
end
|
54
|
+
|
55
|
+
def self.turn_off_debugging
|
56
|
+
BOX_CLIENT.debug_dev = nil
|
57
|
+
BOX_CLIENT.transparent_gzip_decompression = true
|
58
|
+
nil
|
59
|
+
end
|
41
60
|
end
|
data/lib/boxr/client.rb
CHANGED
@@ -49,25 +49,7 @@ module Boxr
|
|
49
49
|
|
50
50
|
GROUP_FIELDS = [:type, :id, :name, :created_at, :modified_at]
|
51
51
|
GROUP_FIELDS_QUERY = GROUP_FIELDS.join(',')
|
52
|
-
|
53
|
-
#Read this to see why the httpclient gem was chosen: http://bibwild.wordpress.com/2012/04/30/ruby-http-performance-shootout-redux/
|
54
|
-
#All instances of Boxr::Client will use this one class instance of HTTPClient; that way persistent HTTPS connections work.
|
55
|
-
#Plus, httpclient is thread-safe so we can use the same class instance with multiple instances of Boxr::Client
|
56
|
-
BOX_CLIENT = HTTPClient.new
|
57
|
-
BOX_CLIENT.send_timeout = 3600 #one hour; needed for lengthy uploads
|
58
|
-
BOX_CLIENT.transparent_gzip_decompression = true
|
59
|
-
|
60
|
-
def self.turn_on_debugging(device=STDOUT)
|
61
|
-
BOX_CLIENT.debug_dev = device
|
62
|
-
BOX_CLIENT.transparent_gzip_decompression = false
|
63
|
-
nil
|
64
|
-
end
|
65
|
-
|
66
|
-
def self.turn_off_debugging
|
67
|
-
BOX_CLIENT.debug_dev = nil
|
68
|
-
BOX_CLIENT.transparent_gzip_decompression = true
|
69
|
-
nil
|
70
|
-
end
|
52
|
+
|
71
53
|
|
72
54
|
def initialize(access_token, refresh_token: nil, box_client_id: ENV['BOX_CLIENT_ID'], box_client_secret: ENV['BOX_CLIENT_SECRET'],
|
73
55
|
identifier: nil, as_user_id: nil, &token_refresh_listener)
|
data/lib/boxr/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: boxr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chad Burnette
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|