plagiarism-checker 2.1.0 → 3.0.2
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/.gitignore +8 -12
- data/Gemfile +6 -4
- data/LICENSE.txt +21 -21
- data/README.md +39 -0
- data/Rakefile +4 -2
- data/bin/console +10 -2
- data/lib/copyleaks/api.rb +493 -0
- data/lib/copyleaks/app.config.rb +47 -0
- data/lib/copyleaks/models/auth_token.rb +54 -0
- data/lib/copyleaks/models/delete_request_model.rb +64 -0
- data/lib/copyleaks/models/exceptions/auth_exipred_exception.rb +32 -0
- data/lib/copyleaks/models/exceptions/command_exception.rb +32 -0
- data/lib/copyleaks/models/exceptions/index.rb +32 -0
- data/lib/copyleaks/models/exceptions/rate_limit_exception.rb +32 -0
- data/lib/copyleaks/models/exceptions/under_maintenance_exception.rb +32 -0
- data/lib/copyleaks/models/exports/export_crawled_version.rb +54 -0
- data/lib/copyleaks/models/exports/export_model.rb +84 -0
- data/lib/copyleaks/models/exports/export_pdf_report.rb +54 -0
- data/lib/copyleaks/models/exports/export_results.rb +56 -0
- data/lib/copyleaks/models/exports/index.rb +32 -0
- data/lib/copyleaks/models/id_object.rb +44 -0
- data/lib/copyleaks/models/index.rb +35 -0
- data/lib/copyleaks/models/start_request_model.rb +63 -0
- data/lib/copyleaks/models/submissions/file_ocr_submission_model.rb +61 -0
- data/lib/copyleaks/models/submissions/file_submission_model.rb +57 -0
- data/lib/copyleaks/models/submissions/index.rb +33 -0
- data/lib/copyleaks/models/submissions/properties/actions.rb +33 -0
- data/lib/copyleaks/models/submissions/properties/author.rb +41 -0
- data/lib/copyleaks/models/submissions/properties/copyleaks_db.rb +44 -0
- data/lib/copyleaks/models/submissions/properties/domains_mode.rb +31 -0
- data/lib/copyleaks/models/submissions/properties/exclude.rb +59 -0
- data/lib/copyleaks/models/submissions/properties/filter.rb +67 -0
- data/lib/copyleaks/models/submissions/properties/index.rb +45 -0
- data/lib/copyleaks/models/submissions/properties/indexing.rb +41 -0
- data/lib/copyleaks/models/submissions/properties/pdf_properties.rb +55 -0
- data/lib/copyleaks/models/submissions/properties/repository.rb +41 -0
- data/lib/copyleaks/models/submissions/properties/scanning.rb +55 -0
- data/lib/copyleaks/models/submissions/properties/scanning_exclude.rb +44 -0
- data/lib/copyleaks/models/submissions/properties/scanning_repository.rb +46 -0
- data/lib/copyleaks/models/submissions/properties/sensitive_data_protection.rb +71 -0
- data/lib/copyleaks/models/submissions/properties/submission_properties.rb +136 -0
- data/lib/copyleaks/models/submissions/properties/webhooks.rb +44 -0
- data/lib/copyleaks/models/submissions/submission_model.rb +47 -0
- data/lib/copyleaks/models/submissions/url_submission_model.rb +51 -0
- data/lib/copyleaks/utils/status-code.utils.rb +38 -0
- data/lib/copyleaks/version.rb +3 -0
- data/lib/index.rb +30 -0
- data/plagiarism-checker.gemspec +29 -0
- metadata +50 -108
- data/.rubocop.yml +0 -2
- data/copyleaks_api.gemspec +0 -29
- data/example_async.rb +0 -50
- data/example_syncronized.rb +0 -73
- data/lib/copyleaks_api.rb +0 -24
- data/lib/copyleaks_api/Models/ResultRecord.rb +0 -60
- data/lib/copyleaks_api/access_token.rb +0 -36
- data/lib/copyleaks_api/api.rb +0 -210
- data/lib/copyleaks_api/config.rb +0 -36
- data/lib/copyleaks_api/copyleaks_cloud.rb +0 -116
- data/lib/copyleaks_api/copyleaks_process.rb +0 -78
- data/lib/copyleaks_api/errors.rb +0 -29
- data/lib/copyleaks_api/validators/custom_fields_validator.rb +0 -35
- data/lib/copyleaks_api/validators/email_validator.rb +0 -13
- data/lib/copyleaks_api/validators/file_validator.rb +0 -56
- data/lib/copyleaks_api/validators/language_validator.rb +0 -12
- data/lib/copyleaks_api/validators/response_validator.rb +0 -27
- data/lib/copyleaks_api/validators/url_validator.rb +0 -12
- data/lib/copyleaks_api/version.rb +0 -3
@@ -0,0 +1,41 @@
|
|
1
|
+
#
|
2
|
+
# The MIT License(MIT)
|
3
|
+
#
|
4
|
+
# Copyright(c) 2016 Copyleaks LTD (https://copyleaks.com)
|
5
|
+
#
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
# of this software and associated documentation files (the "Software"), to deal
|
8
|
+
# in the Software without restriction, including without limitation the rights
|
9
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
# copies of the Software, and to permit persons to whom the Software is
|
11
|
+
# furnished to do so, subject to the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be included in all
|
14
|
+
# copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
+
# SOFTWARE.
|
23
|
+
# =
|
24
|
+
module Copyleaks
|
25
|
+
class SubmissionAuthor
|
26
|
+
# @param [String] id A unique identifier that represents the author of the content. Make sure to use the same ID for the same author. Using this feature Copyleaks can detect the author's writing patterns and get better results.
|
27
|
+
def initialize(id)
|
28
|
+
@id = id
|
29
|
+
end
|
30
|
+
|
31
|
+
def as_json(*_args)
|
32
|
+
{
|
33
|
+
id: @id
|
34
|
+
}.select { |_k, v| !v.nil? }
|
35
|
+
end
|
36
|
+
|
37
|
+
def to_json(*options)
|
38
|
+
as_json(*options).to_json(*options)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
#
|
2
|
+
# The MIT License(MIT)
|
3
|
+
#
|
4
|
+
# Copyright(c) 2016 Copyleaks LTD (https://copyleaks.com)
|
5
|
+
#
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
# of this software and associated documentation files (the "Software"), to deal
|
8
|
+
# in the Software without restriction, including without limitation the rights
|
9
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
# copies of the Software, and to permit persons to whom the Software is
|
11
|
+
# furnished to do so, subject to the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be included in all
|
14
|
+
# copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
+
# SOFTWARE.
|
23
|
+
# =
|
24
|
+
module Copyleaks
|
25
|
+
class SubmissionScanningCopyleaksDB
|
26
|
+
# @param [Boolean] includeMySubmissions When set to true: Copyleaks will also compare against content which was uploaded by YOU to the Copyleaks internal database. If true, it will also index the scan in the Copyleaks internal database.
|
27
|
+
# @param [Boolean] includeOthersSubmissions When set to true: Copyleaks will also compare against content which was uploaded by OTHERS to the Copyleaks internal database. If true, it will also index the scan in the Copyleaks internal database.
|
28
|
+
def initialize(includeMySubmissions, includeOthersSubmissions)
|
29
|
+
@includeMySubmissions = includeMySubmissions
|
30
|
+
@includeOthersSubmissions = includeOthersSubmissions
|
31
|
+
end
|
32
|
+
|
33
|
+
def as_json(*_args)
|
34
|
+
{
|
35
|
+
includeMySubmissions: @includeMySubmissions,
|
36
|
+
includeOthersSubmissions: @includeOthersSubmissions
|
37
|
+
}.select { |_k, v| !v.nil? }
|
38
|
+
end
|
39
|
+
|
40
|
+
def to_json(*options)
|
41
|
+
as_json(*options).to_json(*options)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
#
|
2
|
+
# The MIT License(MIT)
|
3
|
+
#
|
4
|
+
# Copyright(c) 2016 Copyleaks LTD (https://copyleaks.com)
|
5
|
+
#
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
# of this software and associated documentation files (the "Software"), to deal
|
8
|
+
# in the Software without restriction, including without limitation the rights
|
9
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
# copies of the Software, and to permit persons to whom the Software is
|
11
|
+
# furnished to do so, subject to the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be included in all
|
14
|
+
# copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
+
# SOFTWARE.
|
23
|
+
# =
|
24
|
+
module Copyleaks
|
25
|
+
class SubmissionFilterDomainsMode
|
26
|
+
# When Include is selected, Copyleaks will filter out all results that are not part of the properties.filters.domains list.
|
27
|
+
INCLUDE = 0
|
28
|
+
# When Exclude is selected, Copyleaks will only find results outside of the properties.filters.domains list.
|
29
|
+
EXCLUDE = 1
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
#
|
2
|
+
# The MIT License(MIT)
|
3
|
+
#
|
4
|
+
# Copyright(c) 2016 Copyleaks LTD (https://copyleaks.com)
|
5
|
+
#
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
# of this software and associated documentation files (the "Software"), to deal
|
8
|
+
# in the Software without restriction, including without limitation the rights
|
9
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
# copies of the Software, and to permit persons to whom the Software is
|
11
|
+
# furnished to do so, subject to the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be included in all
|
14
|
+
# copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
+
# SOFTWARE.
|
23
|
+
# =
|
24
|
+
module Copyleaks
|
25
|
+
class SubmissionExclude
|
26
|
+
# @param [Boolean] quotes Exclude quoted text from the scan.
|
27
|
+
# @param [Boolean] references Exclude referenced text from the scan.
|
28
|
+
# @param [Boolean] tableOfContents Exclude table of contents from the scan.
|
29
|
+
# @param [Boolean] titles Exclude titles from the scan.
|
30
|
+
# @param [Boolean] htmlTemplate When the scanned document is an HTML document, exclude irrelevant text that appears across the site like the website footer or header.
|
31
|
+
def initialize(
|
32
|
+
quotes = false,
|
33
|
+
references = false,
|
34
|
+
tableOfContents = false,
|
35
|
+
titles = false,
|
36
|
+
htmlTemplate = false
|
37
|
+
)
|
38
|
+
@quotes = quotes
|
39
|
+
@references = references
|
40
|
+
@tableOfContents = tableOfContents
|
41
|
+
@titles = titles
|
42
|
+
@htmlTemplate = htmlTemplate
|
43
|
+
end
|
44
|
+
|
45
|
+
def as_json(*_args)
|
46
|
+
{
|
47
|
+
quotes: @quotes,
|
48
|
+
references: @references,
|
49
|
+
tableOfContents: @tableOfContents,
|
50
|
+
titles: @titles,
|
51
|
+
htmlTemplate: @htmlTemplate
|
52
|
+
}.select { |_k, v| !v.nil? }
|
53
|
+
end
|
54
|
+
|
55
|
+
def to_json(*options)
|
56
|
+
as_json(*options).to_json(*options)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
#
|
2
|
+
# The MIT License(MIT)
|
3
|
+
#
|
4
|
+
# Copyright(c) 2016 Copyleaks LTD (https://copyleaks.com)
|
5
|
+
#
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
# of this software and associated documentation files (the "Software"), to deal
|
8
|
+
# in the Software without restriction, including without limitation the rights
|
9
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
# copies of the Software, and to permit persons to whom the Software is
|
11
|
+
# furnished to do so, subject to the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be included in all
|
14
|
+
# copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
+
# SOFTWARE.
|
23
|
+
# =
|
24
|
+
module Copyleaks
|
25
|
+
class SubmissionFilter
|
26
|
+
# @param [Boolean] identicalEnabled Enable matching of exact words in the text.
|
27
|
+
# @param [Boolean] minorChangesEnabled Enable matching of nearly identical words with small differences like slow becomes slowly.
|
28
|
+
# @param [Boolean] relatedMeaningEnabled Enable matching of paraphrased content stating similar ideas with different words.
|
29
|
+
# @param [Integer] minCopiedWords Select results with at least minCopiedWords copied words.
|
30
|
+
# @param [Boolean] safeSearch Block explicit adult content from the scan results such as web pages containing inappropriate images and videos. SafeSearch is not 100% effective with all websites.
|
31
|
+
# @param [String[]] domains list of domains to either include or exclude from the scan - depending on the value of domainsMode.
|
32
|
+
# @param [SubmissionFilterDomainsMode] domainsMode Include or Exclude the list of domains you specified under the domains property
|
33
|
+
def initialize(
|
34
|
+
identicalEnabled = true,
|
35
|
+
minorChangesEnabled = false,
|
36
|
+
relatedMeaningEnabled = false,
|
37
|
+
minCopiedWords = nil,
|
38
|
+
safeSearch = false,
|
39
|
+
domains = [],
|
40
|
+
domainsMode = SubmissionFilterDomainsMode::EXCLUDE
|
41
|
+
)
|
42
|
+
@identicalEnabled = identicalEnabled
|
43
|
+
@minorChangesEnabled = minorChangesEnabled
|
44
|
+
@relatedMeaningEnabled = relatedMeaningEnabled
|
45
|
+
@minCopiedWords = minCopiedWords
|
46
|
+
@safeSearch = safeSearch
|
47
|
+
@domains = domains
|
48
|
+
@domainsMode = domainsMode
|
49
|
+
end
|
50
|
+
|
51
|
+
def as_json(*_args)
|
52
|
+
{
|
53
|
+
identicalEnabled: @identicalEnabled,
|
54
|
+
minorChangesEnabled: @minorChangesEnabled,
|
55
|
+
relatedMeaningEnabled: @relatedMeaningEnabled,
|
56
|
+
minCopiedWords: @minCopiedWords,
|
57
|
+
safeSearch: @safeSearch,
|
58
|
+
domains: @domains,
|
59
|
+
domainsMode: @domainsMode
|
60
|
+
}.select { |_k, v| !v.nil? }
|
61
|
+
end
|
62
|
+
|
63
|
+
def to_json(*options)
|
64
|
+
as_json(*options).to_json(*options)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
#
|
2
|
+
# The MIT License(MIT)
|
3
|
+
#
|
4
|
+
# Copyright(c) 2016 Copyleaks LTD (https://copyleaks.com)
|
5
|
+
#
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
# of this software and associated documentation files (the "Software"), to deal
|
8
|
+
# in the Software without restriction, including without limitation the rights
|
9
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
# copies of the Software, and to permit persons to whom the Software is
|
11
|
+
# furnished to do so, subject to the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be included in all
|
14
|
+
# copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
+
# SOFTWARE.
|
23
|
+
# =
|
24
|
+
$LOAD_PATH.unshift(__dir__) unless $LOAD_PATH.include?(__dir__)
|
25
|
+
|
26
|
+
require 'submission_properties'
|
27
|
+
|
28
|
+
require 'actions'
|
29
|
+
require 'author'
|
30
|
+
require 'copyleaks_db'
|
31
|
+
require 'domains_mode'
|
32
|
+
require 'exclude'
|
33
|
+
require 'filter'
|
34
|
+
require 'indexing'
|
35
|
+
require 'pdf_properties'
|
36
|
+
require 'repository'
|
37
|
+
require 'scanning'
|
38
|
+
require 'scanning_exclude'
|
39
|
+
require 'scanning_repository'
|
40
|
+
require 'sensitive_data_protection'
|
41
|
+
require 'submission_properties'
|
42
|
+
require 'webhooks'
|
43
|
+
|
44
|
+
module Copyleaks
|
45
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
#
|
2
|
+
# The MIT License(MIT)
|
3
|
+
#
|
4
|
+
# Copyright(c) 2016 Copyleaks LTD (https://copyleaks.com)
|
5
|
+
#
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
# of this software and associated documentation files (the "Software"), to deal
|
8
|
+
# in the Software without restriction, including without limitation the rights
|
9
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
# copies of the Software, and to permit persons to whom the Software is
|
11
|
+
# furnished to do so, subject to the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be included in all
|
14
|
+
# copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
+
# SOFTWARE.
|
23
|
+
# =
|
24
|
+
module Copyleaks
|
25
|
+
class SubmissionIndexing
|
26
|
+
# @param [SubmissionRepository[]] repositories - Check inner properties of SubmissionRepository for more details.
|
27
|
+
def initialize(repositories)
|
28
|
+
@repositories = repositories
|
29
|
+
end
|
30
|
+
|
31
|
+
def as_json(*_args)
|
32
|
+
{
|
33
|
+
repositories: @repositories
|
34
|
+
}.select { |_k, v| !v.nil? }
|
35
|
+
end
|
36
|
+
|
37
|
+
def to_json(*options)
|
38
|
+
as_json(*options).to_json(*options)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
#
|
2
|
+
# The MIT License(MIT)
|
3
|
+
#
|
4
|
+
# Copyright(c) 2016 Copyleaks LTD (https://copyleaks.com)
|
5
|
+
#
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
# of this software and associated documentation files (the "Software"), to deal
|
8
|
+
# in the Software without restriction, including without limitation the rights
|
9
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
# copies of the Software, and to permit persons to whom the Software is
|
11
|
+
# furnished to do so, subject to the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be included in all
|
14
|
+
# copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
+
# SOFTWARE.
|
23
|
+
# =
|
24
|
+
module Copyleaks
|
25
|
+
class SubmissionPDF
|
26
|
+
# @param [Boolean] create Add a request to generate a customizable export of the scan report, in a pdf format. Set to true in order to generate a pdf report for this scan.
|
27
|
+
# @param [String] title Customize the title for the PDF report.
|
28
|
+
# @param [String] largeLogo Customize the logo image in the PDF report.
|
29
|
+
# @param [Boolean] rtl When set to true the text in the report will be aligned from right to left.
|
30
|
+
def initialize(
|
31
|
+
create,
|
32
|
+
title,
|
33
|
+
largeLogo,
|
34
|
+
rtl
|
35
|
+
)
|
36
|
+
@create = create
|
37
|
+
@title = title
|
38
|
+
@largeLogo = largeLogo
|
39
|
+
@rtl = rtl
|
40
|
+
end
|
41
|
+
|
42
|
+
def as_json(*_args)
|
43
|
+
{
|
44
|
+
create: @create,
|
45
|
+
title: @title,
|
46
|
+
largeLogo: @largeLogo,
|
47
|
+
rtl: @rtl
|
48
|
+
}.select { |_k, v| !v.nil? }
|
49
|
+
end
|
50
|
+
|
51
|
+
def to_json(*options)
|
52
|
+
as_json(*options).to_json(*options)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
#
|
2
|
+
# The MIT License(MIT)
|
3
|
+
#
|
4
|
+
# Copyright(c) 2016 Copyleaks LTD (https://copyleaks.com)
|
5
|
+
#
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
# of this software and associated documentation files (the "Software"), to deal
|
8
|
+
# in the Software without restriction, including without limitation the rights
|
9
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
# copies of the Software, and to permit persons to whom the Software is
|
11
|
+
# furnished to do so, subject to the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be included in all
|
14
|
+
# copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
+
# SOFTWARE.
|
23
|
+
# =
|
24
|
+
module Copyleaks
|
25
|
+
class SubmissionRepository
|
26
|
+
# @param [String] Id of a repository to add the scanned document to.
|
27
|
+
def initialize(id)
|
28
|
+
@id = id
|
29
|
+
end
|
30
|
+
|
31
|
+
def as_json(*_args)
|
32
|
+
{
|
33
|
+
id: @id
|
34
|
+
}.select { |_k, v| !v.nil? }
|
35
|
+
end
|
36
|
+
|
37
|
+
def to_json(*options)
|
38
|
+
as_json(*options).to_json(*options)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
#
|
2
|
+
# The MIT License(MIT)
|
3
|
+
#
|
4
|
+
# Copyright(c) 2016 Copyleaks LTD (https://copyleaks.com)
|
5
|
+
#
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
# of this software and associated documentation files (the "Software"), to deal
|
8
|
+
# in the Software without restriction, including without limitation the rights
|
9
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
# copies of the Software, and to permit persons to whom the Software is
|
11
|
+
# furnished to do so, subject to the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be included in all
|
14
|
+
# copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
+
# SOFTWARE.
|
23
|
+
# =
|
24
|
+
module Copyleaks
|
25
|
+
class SubmissionScanning
|
26
|
+
# @param [Boolean] internet Compare your content with online sources.
|
27
|
+
# @param [SubmissionScanningExclude] exclude Check inner properties of SubmissionScanningExclude for more details.
|
28
|
+
# @param [SubmissionScanningRepository[]] repositories - Check inner properties of SubmissionScanningRepository for more details.
|
29
|
+
# @param [SubmissionScanningCopyleaksDB] copyleaksDb Check inner properties for more details.
|
30
|
+
def initialize(
|
31
|
+
internet = false,
|
32
|
+
exclude = nil,
|
33
|
+
repositories = nil,
|
34
|
+
copyleaksDb = nil
|
35
|
+
)
|
36
|
+
@internet = internet
|
37
|
+
@exclude = exclude
|
38
|
+
@repositories = repositories
|
39
|
+
@copyleaksDb = copyleaksDb
|
40
|
+
end
|
41
|
+
|
42
|
+
def as_json(*_args)
|
43
|
+
{
|
44
|
+
internet: @internet,
|
45
|
+
exclude: @exclude,
|
46
|
+
repositories: @repositories,
|
47
|
+
copyleaksDb: @copyleaksDb
|
48
|
+
}.select { |_k, v| !v.nil? }
|
49
|
+
end
|
50
|
+
|
51
|
+
def to_json(*options)
|
52
|
+
as_json(*options).to_json(*options)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|