Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
- '3.1.6'
- '3.2.2'
- '3.3.6'
- '3.4.7'

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2.2'
ruby-version: '3.4.7'
- name: Install gems
run: bundle install
- name: Set version
Expand Down
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ Layout/LineLength:

RSpec/ExampleLength:
Enabled: false

RSpec/MultipleMemoizedHelpers:
Enabled: false
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby 3.2.2
ruby 3.4.7
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ PATH
remote: .
specs:
code0-license (0.0.0)
base64 (~> 0.3.0)

GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
base64 (0.3.0)
diff-lcs (1.5.1)
json (2.7.2)
language_server-protocol (3.17.0.3)
Expand Down
2 changes: 2 additions & 0 deletions code0-license.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

spec.add_dependency "base64", "~> 0.3.0"

spec.add_development_dependency "rake", "~> 13.0"
spec.add_development_dependency "rspec", "~> 3.0"
spec.add_development_dependency "rubocop", "~> 1.21"
Expand Down
11 changes: 7 additions & 4 deletions spec/code0/license_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
RSpec.describe Code0::License do
described_class.encryption_key = OpenSSL::PKey::RSA.generate(2048)

let(:start_date) { Date.today.prev_day }
let(:end_date) { Date.today.next_day }

let(:license_data) { default_license_data }
let(:license) { described_class.new(license_data) }
let(:default_license_data) do
{
licensee: { company: "Code0" },
start_date: "2024-05-01",
end_date: "2025-05-01",
start_date: start_date.strftime("%Y-%m-%d"),
end_date: end_date.strftime("%Y-%m-%d"),
restrictions: { users: 1 },
options: {}
}
Expand All @@ -25,8 +28,8 @@
expect(license.data).to match(
{
licensee: { company: "Code0" },
start_date: Date.new(2024, 5, 1),
end_date: Date.new(2025, 5, 1),
start_date: start_date,
end_date: end_date,
restrictions: { users: 1 },
options: {}
}
Expand Down