code0-license 0.3.0 → 0.4.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 +4 -4
- data/Gemfile.lock +1 -1
- data/LICENSE +9 -0
- data/lib/code0/license/version.rb +1 -1
- data/lib/code0/license.rb +5 -2
- metadata +2 -2
- data/LICENSE.txt +0 -21
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 40b0c32aa435aa020ec267d3946ea3701bc8e581004ccefe37abcf04e08cdfb8
|
|
4
|
+
data.tar.gz: 5219aacaae6db52ea1c885d250c89dd3cad6bc7430326d790eecf66f4c0943b6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7353b46da78ca6d8ea3608120ef895c0148486c0700f6cf0ab4dcb36f8ef6d0833c9356a43372e1380c84645f2354e4446a8f61adad4f83613b9bebb13014e0b
|
|
7
|
+
data.tar.gz: caa6df4e58e9ae251ea43928feee55005acea1df32464a7d88382433d1a654ea99fbe72df59501454fd15f7959bd5637764b4c6ea15f7622d0bf7fb6bd59aad2
|
data/Gemfile.lock
CHANGED
data/LICENSE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
Copyright 2023-2026 Code0 UG (haftungsbeschränkt)
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
AI Usage Restriction: Notwithstanding the permissions granted above, this Software and its source code may not be used, in whole or in part, for the purpose of training, fine-tuning, or developing artificial intelligence (AI) models or machine learning algorithms without prior written consent from the Copyright Holder.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/lib/code0/license.rb
CHANGED
|
@@ -47,6 +47,7 @@ module Code0
|
|
|
47
47
|
ATTRIBUTES = %i[
|
|
48
48
|
start_date
|
|
49
49
|
end_date
|
|
50
|
+
grace_period_days
|
|
50
51
|
licensee
|
|
51
52
|
restrictions
|
|
52
53
|
options
|
|
@@ -61,16 +62,17 @@ module Code0
|
|
|
61
62
|
return false if !licensee || !licensee.is_a?(Hash) || licensee.empty?
|
|
62
63
|
return false if !start_date || !start_date.is_a?(Date)
|
|
63
64
|
return false if (!end_date || !end_date.is_a?(Date)) && !options[:allow_missing_end_date]
|
|
65
|
+
return false if grace_period_days.nil? || !grace_period_days.is_a?(Integer)
|
|
64
66
|
|
|
65
67
|
true
|
|
66
68
|
end
|
|
67
69
|
|
|
68
|
-
def in_active_time?
|
|
70
|
+
def in_active_time?(allow_grace_period: true)
|
|
69
71
|
return false if start_date > Date.today
|
|
70
72
|
return true if !end_date && options[:allow_missing_end_date]
|
|
71
73
|
return false if !end_date && !options[:allow_missing_end_date]
|
|
72
74
|
|
|
73
|
-
end_date >= Date.today
|
|
75
|
+
end_date + (allow_grace_period ? grace_period_days : 0) >= Date.today
|
|
74
76
|
end
|
|
75
77
|
|
|
76
78
|
def restricted?(attribute)
|
|
@@ -92,6 +94,7 @@ module Code0
|
|
|
92
94
|
send("#{property}=", value)
|
|
93
95
|
end
|
|
94
96
|
|
|
97
|
+
send("grace_period_days=", data[:grace_period_days] || 0)
|
|
95
98
|
send("licensee=", data[:licensee])
|
|
96
99
|
send("restrictions=", data[:restrictions] || {})
|
|
97
100
|
send("options=", data[:options] || {})
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: code0-license
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Niklas van Schrick
|
|
@@ -104,7 +104,7 @@ files:
|
|
|
104
104
|
- ".tool-versions"
|
|
105
105
|
- Gemfile
|
|
106
106
|
- Gemfile.lock
|
|
107
|
-
- LICENSE
|
|
107
|
+
- LICENSE
|
|
108
108
|
- README.md
|
|
109
109
|
- Rakefile
|
|
110
110
|
- keys/.keep
|
data/LICENSE.txt
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 Niklas van Schrick
|
|
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
|
|
13
|
-
all 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
|
|
21
|
-
THE SOFTWARE.
|