Skip to content

Commit

Permalink
Removing dependency on hiredis (#35)
Browse files Browse the repository at this point in the history
* Removing dependency on hiredis

* Updating Github Actions

* Fix Rubocop errors
  • Loading branch information
kigster authored Jul 23, 2024
1 parent 53d3dd9 commit 93d5648
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 19 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ jobs:
REDIS_HOST: redis
REDIS_PORT: 6379
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1 # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
ruby-version: 3.3 # Not needed with a .ruby-version file
bundler-cache: true # # runs 'bundle install' and caches installed gems automatically
- run: |
gem update --system
gem install bundler
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
REDIS_HOST: redis
REDIS_PORT: 6379
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1 # Not needed with a .ruby-version file
ruby-version: 3.3 # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- run: |
gem update --system
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source 'https://rubygems.org'

gem 'tty-box', git: 'https://github.com/kigster/tty-box'
gem 'tty-box'

# Specify your gem's dependencies in activity-feed.gemspec
gemspec
2 changes: 1 addition & 1 deletion lib/simplefeed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Hashie.logger = Logger.new(nil)

::Dir.glob(::File.expand_path('../simplefeed/*.rb', __FILE__)).each { |f| require_relative(f) }
::Dir.glob(::File.expand_path('../simplefeed/*.rb', __FILE__)).sort.each { |f| require_relative(f) }

require 'simplefeed/providers/redis'
require 'simplefeed/dsl'
Expand Down
4 changes: 1 addition & 3 deletions lib/simplefeed/providers/redis/driver.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# frozen_string_literal: true

require 'redis'
require 'redis/connection/hiredis'
require 'connection_pool'
require 'colored2'
require 'hashie/mash'
require 'yaml'
require 'pp'

module SimpleFeed
module Providers
Expand Down Expand Up @@ -99,7 +97,7 @@ def initialize(opts)
end

if redis_proc
self.pool = ::ConnectionPool.new(size: (opts[:pool_size] || 2)) do
self.pool = ::ConnectionPool.new(size: opts[:pool_size] || 2) do
redis_proc.call
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/simplefeed/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module SimpleFeed
VERSION ||= '3.1.2'
VERSION ||= '3.1.3'
end
1 change: 0 additions & 1 deletion spec/simplefeed/providers/redis/driver_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# frozen_string_literal: true

require 'spec_helper'
require 'redis/connection/hiredis'
require 'connection_pool'
require 'simplefeed/providers/redis/driver'

Expand Down
8 changes: 2 additions & 6 deletions spec/simplefeed/providers/serialization/key_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,11 @@
let(:namespace) { :poo }

let(:meta_key_transformer) do
->(consumer) do
consumer.id
end
lambda(&:id)
end

let(:data_key_transformer) do
->(consumer) do
consumer.zipcode
end
lambda(&:zipcode)
end

context '#key_params' do
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
require 'simple_feed'
require 'rspec/its'

::Dir.glob(::File.expand_path('../support/*.rb', __FILE__)).each do |f|
::Dir.glob(::File.expand_path('../support/*.rb', __FILE__)).sort.each do |f|
require_relative(f)
end

Expand Down

0 comments on commit 93d5648

Please sign in to comment.