files.com 1.0.72 → 1.0.73

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5397e4d501363c18da150487abd53f51c5598e1164c72f6fc931b889e30e369b
4
- data.tar.gz: 86bd4ab54c0414bd15c193b5d1edaeafe2ae4a8941bf45264f510a0d876c6a8b
3
+ metadata.gz: '090d0a1af5f6c02e5d9324089a250496c92d37c49ee73d58034bae466f0aeffa'
4
+ data.tar.gz: 8924e6463aba4cab5d5cabfd15ed6f152e90565071155fc5f3a99f13d6fa4b68
5
5
  SHA512:
6
- metadata.gz: 1dbbc3649577ee65f36d4bb1447b7151cd82c8a27bc90927cede2528fcbc74e46f3c9af5dcd55ddf4a92653b9daac4cc5301ea3aa9edff005398efc7c7d7abcf
7
- data.tar.gz: cdf2076851cf376f29f2970dae6afcdb0a4fbb98e5ca83ccbf50e8bfed8524a96cac5551a435ed17ef1b99a66122199b873a190766b88971e53fcd1dae184f14
6
+ metadata.gz: 41a353435d34c93d622516829eda77a903fde0e24f619785dc39286eac2557920928a5b910324810f60a59dc08fcdccd548c40ef81b98da2adcd75fbc55506be
7
+ data.tar.gz: 541976698c4ea4a92982b7c1fdd50066a2e4ab77cb7428a19e530318f8ed8ada2389b14ef2a62d8a016654e24790503cb0030acbfb26b2ff150906efd197f33f
data/Gemfile CHANGED
@@ -3,10 +3,10 @@ source 'https://rubygems.org'
3
3
  gemspec
4
4
 
5
5
  group :development, :test do
6
+ gem 'memory_profiler'
6
7
  gem 'pry'
7
8
  gem 'pry-byebug'
8
9
  gem 'rake', '~> 12.0.0'
9
10
  gem 'rspec', '~> 3.9.0'
10
11
  gem 'rubocop'
11
- gem 'memory_profiler'
12
12
  end
@@ -0,0 +1,82 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ files.com (1.0)
5
+ addressable (>= 2.7.0)
6
+ concurrent-ruby (>= 1.1.3)
7
+ faraday (>= 1.0.1)
8
+ net-http-persistent
9
+
10
+ GEM
11
+ remote: https://rubygems.org/
12
+ specs:
13
+ addressable (2.7.0)
14
+ public_suffix (>= 2.0.2, < 5.0)
15
+ ast (2.4.1)
16
+ byebug (11.1.3)
17
+ coderay (1.1.2)
18
+ concurrent-ruby (1.1.6)
19
+ connection_pool (2.2.3)
20
+ diff-lcs (1.3)
21
+ faraday (1.0.1)
22
+ multipart-post (>= 1.2, < 3)
23
+ memory_profiler (0.9.14)
24
+ method_source (1.0.0)
25
+ multipart-post (2.1.1)
26
+ net-http-persistent (4.0.0)
27
+ connection_pool (~> 2.2)
28
+ parallel (1.19.2)
29
+ parser (2.7.1.4)
30
+ ast (~> 2.4.1)
31
+ pry (0.13.1)
32
+ coderay (~> 1.1)
33
+ method_source (~> 1.0)
34
+ pry-byebug (3.9.0)
35
+ byebug (~> 11.0)
36
+ pry (~> 0.13.0)
37
+ public_suffix (4.0.5)
38
+ rainbow (3.0.0)
39
+ rake (12.0.0)
40
+ regexp_parser (1.7.1)
41
+ rexml (3.2.4)
42
+ rspec (3.9.0)
43
+ rspec-core (~> 3.9.0)
44
+ rspec-expectations (~> 3.9.0)
45
+ rspec-mocks (~> 3.9.0)
46
+ rspec-core (3.9.1)
47
+ rspec-support (~> 3.9.1)
48
+ rspec-expectations (3.9.0)
49
+ diff-lcs (>= 1.2.0, < 2.0)
50
+ rspec-support (~> 3.9.0)
51
+ rspec-mocks (3.9.1)
52
+ diff-lcs (>= 1.2.0, < 2.0)
53
+ rspec-support (~> 3.9.0)
54
+ rspec-support (3.9.3)
55
+ rubocop (0.85.1)
56
+ parallel (~> 1.10)
57
+ parser (>= 2.7.0.1)
58
+ rainbow (>= 2.2.2, < 4.0)
59
+ regexp_parser (>= 1.7)
60
+ rexml
61
+ rubocop-ast (>= 0.0.3)
62
+ ruby-progressbar (~> 1.7)
63
+ unicode-display_width (>= 1.4.0, < 2.0)
64
+ rubocop-ast (0.0.3)
65
+ parser (>= 2.7.0.1)
66
+ ruby-progressbar (1.10.1)
67
+ unicode-display_width (1.7.0)
68
+
69
+ PLATFORMS
70
+ ruby
71
+
72
+ DEPENDENCIES
73
+ files.com!
74
+ memory_profiler
75
+ pry
76
+ pry-byebug
77
+ rake (~> 12.0.0)
78
+ rspec (~> 3.9.0)
79
+ rubocop
80
+
81
+ BUNDLED WITH
82
+ 2.1.4
data/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.72
1
+ 1.0.73
@@ -10,11 +10,11 @@ Gem::Specification.new do |s|
10
10
  s.summary = "Files.com Ruby client."
11
11
  s.description = "The Files.com Ruby client."
12
12
  s.license = "MIT"
13
- s.required_ruby_version = ">= 2.3"
14
- s.add_dependency 'faraday', ">= 1.0.1"
15
- s.add_dependency 'net-http-persistent'
13
+ s.required_ruby_version = ">= 2.5"
16
14
  s.add_dependency 'addressable', ">= 2.7.0"
17
15
  s.add_dependency 'concurrent-ruby', ">= 1.1.3"
16
+ s.add_dependency 'faraday', ">= 1.0.1"
17
+ s.add_dependency 'net-http-persistent'
18
18
 
19
19
  s.files = `find *`.split("\n").uniq.sort.reject(&:empty?)
20
20
  s.executables = [ "files", "files-console" ]
@@ -94,7 +94,7 @@ module Files
94
94
  @read_timeout = 80
95
95
 
96
96
  class << self
97
- attr_accessor :api_key, :base_url, :initial_network_retry_delay, :max_network_retries, :max_network_retry_delay, :open_timeout, :read_timeout, :proxy, :session_id
97
+ attr_accessor :api_key, :base_url, :initial_network_retry_delay, :max_network_retry_delay, :open_timeout, :read_timeout, :proxy, :session_id
98
98
  end
99
99
 
100
100
  # map to the same values as the standard library's logger
@@ -201,9 +201,9 @@ module Files
201
201
  def self.update(id, params = {}, options = {})
202
202
  params ||= {}
203
203
  params[:id] = id
204
- raise InvalidParameterError.new("Bad parameter: id must be one of String, Integer, Hash") if params.dig(:id) and [String, Integer, Hash].none? { |klass| params.dig(:id).is_a?(klass) }
204
+ raise InvalidParameterError.new("Bad parameter: id must be one of String, Integer, Hash") if params.dig(:id) and [ String, Integer, Hash ].none? { |klass| params.dig(:id).is_a?(klass) }
205
205
  raise InvalidParameterError.new("Bad parameter: value must be an String") if params.dig(:value) and !params.dig(:value).is_a?(String)
206
- raise InvalidParameterError.new("Bad parameter: attachment_file must be one of String, Integer, Hash") if params.dig(:attachment_file) and [String, Integer, Hash].none? { |klass| params.dig(:attachment_file).is_a?(klass) }
206
+ raise InvalidParameterError.new("Bad parameter: attachment_file must be one of String, Integer, Hash") if params.dig(:attachment_file) and [ String, Integer, Hash ].none? { |klass| params.dig(:attachment_file).is_a?(klass) }
207
207
  raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
208
208
 
209
209
  response, options = Api.send_request("/behaviors/#{params[:id]}", :patch, params, options)
@@ -90,7 +90,7 @@ module Files
90
90
  new(path).mtime
91
91
  end
92
92
 
93
- def self.open(path, mode = "r", options={}, &block)
93
+ def self.open(path, mode = "r", options = {}, &block)
94
94
  file = new(path, mode, options)
95
95
  if block
96
96
  yield file
@@ -306,7 +306,7 @@ module Files
306
306
  end
307
307
 
308
308
  def download_content(io)
309
- Files::ApiClient::download_client.stream_download(download_uri_with_load, io)
309
+ Files::ApiClient.download_client.stream_download(download_uri_with_load, io)
310
310
  end
311
311
 
312
312
  def each(*args, &block)
@@ -571,13 +571,13 @@ module Files
571
571
  end
572
572
 
573
573
  def upload_file(local_file)
574
- File.upload_file(local_file. path)
574
+ File.upload_file(local_file.path)
575
575
  end
576
576
 
577
577
  def write(*args)
578
578
  @mode ||= 'w'
579
579
  if args[0].respond_to?(:read)
580
- flush if @write_io.size > 0
580
+ flush if @write_io.size > 0 # rubocop:disable Style/ZeroLengthPredicate
581
581
  @write_io = args[0]
582
582
  else
583
583
  @write_io.write *args
@@ -3,6 +3,7 @@
3
3
  module Files
4
4
  class Folder
5
5
  attr_reader :options, :attributes
6
+
6
7
  def self.[](*_)
7
8
  raise NotImplementedError
8
9
  end
@@ -3,6 +3,7 @@
3
3
  module Files
4
4
  class Session
5
5
  attr_reader :options, :attributes
6
+
6
7
  def destroy(params = {}, options = {})
7
8
  Session.destroy(params, options.merge(session: self, session_id: nil))
8
9
  end
@@ -666,6 +666,7 @@ module Files
666
666
  raise InvalidParameterError.new("Bad parameter: default_time_zone must be an String") if params.dig(:default_time_zone) and !params.dig(:default_time_zone).is_a?(String)
667
667
  raise InvalidParameterError.new("Bad parameter: desktop_app_session_lifetime must be an Integer") if params.dig(:desktop_app_session_lifetime) and !params.dig(:desktop_app_session_lifetime).is_a?(Integer)
668
668
  raise InvalidParameterError.new("Bad parameter: welcome_screen must be an String") if params.dig(:welcome_screen) and !params.dig(:welcome_screen).is_a?(String)
669
+ raise InvalidParameterError.new("Bad parameter: session_expiry must be an Float") if params.dig(:session_expiry) and !params.dig(:session_expiry).is_a?(Float)
669
670
  raise InvalidParameterError.new("Bad parameter: user_lockout_tries must be an Integer") if params.dig(:user_lockout_tries) and !params.dig(:user_lockout_tries).is_a?(Integer)
670
671
  raise InvalidParameterError.new("Bad parameter: user_lockout_within must be an Integer") if params.dig(:user_lockout_within) and !params.dig(:user_lockout_within).is_a?(Integer)
671
672
  raise InvalidParameterError.new("Bad parameter: user_lockout_lock_period must be an Integer") if params.dig(:user_lockout_lock_period) and !params.dig(:user_lockout_lock_period).is_a?(Integer)
@@ -5,7 +5,7 @@ module Files
5
5
 
6
6
  w.instance_variable_set(:@read_io, r)
7
7
 
8
- [r, w]
8
+ [ r, w ]
9
9
  end
10
10
 
11
11
  def size
@@ -29,4 +29,4 @@ module Files
29
29
  @read_io || self
30
30
  end
31
31
  end
32
- end
32
+ end
@@ -16,9 +16,7 @@ RSpec.configure do |config|
16
16
  let(:options) { { api_key: api_key } }
17
17
  end
18
18
 
19
- RSpec.configure do |config|
20
- config.include_context "API Helpers", :with_test_folder
21
- end
19
+ config.include_context "API Helpers", :with_test_folder
22
20
 
23
21
  config.around(:example, :with_test_folder) do |all|
24
22
  @api_key = ENV["TEST_API_KEY"] || File.read("../../config/test_api_key.txt")
@@ -63,7 +63,7 @@ end
63
63
 
64
64
  def test_sessions
65
65
  session = Files::Session.create(username: "sessionuser", password: "sessionuserpassword")
66
- user = Files::ApiKey.list({ user_id: 0 }, session: session)
66
+ Files::ApiKey.list({ user_id: 0 }, session: session)
67
67
  session.destroy
68
68
  end
69
69
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: files.com
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.72
4
+ version: 1.0.73
5
5
  platform: ruby
6
6
  authors:
7
7
  - files.com
@@ -11,61 +11,61 @@ cert_chain: []
11
11
  date: 2020-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: faraday
14
+ name: addressable
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 1.0.1
19
+ version: 2.7.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 1.0.1
26
+ version: 2.7.0
27
27
  - !ruby/object:Gem::Dependency
28
- name: net-http-persistent
28
+ name: concurrent-ruby
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 1.1.3
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: 1.1.3
41
41
  - !ruby/object:Gem::Dependency
42
- name: addressable
42
+ name: faraday
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 2.7.0
47
+ version: 1.0.1
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 2.7.0
54
+ version: 1.0.1
55
55
  - !ruby/object:Gem::Dependency
56
- name: concurrent-ruby
56
+ name: net-http-persistent
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 1.1.3
61
+ version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 1.1.3
68
+ version: '0'
69
69
  description: The Files.com Ruby client.
70
70
  email:
71
71
  - support@files.com
@@ -77,6 +77,7 @@ extra_rdoc_files: []
77
77
  files:
78
78
  - CONTRIBUTORS
79
79
  - Gemfile
80
+ - Gemfile.lock
80
81
  - LICENSE
81
82
  - README.md
82
83
  - Rakefile
@@ -209,7 +210,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
209
210
  requirements:
210
211
  - - ">="
211
212
  - !ruby/object:Gem::Version
212
- version: '2.3'
213
+ version: '2.5'
213
214
  required_rubygems_version: !ruby/object:Gem::Requirement
214
215
  requirements:
215
216
  - - ">="