File tree Expand file tree Collapse file tree 9 files changed +52
-8
lines changed Expand file tree Collapse file tree 9 files changed +52
-8
lines changed Original file line number Diff line number Diff line change 21
21
gem push cache_store_redis-*.gem
22
22
env :
23
23
GEM_HOST_API_KEY : " ${{secrets.RUBYGEMS_AUTH_TOKEN}}"
24
+
25
+ - uses : actions/checkout@v3
26
+ - name : Publish JRuby version to RubyGems
27
+ uses : ruby/setup-ruby@v1
28
+ with :
29
+ ruby-version : jruby
30
+ bundler-cache : true # runs 'bundle install' and caches installed gems automatically
31
+ run : |
32
+ mkdir -p $HOME/.gem
33
+ touch $HOME/.gem/credentials
34
+ chmod 0600 $HOME/.gem/credentials
35
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
36
+ jruby -S bundle exec rake build cache_store_redis.gemspec
37
+ gem push cache_store_redis-*.gem
38
+ env :
39
+ GEM_HOST_API_KEY : " ${{secrets.RUBYGEMS_AUTH_TOKEN}}"
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ services:
3
3
- redis-server
4
4
rvm :
5
5
- 2.3.5
6
+ - jruby
6
7
cache : bundler
7
8
before_script :
8
9
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
Original file line number Diff line number Diff line change
1
+ FROM jruby
2
+
3
+ RUN apk add --no-cache --update bash
4
+
5
+ # Create application directory and set it as the WORKDIR.
6
+ ENV APP_HOME /code
7
+ RUN mkdir -p $APP_HOME
8
+ WORKDIR $APP_HOME
9
+
10
+ COPY . $APP_HOME
11
+
12
+ RUN jruby -S bundle install
Original file line number Diff line number Diff line change @@ -3,6 +3,6 @@ source 'https://rubygems.org'
3
3
# Specify your gem's dependencies in cache_store_redis.gemspec
4
4
gemspec
5
5
6
- gem 'oj' , '3.6.10'
6
+ gem 'oj' , '3.6.10' unless RUBY_PLATFORM == 'java'
7
7
gem 'pry'
8
8
gem 'simplecov' , '< 0.18.0'
Original file line number Diff line number Diff line change @@ -19,12 +19,17 @@ Gem::Specification.new do |spec|
19
19
spec . require_paths = [ 'lib' ]
20
20
21
21
spec . add_development_dependency 'bundler'
22
- spec . add_development_dependency 'pry-byebug'
22
+ # spec.add_development_dependency 'pry-byebug'
23
23
spec . add_development_dependency 'rake' , '~> 10.0'
24
24
spec . add_development_dependency 'rspec'
25
25
spec . add_development_dependency 'simplecov'
26
26
spec . add_development_dependency 'timecop'
27
27
28
- spec . add_dependency 'oj'
28
+ if RUBY_PLATFORM =~ /java/
29
+ spec . platform = 'java'
30
+ else
31
+ spec . add_dependency 'oj'
32
+ end
33
+
29
34
spec . add_dependency 'redis'
30
35
end
Original file line number Diff line number Diff line change 4
4
require 'cache_store_redis/version'
5
5
require 'redis'
6
6
require 'securerandom'
7
- require 'oj'
8
7
require 'logger'
9
8
10
9
require_relative 'cache_store_redis/redis_connection'
Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ class RedisCacheStore
4
4
DEFAULT_TTL = 3_600
5
5
6
6
def initialize ( namespace = nil , config = nil )
7
+ unless RUBY_PLATFORM == 'java'
8
+ require 'oj'
9
+ end
10
+
7
11
@connection_pool = RedisConnectionPool . new ( namespace , config )
8
12
9
13
@namespace = namespace
@@ -143,11 +147,19 @@ def ping
143
147
private
144
148
145
149
def serialize ( object )
146
- Oj . dump ( object )
150
+ if RUBY_PLATFORM == 'java'
151
+ Marshal ::dump ( object )
152
+ else
153
+ Oj . dump ( object )
154
+ end
147
155
end
148
156
149
157
def deserialize ( object )
150
- Oj . load ( object )
158
+ if RUBY_PLATFORM == 'java'
159
+ Marshal ::load ( object )
160
+ else
161
+ Oj . load ( object )
162
+ end
151
163
end
152
164
153
165
def build_key ( key )
Original file line number Diff line number Diff line change 1
1
module CacheStoreRedis
2
- VERSION = '2.2.1 '
2
+ VERSION = '2.3.0.rc1 '
3
3
end
Original file line number Diff line number Diff line change 5
5
6
6
require 'timecop'
7
7
require 'pry'
8
- require 'pry-byebug'
9
8
require_relative 'test_object'
10
9
require_relative '../lib/cache_store_redis'
11
10
You can’t perform that action at this time.
0 commit comments