Skip to content

Commit 1222a60

Browse files
authored
Update versioning (#16)
* update versioning * version number * update circle versions * Active support v8 changes -- modify how schematize mocks an error * bug in ruby 3.1.X that changes how time gets parsed -- set floor to 3.2
1 parent da11bd9 commit 1222a60

File tree

7 files changed

+56
-35
lines changed

7 files changed

+56
-35
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ workflows:
1212
- cst/enforce-gem-version-bump
1313
- cst/rspec-ruby:
1414
rspec-system-args: "SIMPLE_COV_RUN=true"
15-
cc-report-collect-ruby: "2.7.5"
15+
cc-report-collect-ruby: "3.3.6"
1616
matrix:
1717
parameters:
18-
ruby-version: ["2.7.5" , "3.0.0", "3.0.3"]
18+
ruby-version: ["3.2.4", "3.3.6"]
1919
alias: required-matrix-tests
2020
name: test-ruby<< matrix.ruby-version >>
2121
- cst/publish-gem:

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ruby:3.0.1
1+
FROM ruby:3.3.6
22
RUN cd /tmp && curl -L --output ghr.tar.gz https://github.com/tcnksm/ghr/releases/download/v0.12.0/ghr_v0.12.0_linux_amd64.tar.gz && \
33
tar -xzvf ghr.tar.gz && chmod +x ghr_v0.12.0_linux_amd64/ghr && mv ghr_v0.12.0_linux_amd64/ghr /usr/local/bin/ghr && rm -rf /tmp/*
44

Gemfile.lock

Lines changed: 42 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,78 @@
11
PATH
22
remote: .
33
specs:
4-
json_schematize (0.9.0)
5-
class_composer (~> 1.0)
4+
json_schematize (0.10.0)
5+
class_composer (>= 1.0)
66

77
GEM
88
remote: https://rubygems.org/
99
specs:
10-
activesupport (7.0.4.3)
11-
concurrent-ruby (~> 1.0, >= 1.0.2)
10+
activesupport (8.0.1)
11+
base64
12+
benchmark (>= 0.3)
13+
bigdecimal
14+
concurrent-ruby (~> 1.0, >= 1.3.1)
15+
connection_pool (>= 2.2.5)
16+
drb
1217
i18n (>= 1.6, < 2)
18+
logger (>= 1.4.2)
1319
minitest (>= 5.1)
14-
tzinfo (~> 2.0)
20+
securerandom (>= 0.3)
21+
tzinfo (~> 2.0, >= 2.0.5)
22+
uri (>= 0.13.1)
23+
base64 (0.2.0)
24+
benchmark (0.4.0)
25+
bigdecimal (3.1.9)
1526
byebug (11.1.3)
16-
class_composer (1.0.2)
27+
class_composer (2.1.0)
1728
coderay (1.1.3)
18-
concurrent-ruby (1.2.2)
19-
diff-lcs (1.5.0)
20-
docile (1.4.0)
21-
faker (3.1.1)
29+
concurrent-ruby (1.3.4)
30+
connection_pool (2.4.1)
31+
diff-lcs (1.5.1)
32+
docile (1.4.1)
33+
drb (2.2.1)
34+
faker (3.5.1)
2235
i18n (>= 1.8.11, < 2)
23-
i18n (1.12.0)
36+
i18n (1.14.6)
2437
concurrent-ruby (~> 1.0)
25-
method_source (1.0.0)
26-
minitest (5.18.0)
38+
logger (1.6.4)
39+
method_source (1.1.0)
40+
minitest (5.25.4)
2741
pry (0.14.2)
2842
coderay (~> 1.1)
2943
method_source (~> 1.0)
3044
pry-byebug (3.10.1)
3145
byebug (~> 11.0)
3246
pry (>= 0.13, < 0.15)
3347
rake (12.3.3)
34-
rspec (3.12.0)
35-
rspec-core (~> 3.12.0)
36-
rspec-expectations (~> 3.12.0)
37-
rspec-mocks (~> 3.12.0)
38-
rspec-core (3.12.1)
39-
rspec-support (~> 3.12.0)
40-
rspec-expectations (3.12.2)
48+
rspec (3.13.0)
49+
rspec-core (~> 3.13.0)
50+
rspec-expectations (~> 3.13.0)
51+
rspec-mocks (~> 3.13.0)
52+
rspec-core (3.13.2)
53+
rspec-support (~> 3.13.0)
54+
rspec-expectations (3.13.3)
4155
diff-lcs (>= 1.2.0, < 2.0)
42-
rspec-support (~> 3.12.0)
43-
rspec-mocks (3.12.5)
56+
rspec-support (~> 3.13.0)
57+
rspec-mocks (3.13.2)
4458
diff-lcs (>= 1.2.0, < 2.0)
45-
rspec-support (~> 3.12.0)
46-
rspec-support (3.12.0)
59+
rspec-support (~> 3.13.0)
60+
rspec-support (3.13.2)
4761
rspec_junit_formatter (0.6.0)
4862
rspec-core (>= 2, < 4, != 2.12.0)
63+
securerandom (0.4.1)
4964
simplecov (0.22.0)
5065
docile (~> 1.1)
5166
simplecov-html (~> 0.11)
5267
simplecov_json_formatter (~> 0.1)
53-
simplecov-html (0.12.3)
68+
simplecov-html (0.13.1)
5469
simplecov_json_formatter (0.1.4)
5570
tzinfo (2.0.6)
5671
concurrent-ruby (~> 1.0)
72+
uri (1.0.2)
5773

5874
PLATFORMS
75+
aarch64-linux
5976
x86_64-darwin-20
6077
x86_64-linux
6178

json_schematize.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
1313
spec.homepage = "https://github.com/matt-taylor/json_schematize"
1414
spec.license = "MIT"
1515

16-
spec.required_ruby_version = Gem::Requirement.new(">= 2.7")
16+
spec.required_ruby_version = Gem::Requirement.new(">= 3.2")
1717

1818
spec.metadata = {
1919
"homepage_uri" => spec.homepage,
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
2929
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
3030
spec.require_paths = ["lib"]
3131

32-
spec.add_dependency "class_composer", "~> 1.0"
32+
spec.add_dependency "class_composer", ">= 1.0"
3333

3434
spec.add_development_dependency "pry-byebug"
3535
spec.add_development_dependency "rake", "~> 12.0"

lib/json_schematize/cache/class_methods/client.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22

33
module JsonSchematize::Cache::ClassMethods
44
module Client
5-
65
def __deserialize_keys__(key_hash_bytes)
76
return [{}, 0] if key_hash_bytes.nil?
87

98
min_expire = Time.now.to_i
10-
key_hash = Marshal.load(key_hash_bytes)
9+
key_hash = __marshalize__(key_hash_bytes)
1110
keys_removed = 0
1211
key_hash.each do |key, expire|
1312
next if expire.to_i > min_expire
@@ -22,6 +21,10 @@ def __deserialize_keys__(key_hash_bytes)
2221
[{}, 0]
2322
end
2423

24+
def __marshalize__(key_hash_bytes)
25+
Marshal.load(key_hash_bytes)
26+
end
27+
2528
def __update_record_keeper__!(expire:, cache_key:, delete_key: false)
2629
record_of_truth = cached_keys(with_expire: true)
2730
if delete_key

lib/json_schematize/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module JsonSchematize
4-
VERSION = "0.9.0"
4+
VERSION = "0.10.0"
55
end

spec/lib/json_schematize/cache_spec.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ class CacheDefault < JsonSchematize::Generator
2727
expect(subject).to include(instance.__cache_key__)
2828
end
2929

30-
context "when it deserialization fails" do
30+
context "when deserialization fails" do
3131
before do
3232
instance
33-
allow(Marshal).to receive(:load).and_raise(StandardError)
33+
34+
allow(klass).to receive(:__marshalize__).and_raise(StandardError)
3435
end
3536

3637
it { is_expected.to eq([]) }

0 commit comments

Comments
 (0)