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 +4 -4
- data/lib/onlyoffice_file_helper/file_methods.rb +31 -0
- data/lib/onlyoffice_file_helper/version.rb +1 -1
- data/lib/onlyoffice_file_helper.rb +2 -0
- metadata +12 -130
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4d614438d887ec8d1072e68cc0adba1090495ef665946430311a426723ee14e
|
4
|
+
data.tar.gz: b6c68480205e99f8be216c9541aa580eed2987b8ef9d8fb394f5f1dd9f8cf95a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
@@ -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:
|
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:
|
12
|
+
date: 2024-01-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
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: :
|
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:
|
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: :
|
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:
|
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: :
|
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: '
|
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.
|
98
|
+
rubygems_version: 3.5.5
|
217
99
|
signing_key:
|
218
100
|
specification_version: 4
|
219
101
|
summary: ONLYOFFICE Helper Gem for File operation
|