code0-license 0.2.0 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 58f84fcd4c3ba444e2b5c22ba55e7b995b61254815f08743ad18a2851cfe335f
4
- data.tar.gz: 945497d44a33b64539d98d39183eb2c5f83a36f4d03748be2c108f800bf775b3
3
+ metadata.gz: 9b31c49c94ebb8a5d019f33114cb5b4c14a679a86824b48b3e96cb0e5eb837cd
4
+ data.tar.gz: 8ada22784f937ac2052a45176709c0f7cc4b07cd592cf4c346395633f00811f5
5
5
  SHA512:
6
- metadata.gz: d3a0196b5a041a75638280cbc84ec8f80e612efd4207fac969748ecf7f1d6c7e83c3848b422f27b4ecc10dea22af940694226efe0f705a8dc268c0bf7b824315
7
- data.tar.gz: 425ae6074bf97210643a8fe21811f67471cc736fcc9d19a5af105f065de18c782991b9176ed00a306f15dd445627b4ae5d16c1d9d2d7c750d256d049acb8aff9
6
+ metadata.gz: 9017c312c7d3e2e66cfab92483b42eb24423aa1db0bcb2db300d32bd92fe522c2d228538f13ff71133f28351af43cc8e18965c8ca7291be700ab8e1ed96bbeff
7
+ data.tar.gz: 57a55a96fafb50fde8caf7d6c71af8cb01531a4b5181550ab71eda2acb05326625691505382b7bd6c7e23827a93e38d251282987431d505648c43cd7b93e3d5a
data/.rubocop.yml CHANGED
@@ -34,3 +34,6 @@ Layout/LineLength:
34
34
 
35
35
  RSpec/ExampleLength:
36
36
  Enabled: false
37
+
38
+ RSpec/MultipleMemoizedHelpers:
39
+ Enabled: false
data/.tool-versions CHANGED
@@ -1 +1 @@
1
- ruby 3.2.2
1
+ ruby 3.4.7
data/Gemfile.lock CHANGED
@@ -1,12 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- code0-license (0.2.0)
4
+ code0-license (0.3.0)
5
+ base64 (~> 0.3.0)
5
6
 
6
7
  GEM
7
8
  remote: https://rubygems.org/
8
9
  specs:
9
10
  ast (2.4.2)
11
+ base64 (0.3.0)
10
12
  diff-lcs (1.5.1)
11
13
  json (2.7.2)
12
14
  language_server-protocol (3.17.0.3)
data/README.md CHANGED
@@ -32,11 +32,11 @@ Code0::License.encryption_key = private_key
32
32
  # create a license
33
33
  license = Code0::License.new(
34
34
  {
35
- 'licensee' => { 'company' => 'Code0' }, # content of licensee can be as you want, it just can't be empty
36
- 'start_date' => '2024-05-01', # when is the first date where this license is valid?
37
- 'end_date' => '2025-05-01', # until when is the license valid?
38
- 'restrictions' => {}, # content can be as you wish, can be used to semantically store some restrictions that are evaluated by your application
39
- 'options' => {}, # content can be as you wish, can be used to semantically provide some options of this license
35
+ licensee: { company: 'Code0' }, # content of licensee can be as you want, it just can't be empty
36
+ start_date: '2024-05-01', # when is the first date where this license is valid?
37
+ end_date: '2025-05-01', # until when is the license valid?
38
+ restrictions: {}, # content can be as you wish, can be used to semantically store some restrictions that are evaluated by your application
39
+ options: {}, # content can be as you wish, can be used to semantically provide some options of this license
40
40
  }
41
41
  )
42
42
 
@@ -59,10 +59,10 @@ Code0::License.encryption_key = public_key
59
59
  # load the license
60
60
  license = Code0::License.load(File.read('license.txt'))
61
61
 
62
- # exit if license is valid or outside of the valid time
62
+ # exit if license is not valid or outside of the valid time
63
63
  exit unless license.valid?
64
64
  exit unless license.in_active_time?
65
65
 
66
66
  # for example, exit if users exceed licensed amount
67
- exit if User.count > license.restrictions['user_count']
67
+ exit if license.restricted?(:user_count) && User.count > license.restrictions[:user_count]
68
68
  ```
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Code0
4
4
  class License
5
- VERSION = "0.2.0"
5
+ VERSION = "0.3.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,15 +1,28 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: code0-license
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Niklas van Schrick
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-05-23 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: base64
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: 0.3.0
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: 0.3.0
13
26
  - !ruby/object:Gem::Dependency
14
27
  name: rake
15
28
  requirement: !ruby/object:Gem::Requirement
@@ -80,7 +93,6 @@ dependencies:
80
93
  - - "~>"
81
94
  - !ruby/object:Gem::Version
82
95
  version: '2.29'
83
- description:
84
96
  email:
85
97
  - mc.taucher2003@gmail.com
86
98
  executables: []
@@ -111,7 +123,6 @@ metadata:
111
123
  source_code_uri: https://github.com/code0-tech/code0-license
112
124
  changelog_uri: https://github.com/code0-tech/code0-license/releases
113
125
  rubygems_mfa_required: 'true'
114
- post_install_message:
115
126
  rdoc_options: []
116
127
  require_paths:
117
128
  - lib
@@ -126,8 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
137
  - !ruby/object:Gem::Version
127
138
  version: '0'
128
139
  requirements: []
129
- rubygems_version: 3.4.10
130
- signing_key:
140
+ rubygems_version: 3.6.9
131
141
  specification_version: 4
132
142
  summary: code0-license is used to validate software licenses
133
143
  test_files: []