onlyoffice_file_helper 1.0.0 → 2.0.0

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
  SHA256:
3
- metadata.gz: ebad99290f1b01ca78c2c2ff8d1d387d39aa6680d9c1f79e34e5c8a5fd88c92a
4
- data.tar.gz: 9a6030f9416d7d8e195c5de56102550b297fdcb7d971ad5053fc2a8029b2b4de
3
+ metadata.gz: d4d614438d887ec8d1072e68cc0adba1090495ef665946430311a426723ee14e
4
+ data.tar.gz: b6c68480205e99f8be216c9541aa580eed2987b8ef9d8fb394f5f1dd9f8cf95a
5
5
  SHA512:
6
- metadata.gz: a76a442f4083aa6e26ae4513249bb100954a03923474116b145dec81b07268c2310875b16935f2e166967426fa25919186e6856cbf2d7f9ae5298c28ee6aec68
7
- data.tar.gz: 5810ca797300bbf5ec5aa99092cc0f53b8046db7e0000e176fb989834275c7b302d68a75afd5710687b52ecd938c02ec46c3832a04c200f4fd3715b9f7e26659
6
+ metadata.gz: ef9183a3a6521276a3cad040de8e4c45877a9965c4cfa24b4d3296dd32628f70f19b36b4aff6332bd976d31532b026f5d74e73851b9bafdbcc6b00b35bb02f80
7
+ data.tar.gz: 6cae643e218e871846529d3c3673440839c022c96b7e9a1805097ca559247d6fe661332b39fdff658f4758d0d7e5b62a58b5ca3374b4ac62da099acf6ab1a8f4
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OnlyofficeFileHelper
4
+ # Methods used to work with files
5
+ module FileMethods
6
+ # Copies a file
7
+ # @param [String] file_path path to file to be copied
8
+ # @param [String] destination path to where to copy file
9
+ def copy_file(file_path, destination)
10
+ FileUtils.mkdir_p(destination) unless File.directory?(destination)
11
+ FileUtils.copy(file_path, destination)
12
+ end
13
+
14
+ # Moves a file
15
+ # @param [String] file_path path to file to be moved
16
+ # @param [String] destination path to where to move file
17
+ def move_file(file_path, destination)
18
+ FileUtils.mkdir_p(destination) unless File.directory?(destination)
19
+ FileUtils.move(file_path, destination)
20
+ end
21
+
22
+ # Get file size in bytes
23
+ # @param [String] file_path path to file
24
+ # @return [Integer] size of file in bytes
25
+ def file_size(file_path)
26
+ size = File.size?(file_path)
27
+ size = 0 if size.nil?
28
+ size
29
+ end
30
+ end
31
+ end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module OnlyofficeFileHelper
4
4
  # @return [String] version of gem
5
- VERSION = '1.0.0'
5
+ VERSION = '2.0.0'
6
6
  end
@@ -7,6 +7,7 @@ require 'onlyoffice_logger_helper'
7
7
  require 'find'
8
8
  require 'onlyoffice_file_helper/create_methods'
9
9
  require 'onlyoffice_file_helper/directory_methods'
10
+ require 'onlyoffice_file_helper/file_methods'
10
11
  require 'onlyoffice_file_helper/read_methods'
11
12
  require 'onlyoffice_file_helper/version'
12
13
  require 'onlyoffice_file_helper/linux_helper'
@@ -20,6 +21,7 @@ module OnlyofficeFileHelper
20
21
  extend CreateMethods
21
22
  extend DirectoryMethods
22
23
  extend ReadMethods
24
+ extend FileMethods
23
25
 
24
26
  class << self
25
27
  # Return name of file from full path
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onlyoffice_file_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ONLYOFFICE
@@ -9,72 +9,16 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-08-05 00:00:00.000000000 Z
12
+ date: 2024-01-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: onlyoffice_logger_helper
16
- requirement: !ruby/object:Gem::Requirement
17
- requirements:
18
- - - "~>"
19
- - !ruby/object:Gem::Version
20
- version: '1'
21
- type: :runtime
22
- prerelease: false
23
- version_requirements: !ruby/object:Gem::Requirement
24
- requirements:
25
- - - "~>"
26
- - !ruby/object:Gem::Version
27
- version: '1'
28
- - !ruby/object:Gem::Dependency
29
- name: rubyzip
30
- requirement: !ruby/object:Gem::Requirement
31
- requirements:
32
- - - "~>"
33
- - !ruby/object:Gem::Version
34
- version: '2'
35
- type: :runtime
36
- prerelease: false
37
- version_requirements: !ruby/object:Gem::Requirement
38
- requirements:
39
- - - "~>"
40
- - !ruby/object:Gem::Version
41
- version: '2'
42
- - !ruby/object:Gem::Dependency
43
- name: overcommit
44
- requirement: !ruby/object:Gem::Requirement
45
- requirements:
46
- - - "~>"
47
- - !ruby/object:Gem::Version
48
- version: '0'
49
- type: :development
50
- prerelease: false
51
- version_requirements: !ruby/object:Gem::Requirement
52
- requirements:
53
- - - "~>"
54
- - !ruby/object:Gem::Version
55
- version: '0'
56
- - !ruby/object:Gem::Dependency
57
- name: rake
58
- requirement: !ruby/object:Gem::Requirement
59
- requirements:
60
- - - "~>"
61
- - !ruby/object:Gem::Version
62
- version: '13'
63
- type: :development
64
- prerelease: false
65
- version_requirements: !ruby/object:Gem::Requirement
66
- requirements:
67
- - - "~>"
68
- - !ruby/object:Gem::Version
69
- version: '13'
70
- - !ruby/object:Gem::Dependency
71
- name: rspec
15
+ name: csv
72
16
  requirement: !ruby/object:Gem::Requirement
73
17
  requirements:
74
18
  - - "~>"
75
19
  - !ruby/object:Gem::Version
76
20
  version: '3'
77
- type: :development
21
+ type: :runtime
78
22
  prerelease: false
79
23
  version_requirements: !ruby/object:Gem::Requirement
80
24
  requirements:
@@ -82,27 +26,13 @@ dependencies:
82
26
  - !ruby/object:Gem::Version
83
27
  version: '3'
84
28
  - !ruby/object:Gem::Dependency
85
- name: rubocop
86
- requirement: !ruby/object:Gem::Requirement
87
- requirements:
88
- - - "~>"
89
- - !ruby/object:Gem::Version
90
- version: '1'
91
- type: :development
92
- prerelease: false
93
- version_requirements: !ruby/object:Gem::Requirement
94
- requirements:
95
- - - "~>"
96
- - !ruby/object:Gem::Version
97
- version: '1'
98
- - !ruby/object:Gem::Dependency
99
- name: rubocop-performance
29
+ name: onlyoffice_logger_helper
100
30
  requirement: !ruby/object:Gem::Requirement
101
31
  requirements:
102
32
  - - "~>"
103
33
  - !ruby/object:Gem::Version
104
34
  version: '1'
105
- type: :development
35
+ type: :runtime
106
36
  prerelease: false
107
37
  version_requirements: !ruby/object:Gem::Requirement
108
38
  requirements:
@@ -110,67 +40,19 @@ dependencies:
110
40
  - !ruby/object:Gem::Version
111
41
  version: '1'
112
42
  - !ruby/object:Gem::Dependency
113
- name: rubocop-rake
114
- requirement: !ruby/object:Gem::Requirement
115
- requirements:
116
- - - "~>"
117
- - !ruby/object:Gem::Version
118
- version: '0'
119
- type: :development
120
- prerelease: false
121
- version_requirements: !ruby/object:Gem::Requirement
122
- requirements:
123
- - - "~>"
124
- - !ruby/object:Gem::Version
125
- version: '0'
126
- - !ruby/object:Gem::Dependency
127
- name: rubocop-rspec
43
+ name: rubyzip
128
44
  requirement: !ruby/object:Gem::Requirement
129
45
  requirements:
130
46
  - - "~>"
131
47
  - !ruby/object:Gem::Version
132
48
  version: '2'
133
- type: :development
49
+ type: :runtime
134
50
  prerelease: false
135
51
  version_requirements: !ruby/object:Gem::Requirement
136
52
  requirements:
137
53
  - - "~>"
138
54
  - !ruby/object:Gem::Version
139
55
  version: '2'
140
- - !ruby/object:Gem::Dependency
141
- name: simplecov
142
- requirement: !ruby/object:Gem::Requirement
143
- requirements:
144
- - - "~>"
145
- - !ruby/object:Gem::Version
146
- version: '0'
147
- type: :development
148
- prerelease: false
149
- version_requirements: !ruby/object:Gem::Requirement
150
- requirements:
151
- - - "~>"
152
- - !ruby/object:Gem::Version
153
- version: '0'
154
- - !ruby/object:Gem::Dependency
155
- name: yard
156
- requirement: !ruby/object:Gem::Requirement
157
- requirements:
158
- - - "~>"
159
- - !ruby/object:Gem::Version
160
- version: '0'
161
- - - ">="
162
- - !ruby/object:Gem::Version
163
- version: 0.9.20
164
- type: :development
165
- prerelease: false
166
- version_requirements: !ruby/object:Gem::Requirement
167
- requirements:
168
- - - "~>"
169
- - !ruby/object:Gem::Version
170
- version: '0'
171
- - - ">="
172
- - !ruby/object:Gem::Version
173
- version: 0.9.20
174
56
  description: ONLYOFFICE Helper Gem for File operation. Used in QA
175
57
  email:
176
58
  - shockwavenn@gmail.com
@@ -181,6 +63,7 @@ files:
181
63
  - lib/onlyoffice_file_helper.rb
182
64
  - lib/onlyoffice_file_helper/create_methods.rb
183
65
  - lib/onlyoffice_file_helper/directory_methods.rb
66
+ - lib/onlyoffice_file_helper/file_methods.rb
184
67
  - lib/onlyoffice_file_helper/linux_helper.rb
185
68
  - lib/onlyoffice_file_helper/linux_helper/xdotool_helper.rb
186
69
  - lib/onlyoffice_file_helper/name.rb
@@ -190,12 +73,11 @@ files:
190
73
  - lib/onlyoffice_file_helper/version.rb
191
74
  homepage: https://github.com/ONLYOFFICE-QA/onlyoffice_file_helper
192
75
  licenses:
193
- - AGPL-3.0
76
+ - AGPL-3.0-or-later
194
77
  metadata:
195
78
  bug_tracker_uri: https://github.com/ONLYOFFICE-QA/onlyoffice_file_helper/issues
196
79
  changelog_uri: https://github.com/ONLYOFFICE-QA/onlyoffice_file_helper/blob/master/CHANGELOG.md
197
80
  documentation_uri: https://www.rubydoc.info/gems/onlyoffice_file_helper
198
- homepage_uri: https://github.com/ONLYOFFICE-QA/onlyoffice_file_helper
199
81
  source_code_uri: https://github.com/ONLYOFFICE-QA/onlyoffice_file_helper
200
82
  rubygems_mfa_required: 'true'
201
83
  post_install_message:
@@ -206,14 +88,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
206
88
  requirements:
207
89
  - - ">="
208
90
  - !ruby/object:Gem::Version
209
- version: '2.7'
91
+ version: '3.0'
210
92
  required_rubygems_version: !ruby/object:Gem::Requirement
211
93
  requirements:
212
94
  - - ">="
213
95
  - !ruby/object:Gem::Version
214
96
  version: '0'
215
97
  requirements: []
216
- rubygems_version: 3.3.19
98
+ rubygems_version: 3.5.5
217
99
  signing_key:
218
100
  specification_version: 4
219
101
  summary: ONLYOFFICE Helper Gem for File operation