plagiarism-checker 3.0.3 → 3.1.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 +5 -5
- data/.gitignore +8 -8
- data/Gemfile +6 -6
- data/LICENSE.txt +20 -20
- data/README.md +46 -38
- data/Rakefile +4 -4
- data/lib/copyleaks/api.rb +24 -54
- data/lib/copyleaks/app.config.rb +8 -0
- data/lib/copyleaks/models/exports/export_model.rb +3 -3
- data/lib/copyleaks/version.rb +3 -3
- data/plagiarism-checker.gemspec +29 -29
- metadata +6 -8
- data/plagiarism-checker-3.0.2.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e35843d2ef1d9d926ebcb7a799689e567dc91662cbbbe7a996345f342f9f4694
|
4
|
+
data.tar.gz: b65e0d03a2c7c930a3fd26d11f50e834d6856b42062013e0a2882cc04162fb0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e977e23ca5fc86194031ce6dcaf4bcf5007a6421f234615875c552fd71556fb2889f11543802a050f2566fdcfe6ce29a6229150adc4ac1d135b2fdf499a320c1
|
7
|
+
data.tar.gz: b0886f96f27a487cccf67886e7bbcb4761134eb700c2811f245b461073b026fdd065a5e45a8ba8265a8a73ccf6d33af8ce23da20f2e2a2376b547db1aae01648
|
data/.gitignore
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
/.bundle/
|
2
|
-
/.yardoc
|
3
|
-
/_yardoc/
|
4
|
-
/coverage/
|
5
|
-
/doc/
|
6
|
-
/pkg/
|
7
|
-
/spec/reports/
|
8
|
-
/tmp/
|
1
|
+
/.bundle/
|
2
|
+
/.yardoc
|
3
|
+
/_yardoc/
|
4
|
+
/coverage/
|
5
|
+
/doc/
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/tmp/
|
data/Gemfile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
source 'https://rubygems.org'
|
4
|
-
|
5
|
-
# Specify your gem's dependencies in plagiarism-checker.gemspec
|
6
|
-
gemspec
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source 'https://rubygems.org'
|
4
|
+
|
5
|
+
# Specify your gem's dependencies in plagiarism-checker.gemspec
|
6
|
+
gemspec
|
data/LICENSE.txt
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
The MIT License(MIT)
|
2
|
-
|
3
|
-
Copyright(c) 2016 Copyleaks LTD (https://copyleaks.com)
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
13
|
-
copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
1
|
+
The MIT License(MIT)
|
2
|
+
|
3
|
+
Copyright(c) 2016 Copyleaks LTD (https://copyleaks.com)
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
21
|
SOFTWARE.
|
data/README.md
CHANGED
@@ -1,39 +1,47 @@
|
|
1
|
-
# Copyleaks Ruby SDK
|
2
|
-
|
3
|
-
Copyleaks SDK is a simple framework that allows you to scan text for plagiarism and detect content distribution online, using the Copyleaks plagiarism checker cloud.
|
4
|
-
|
5
|
-
Using Copyleaks SDK you can check for plagiarism in:
|
6
|
-
* Online content and webpages
|
7
|
-
* Local and cloud files (see [supported files](https://api.copyleaks.com/documentation/specifications#2-supported-file-types))
|
8
|
-
* Free text
|
9
|
-
* OCR (Optical Character Recognition) - scanning pictures with textual content (see [supported files](https://api.copyleaks.com/documentation/specifications#6-supported-image-types-ocr))
|
10
|
-
|
11
|
-
## Installation
|
12
|
-
|
13
|
-
Install using [RubyGems](https://rubygems.org/gems/plagiarism-checker)
|
14
|
-
|
15
|
-
```bash
|
16
|
-
gem install plagiarism-checker
|
17
|
-
```
|
18
|
-
|
19
|
-
## Register and Get Your API Key
|
20
|
-
To use the Copyleaks API you need to first be a registered user. The registration to Copyleaks takes a minute and is free of charge. [Signup](https://api.copyleaks.com/?register=true) and make sure to confirm your account.
|
21
|
-
|
22
|
-
As a signed user you can generate your personal API key. Do so on your [dashboard home](https://api.copyleaks.com/dashboard
|
23
|
-
|
24
|
-
For more information check out our [API guide](https://api.copyleaks.com/documentation/v3).
|
25
|
-
|
26
|
-
## Usage
|
27
|
-
```rb
|
28
|
-
require 'copyleaks'
|
29
|
-
copyleaks = Copyleaks::API.new
|
30
|
-
res = copyleaks.login(<your email>,<your api key>)
|
31
|
-
puts res.to_json
|
32
|
-
```
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
*
|
38
|
-
|
1
|
+
# Copyleaks Ruby SDK
|
2
|
+
|
3
|
+
Copyleaks SDK is a simple framework that allows you to scan text for plagiarism and detect content distribution online, using the Copyleaks plagiarism checker cloud.
|
4
|
+
|
5
|
+
Using Copyleaks SDK you can check for plagiarism in:
|
6
|
+
* Online content and webpages
|
7
|
+
* Local and cloud files (see [supported files](https://api.copyleaks.com/documentation/specifications#2-supported-file-types))
|
8
|
+
* Free text
|
9
|
+
* OCR (Optical Character Recognition) - scanning pictures with textual content (see [supported files](https://api.copyleaks.com/documentation/specifications#6-supported-image-types-ocr))
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
Install using [RubyGems](https://rubygems.org/gems/plagiarism-checker)
|
14
|
+
|
15
|
+
```bash
|
16
|
+
gem install plagiarism-checker
|
17
|
+
```
|
18
|
+
|
19
|
+
## Register and Get Your API Key
|
20
|
+
To use the Copyleaks API you need to first be a registered user. The registration to Copyleaks takes a minute and is free of charge. [Signup](https://api.copyleaks.com/?register=true) and make sure to confirm your account.
|
21
|
+
|
22
|
+
As a signed user you can generate your personal API key. Do so on your [dashboard home](https://api.copyleaks.com/dashboard) under 'API Access Credentials'.
|
23
|
+
|
24
|
+
For more information check out our [API guide](https://api.copyleaks.com/documentation/v3).
|
25
|
+
|
26
|
+
## Usage
|
27
|
+
```rb
|
28
|
+
require 'copyleaks'
|
29
|
+
copyleaks = Copyleaks::API.new
|
30
|
+
res = copyleaks.login(<your email>,<your api key>)
|
31
|
+
puts res.to_json
|
32
|
+
```
|
33
|
+
* (Option) To change the Identity server URI (default:"https://id.copyleaks.com"):
|
34
|
+
```rb
|
35
|
+
Copyleaks::Config.identity_server_uri = "<your identity server uri>"
|
36
|
+
```
|
37
|
+
* (Option) To change the API server URI (default:"https://api.copyleaks.com"):
|
38
|
+
```rb
|
39
|
+
Copyleaks::Config.api_server_uri = "<your api server uri>"
|
40
|
+
```
|
41
|
+
|
42
|
+
## Demo
|
43
|
+
See [demo.rb](./demo/demo.rb) under demo folder for an example.
|
44
|
+
## Read More
|
45
|
+
* [API Homepage](https://api.copyleaks.com/)
|
46
|
+
* [API Documentation](https://api.copyleaks.com/documentation)
|
39
47
|
* [Plagiarism Report](https://github.com/Copyleaks/plagiarism-report)
|
data/Rakefile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'bundler/gem_tasks'
|
4
|
-
task default: %i[]
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'bundler/gem_tasks'
|
4
|
+
task default: %i[]
|
data/lib/copyleaks/api.rb
CHANGED
@@ -87,28 +87,25 @@ module Copyleaks
|
|
87
87
|
|
88
88
|
# Starting a new process by providing a file to scan.
|
89
89
|
# For more info:
|
90
|
-
# https://api.copyleaks.com/documentation/v3/
|
91
|
-
# https://api.copyleaks.com/documentation/v3/businesses/submit/file
|
90
|
+
# https://api.copyleaks.com/documentation/v3/scans/submit/file
|
92
91
|
# * Exceptions:
|
93
92
|
# * * CommandExceptions: Server reject the request. See response status code,
|
94
93
|
# headers and content for more info.
|
95
94
|
# * * UnderMaintenanceException: Copyleaks servers are unavailable for maintenance.
|
96
95
|
# We recommend to implement exponential backoff algorithm as described here:
|
97
96
|
# https://api.copyleaks.com/documentation/v3/exponential-backoff
|
98
|
-
# @param [String] product Which product (education or businesses) is being use.
|
99
97
|
# @param [CopyleaksAuthToken] authToken Copyleaks authentication token
|
100
98
|
# @param [String] scanId Attach your own scan Id
|
101
99
|
# @param [CopyleaksFileSubmissionModel] submission Submission properties
|
102
|
-
def submit_file(
|
100
|
+
def submit_file(authToken, scanId, submission)
|
103
101
|
raise 'scanId is Invalid, must be instance of String' if scanId.nil? || !scanId.instance_of?(String)
|
104
102
|
if submission.nil? || !submission.instance_of?(CopyleaksFileSubmissionModel)
|
105
103
|
raise 'submission is Invalid, must be instance of type CopyleaksFileSubmissionModel'
|
106
104
|
end
|
107
105
|
|
108
|
-
validate_product(product)
|
109
106
|
verify_auth_token(authToken)
|
110
107
|
|
111
|
-
path = "/v3
|
108
|
+
path = "/v3/scans/submit/file/#{scanId}"
|
112
109
|
|
113
110
|
headers = {
|
114
111
|
'Content-Type' => 'application/json',
|
@@ -124,28 +121,25 @@ module Copyleaks
|
|
124
121
|
|
125
122
|
# Starting a new process by providing a OCR image file to scan.
|
126
123
|
# For more info:
|
127
|
-
# https://api.copyleaks.com/documentation/v3/
|
128
|
-
# https://api.copyleaks.com/documentation/v3/businesses/submit/ocr
|
124
|
+
# https://api.copyleaks.com/documentation/v3/scans/submit/ocr
|
129
125
|
# * Exceptions:
|
130
126
|
# * * CommandExceptions: Server reject the request. See response status code,
|
131
127
|
# headers and content for more info.
|
132
128
|
# * * UnderMaintenanceException: Copyleaks servers are unavailable for maintenance.
|
133
129
|
# We recommend to implement exponential backoff algorithm as described here:
|
134
130
|
# https://api.copyleaks.com/documentation/v3/exponential-backoff
|
135
|
-
# @param [String] product Which product (education or businesses) is being use.
|
136
131
|
# @param [CopyleaksAuthToken] authToken Copyleaks authentication token
|
137
132
|
# @param [String] scanId Attach your own scan Id
|
138
133
|
# @param [CopyleaksFileOcrSubmissionModel] submission Submission properties
|
139
|
-
def submit_file_ocr(
|
134
|
+
def submit_file_ocr(authToken, scanId, submission)
|
140
135
|
raise 'scanId is Invalid, must be instance of String' if scanId.nil? || !scanId.instance_of?(String)
|
141
136
|
if submission.nil? || !submission.instance_of?(CopyleaksFileOcrSubmissionModel)
|
142
137
|
raise 'submission is Invalid, must be instance of type CopyleaksFileOcrSubmissionModel'
|
143
138
|
end
|
144
139
|
|
145
|
-
validate_product(product)
|
146
140
|
verify_auth_token(authToken)
|
147
141
|
|
148
|
-
path = "/v3
|
142
|
+
path = "/v3/scans/submit/ocr/#{scanId}"
|
149
143
|
|
150
144
|
headers = {
|
151
145
|
'Content-Type' => 'application/json',
|
@@ -161,28 +155,25 @@ module Copyleaks
|
|
161
155
|
|
162
156
|
# Starting a new process by providing a URL to scan.
|
163
157
|
# For more info:
|
164
|
-
# https://api.copyleaks.com/documentation/v3/
|
165
|
-
# https://api.copyleaks.com/documentation/v3/businesses/submit/url
|
158
|
+
# https://api.copyleaks.com/documentation/v3/scans/submit/url
|
166
159
|
# * Exceptions:
|
167
160
|
# * * CommandExceptions: Server reject the request. See response status code,
|
168
161
|
# headers and content for more info.
|
169
162
|
# * * UnderMaintenanceException: Copyleaks servers are unavailable for maintenance.
|
170
163
|
# We recommend to implement exponential backoff algorithm as described here:
|
171
164
|
# https://api.copyleaks.com/documentation/v3/exponential-backoff
|
172
|
-
# @param [String] product Which product (education or businesses) is being use.
|
173
165
|
# @param [CopyleaksAuthToken] authToken Copyleaks authentication token
|
174
166
|
# @param [String] scanId Attach your own scan Id
|
175
167
|
# @param [CopyleaksURLSubmissionModel] submission Submission properties
|
176
|
-
def submit_url(
|
168
|
+
def submit_url(authToken, scanId, submission)
|
177
169
|
raise 'scanId is Invalid, must be instance of String' if scanId.nil? || !scanId.instance_of?(String)
|
178
170
|
if submission.nil? || !submission.instance_of?(CopyleaksURLSubmissionModel)
|
179
171
|
raise 'submission is Invalid, must be instance of CopyleaksURLSubmissionModel'
|
180
172
|
end
|
181
173
|
|
182
|
-
validate_product(product)
|
183
174
|
verify_auth_token(authToken)
|
184
175
|
|
185
|
-
path = "/v3
|
176
|
+
path = "/v3/scans/submit/url/#{scanId}"
|
186
177
|
|
187
178
|
headers = {
|
188
179
|
'Content-Type' => 'application/json',
|
@@ -233,26 +224,23 @@ module Copyleaks
|
|
233
224
|
|
234
225
|
# Start scanning all the files you submitted for a price-check.
|
235
226
|
# For more info:
|
236
|
-
# https://api.copyleaks.com/documentation/v3/
|
237
|
-
# https://api.copyleaks.com/documentation/v3/businesses/start
|
227
|
+
# https://api.copyleaks.com/documentation/v3/scans/start
|
238
228
|
# * Exceptions:
|
239
229
|
# * * CommandExceptions: Server reject the request. See response status code,
|
240
230
|
# headers and content for more info.
|
241
231
|
# * * UnderMaintenanceException: Copyleaks servers are unavailable for maintenance.
|
242
232
|
# We recommend to implement exponential backoff algorithm as described here:
|
243
233
|
# https://api.copyleaks.com/documentation/v3/exponential-backoff
|
244
|
-
# @param [String] product Which product (education or businesses) is being use.
|
245
234
|
# @param [CopyleaksAuthToken] authToken Your login token to Copyleaks server.
|
246
235
|
# @param [CopyleaksStartRequestModel] data Include information about which scans should be started.
|
247
|
-
def start(
|
236
|
+
def start(authToken, data)
|
248
237
|
if data.nil? || !data.instance_of?(CopyleaksStartRequestModel)
|
249
238
|
raise 'data is Invalid, must be instance of type CopyleaksStartRequestModel'
|
250
239
|
end
|
251
240
|
|
252
|
-
validate_product(product)
|
253
241
|
verify_auth_token(authToken)
|
254
242
|
|
255
|
-
path = "/v3
|
243
|
+
path = "/v3/scans/start"
|
256
244
|
|
257
245
|
headers = {
|
258
246
|
'Content-Type' => 'application/json',
|
@@ -269,26 +257,23 @@ module Copyleaks
|
|
269
257
|
|
270
258
|
# Delete the specific process from the server.
|
271
259
|
# For more info:
|
272
|
-
# https://api.copyleaks.com/documentation/v3/
|
273
|
-
# https://api.copyleaks.com/documentation/v3/businesses/delete
|
260
|
+
# https://api.copyleaks.com/documentation/v3/scans/delete
|
274
261
|
# * Exceptions:
|
275
262
|
# * * CommandExceptions: Server reject the request. See response status code,
|
276
263
|
# headers and content for more info.
|
277
264
|
# * * UnderMaintenanceException: Copyleaks servers are unavailable for maintenance.
|
278
265
|
# We recommend to implement exponential backoff algorithm as described here:
|
279
266
|
# https://api.copyleaks.com/documentation/v3/exponential-backoff
|
280
|
-
# @param [String] product Which product (education or businesses) is being use.
|
281
267
|
# @param [CopyleaksAuthToken] authToken Copyleaks authentication token
|
282
268
|
# @param [CopyleaksDeleteRequestModel] data
|
283
|
-
def delete(
|
269
|
+
def delete(authToken, data)
|
284
270
|
if data.nil? || !data.instance_of?(CopyleaksDeleteRequestModel)
|
285
271
|
raise 'data is Invalid, must be instance of CopyleaksDeleteRequestModel'
|
286
272
|
end
|
287
273
|
|
288
|
-
validate_product(product)
|
289
274
|
verify_auth_token(authToken)
|
290
275
|
|
291
|
-
path = "/v3.1
|
276
|
+
path = "/v3.1/scans/delete"
|
292
277
|
|
293
278
|
headers = {
|
294
279
|
'Content-Type' => 'application/json',
|
@@ -304,24 +289,21 @@ module Copyleaks
|
|
304
289
|
|
305
290
|
# Resend status webhooks for existing scans.
|
306
291
|
# For more info:
|
307
|
-
# https://api.copyleaks.com/documentation/v3/
|
308
|
-
# https://api.copyleaks.com/documentation/v3/businesses/webhook-resend
|
292
|
+
# https://api.copyleaks.com/documentation/v3/scans/webhook-resend
|
309
293
|
# * Exceptions:
|
310
294
|
# * * CommandExceptions: Server reject the request. See response status code,
|
311
295
|
# headers and content for more info.
|
312
296
|
# * * UnderMaintenanceException: Copyleaks servers are unavailable for maintenance.
|
313
297
|
# We recommend to implement exponential backoff algorithm as described here:
|
314
298
|
# https://api.copyleaks.com/documentation/v3/exponential-backoff
|
315
|
-
# @param [String] product Which product (education or businesses) is being use.
|
316
299
|
# @param [CopyleaksAuthToken] authToken Copyleaks authentication token
|
317
300
|
# @param [String] scanId Copyleaks scan Id
|
318
|
-
def resend_webhook(
|
301
|
+
def resend_webhook(authToken, scanId)
|
319
302
|
raise 'scanId is Invalid, must be instance of String' if scanId.nil? || !scanId.instance_of?(String)
|
320
303
|
|
321
|
-
validate_product(product)
|
322
304
|
verify_auth_token(authToken)
|
323
305
|
|
324
|
-
path = "/v3
|
306
|
+
path = "/v3/scans/#{scanId}/webhooks/resend"
|
325
307
|
|
326
308
|
headers = {
|
327
309
|
'Content-Type' => 'application/json',
|
@@ -335,8 +317,7 @@ module Copyleaks
|
|
335
317
|
|
336
318
|
# Get current credits balance for the Copyleaks account.
|
337
319
|
# For more info:
|
338
|
-
# https://api.copyleaks.com/documentation/v3/
|
339
|
-
# https://api.copyleaks.com/documentation/v3/businesses/credits
|
320
|
+
# https://api.copyleaks.com/documentation/v3/scans/credits
|
340
321
|
# * Exceptions:
|
341
322
|
# * * CommandExceptions: Server reject the request. See response status code,
|
342
323
|
# headers and content for more info.
|
@@ -344,13 +325,11 @@ module Copyleaks
|
|
344
325
|
# We recommend to implement exponential backoff algorithm as described here:
|
345
326
|
# https://api.copyleaks.com/documentation/v3/exponential-backoff
|
346
327
|
# * * RateLimitException: Too many requests. Please wait before calling again.
|
347
|
-
# @param [String] product Which product (education or businesses) is being use.
|
348
328
|
# @param [CopyleaksAuthToken] authToken Copyleaks authentication token
|
349
|
-
def get_credits_balance(
|
350
|
-
validate_product(product)
|
329
|
+
def get_credits_balance(authToken)
|
351
330
|
verify_auth_token(authToken)
|
352
331
|
|
353
|
-
path = "/v3
|
332
|
+
path = "/v3/scans/credits"
|
354
333
|
|
355
334
|
headers = {
|
356
335
|
'Content-Type' => 'application/json',
|
@@ -365,8 +344,7 @@ module Copyleaks
|
|
365
344
|
# This endpoint allows you to export your usage history between two dates.
|
366
345
|
# The output results will be exported to a csv file and it will be attached to the response.
|
367
346
|
# For more info:
|
368
|
-
# https://api.copyleaks.com/documentation/v3/
|
369
|
-
# https://api.copyleaks.com/documentation/v3/businesses/usages/history
|
347
|
+
# https://api.copyleaks.com/documentation/v3/scans/usages/history
|
370
348
|
# * Exceptions:
|
371
349
|
# * * CommandExceptions: Server reject the request. See response status code,
|
372
350
|
# headers and content for more info.
|
@@ -374,18 +352,16 @@ module Copyleaks
|
|
374
352
|
# We recommend to implement exponential backoff algorithm as described here:
|
375
353
|
# https://api.copyleaks.com/documentation/v3/exponential-backoff
|
376
354
|
# * * RateLimitException: Too many requests. Please wait before calling again.
|
377
|
-
# @param [String] product Which product (education or businesses) is being use.
|
378
355
|
# @param [CopyleaksAuthToken] authToken Copyleaks authentication token.
|
379
356
|
# @param [String] startDate The start date to collect usage history from. Date Format: `dd-MM-yyyy`.
|
380
357
|
# @param [String] endDate The end date to collect usage history from. Date Format: `dd-MM-yyyy`.
|
381
|
-
def get_usages_history_csv(
|
358
|
+
def get_usages_history_csv(authToken, startDate, endDate)
|
382
359
|
raise 'startDate is Invalid, must be instance of String' if startDate.nil? || !startDate.instance_of?(String)
|
383
360
|
raise 'endDate is Invalid, must be instance of String' if endDate.nil? || !endDate.instance_of?(String)
|
384
361
|
|
385
|
-
validate_product(product)
|
386
362
|
verify_auth_token(authToken)
|
387
363
|
|
388
|
-
path = "/v3
|
364
|
+
path = "/v3/scans/usages/history?start=#{startDate}&end=#{endDate}"
|
389
365
|
|
390
366
|
headers = {
|
391
367
|
'Content-Type' => 'application/json',
|
@@ -461,12 +437,6 @@ module Copyleaks
|
|
461
437
|
handle_response(@api_client.request(request), 'get_release_notes')
|
462
438
|
end
|
463
439
|
|
464
|
-
def validate_product(product)
|
465
|
-
if product.nil? || (product != 'education' && product != 'businesses')
|
466
|
-
raise "Invalid product, product must be set to 'education' or 'businesses'"
|
467
|
-
end
|
468
|
-
end
|
469
|
-
|
470
440
|
# this methods is a helper for hanlding reponse data and exceptions.
|
471
441
|
def handle_response(response, used_by)
|
472
442
|
if Utils.is_success_status_code(response.code)
|
data/lib/copyleaks/app.config.rb
CHANGED
@@ -46,15 +46,15 @@ module Copyleaks
|
|
46
46
|
raise 'Copyleaks::CopyleaksExportModel - crawledVersion - crawledVersion must be of type Copyleaks::ExportCrawledVersion'
|
47
47
|
end
|
48
48
|
|
49
|
-
if !pdfReport.nil? && pdfReport.instance_of?(ExportPdfReport)
|
49
|
+
if !pdfReport.nil? && !pdfReport.instance_of?(ExportPdfReport)
|
50
50
|
raise 'Copyleaks::CopyleaksExportModel - pdfReport - pdfReport must be of type Copyleaks::ExportPdfReport'
|
51
51
|
end
|
52
52
|
|
53
|
-
if !maxRetries.nil? && maxRetries.instance_of?(Integer)
|
53
|
+
if !maxRetries.nil? && !maxRetries.instance_of?(Integer)
|
54
54
|
raise 'Copyleaks::CopyleaksExportModel - maxRetries - maxRetries must be of type Integer'
|
55
55
|
end
|
56
56
|
|
57
|
-
if !developerPayload.nil? && developerPayload.instance_of?(String)
|
57
|
+
if !developerPayload.nil? && !developerPayload.instance_of?(String)
|
58
58
|
raise 'Copyleaks::CopyleaksExportModel - developerPayload - developerPayload must be of type String'
|
59
59
|
end
|
60
60
|
|
data/lib/copyleaks/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
module Copyleaks
|
2
|
-
VERSION = '3.0
|
3
|
-
end
|
1
|
+
module Copyleaks
|
2
|
+
VERSION = '3.1.0'
|
3
|
+
end
|
data/plagiarism-checker.gemspec
CHANGED
@@ -1,29 +1,29 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
lib = File.expand_path('lib', __dir__)
|
4
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
-
|
6
|
-
require 'copyleaks/version'
|
7
|
-
|
8
|
-
Gem::Specification.new do |spec|
|
9
|
-
spec.name = 'plagiarism-checker'
|
10
|
-
spec.version = Copyleaks::VERSION
|
11
|
-
spec.authors = ['Copyleaks ltd']
|
12
|
-
spec.email = ['sales@copyleaks.com']
|
13
|
-
|
14
|
-
spec.summary = 'Detects plagiarism and checks content distribution online.'
|
15
|
-
spec.description = 'Copyleaks detects plagiarism and checks content distribution online. Use Copyleaks to find out if textual content is original and if it has been used before. With Copyleaks cloud publishers, academics, and more can scan files (pdf, doc, docx, ocr...), URLs and free text for plagiarism check.'
|
16
|
-
spec.homepage = 'https://api.copyleaks.com'
|
17
|
-
spec.license = 'MIT'
|
18
|
-
|
19
|
-
spec.metadata['homepage_uri'] = spec.homepage
|
20
|
-
spec.metadata['source_code_uri'] = 'https://github.com/Copyleaks/Ruby-Plagiarism-Checker'
|
21
|
-
spec.metadata['changelog_uri'] = 'https://github.com/Copyleaks/Ruby-Plagiarism-Checker/releases'
|
22
|
-
|
23
|
-
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
24
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:demo|test|spec|features)/}) }
|
25
|
-
end
|
26
|
-
spec.bindir = 'exe'
|
27
|
-
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
28
|
-
spec.require_paths = ['lib']
|
29
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
|
6
|
+
require 'copyleaks/version'
|
7
|
+
|
8
|
+
Gem::Specification.new do |spec|
|
9
|
+
spec.name = 'plagiarism-checker'
|
10
|
+
spec.version = Copyleaks::VERSION
|
11
|
+
spec.authors = ['Copyleaks ltd']
|
12
|
+
spec.email = ['sales@copyleaks.com']
|
13
|
+
|
14
|
+
spec.summary = 'Detects plagiarism and checks content distribution online.'
|
15
|
+
spec.description = 'Copyleaks detects plagiarism and checks content distribution online. Use Copyleaks to find out if textual content is original and if it has been used before. With Copyleaks cloud publishers, academics, and more can scan files (pdf, doc, docx, ocr...), URLs and free text for plagiarism check.'
|
16
|
+
spec.homepage = 'https://api.copyleaks.com'
|
17
|
+
spec.license = 'MIT'
|
18
|
+
|
19
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
20
|
+
spec.metadata['source_code_uri'] = 'https://github.com/Copyleaks/Ruby-Plagiarism-Checker'
|
21
|
+
spec.metadata['changelog_uri'] = 'https://github.com/Copyleaks/Ruby-Plagiarism-Checker/releases'
|
22
|
+
|
23
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
24
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:demo|test|spec|features)/}) }
|
25
|
+
end
|
26
|
+
spec.bindir = 'exe'
|
27
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
28
|
+
spec.require_paths = ['lib']
|
29
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plagiarism-checker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Copyleaks ltd
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Copyleaks detects plagiarism and checks content distribution online.
|
14
14
|
Use Copyleaks to find out if textual content is original and if it has been used
|
@@ -69,7 +69,6 @@ files:
|
|
69
69
|
- lib/copyleaks/utils/status-code.utils.rb
|
70
70
|
- lib/copyleaks/version.rb
|
71
71
|
- lib/index.rb
|
72
|
-
- plagiarism-checker-3.0.2.gem
|
73
72
|
- plagiarism-checker.gemspec
|
74
73
|
homepage: https://api.copyleaks.com
|
75
74
|
licenses:
|
@@ -78,7 +77,7 @@ metadata:
|
|
78
77
|
homepage_uri: https://api.copyleaks.com
|
79
78
|
source_code_uri: https://github.com/Copyleaks/Ruby-Plagiarism-Checker
|
80
79
|
changelog_uri: https://github.com/Copyleaks/Ruby-Plagiarism-Checker/releases
|
81
|
-
post_install_message:
|
80
|
+
post_install_message:
|
82
81
|
rdoc_options: []
|
83
82
|
require_paths:
|
84
83
|
- lib
|
@@ -93,9 +92,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
92
|
- !ruby/object:Gem::Version
|
94
93
|
version: '0'
|
95
94
|
requirements: []
|
96
|
-
|
97
|
-
|
98
|
-
signing_key:
|
95
|
+
rubygems_version: 3.3.7
|
96
|
+
signing_key:
|
99
97
|
specification_version: 4
|
100
98
|
summary: Detects plagiarism and checks content distribution online.
|
101
99
|
test_files: []
|
Binary file
|