rails-brotli-cache 0.5.0 → 0.6.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: e5fcc9aa5854debba71fab6f5df69615ab2b9edaa6620ae139e7c68c598c0dcb
4
- data.tar.gz: a60ba10b497f50e751ca191ce8e9034bd45b30c93e3dff718a26c14e178ffed9
3
+ metadata.gz: 38153c74bf09ef2a13760b3dea18a3a3e97790104b1af8a8d244ee104d0ad34e
4
+ data.tar.gz: ed7760dd1e7373fa7e855f57ec7082a185f68b114e43bd051d29fb4be7619020
5
5
  SHA512:
6
- metadata.gz: 066d33ad8b2e12d2fa4242ac120cbd0cd1ceee693619146d72b2dfe95ecd8dfe69b5b01028488a31e5373c5472602c42219cb2e0e749d9a2661c0cbcc26b9cb1
7
- data.tar.gz: a8522dff7f3452c216803cf5a45c62eb0ba1acadc3d4efece1130c35574344d4b2509938a076f78293814c271376b576973135791fc5fdf342240d587a2783cc
6
+ metadata.gz: dc9430106e033158f55f6421d42253a8aaec9b62833687538a289010e8b67b1ffc4a75ba0b71071e5925b7256d2d070b5930719ebd40d5a60f28dc6d7cd4cd19
7
+ data.tar.gz: 47483feabfac21321eb6e4e6a0df6d5ffa8646261dbeb7b728897f3026f4deff699e682a4cf525f8cca79b824082173637baf9517d8e96c3cfd91aaf9b0b3291
data/README.md CHANGED
@@ -1,8 +1,17 @@
1
- # Rails Brotli Cache [![Gem Version](https://img.shields.io/gem/v/rails-brotli-cache)](https://badge.fury.io/rb/rails-brotli-cache) [![CircleCI](https://circleci.com/gh/pawurb/rails-brotli-cache.svg?style=svg)](https://circleci.com/gh/pawurb/rails-brotli-cache)
1
+ # Rails Brotli Cache [![Gem Version](https://img.shields.io/gem/v/rails-brotli-cache)](https://badge.fury.io/rb/rails-brotli-cache) [![GH Actions](https://github.com/pawurb/rails-brotli-cache/actions/workflows/ci.yml/badge.svg)](https://github.com/pawurb/rails-brotli-cache/actions)
2
2
 
3
3
  This gem enables support for compressing Ruby on Rails cache entries using the [Brotli compression algorithm](https://github.com/google/brotli). `RailsBrotliCache::Store` offers better compression and performance compared to the default `Rails.cache` Gzip, regardless of the underlying data store. The gem also allows specifying any custom compression algorithm instead of Brotli.
4
4
 
5
- I'm currently working on a post describing the gem in more detail. You can subscribe to [my blog's mailing list](https://eepurl.com/dhuFg5) or [follow me on Twitter](https://twitter.com/_pawurb) to get notified when it's out.
5
+ You can check out [this blog post](https://pawelurbanek.com/rails-brotli-cache) describing the gem in more detail.
6
+
7
+ ## Installation
8
+
9
+ `Gemfile`
10
+
11
+ ```ruby
12
+ gem 'brotli' # brotli is an optional dependency because other compressors are supported
13
+ gem 'rails-brotli-cache'
14
+ ```
6
15
 
7
16
  ## Benchmarks
8
17
 
data/benchmarks/main.rb CHANGED
@@ -1,7 +1,8 @@
1
- require "active_support"
2
- require "active_support/core_ext/hash"
1
+ require 'active_support'
2
+ require 'active_support/core_ext/hash'
3
3
  require 'net/http'
4
4
  require 'rails-brotli-cache'
5
+ require 'benchmark'
5
6
 
6
7
  memory_cache = ActiveSupport::Cache::MemoryStore.new(compress: true) # memory store does not use compression by default
7
8
  brotli_memory_cache = RailsBrotliCache::Store.new(memory_cache)
@@ -1,7 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'active_support/cache'
4
- require 'brotli'
4
+ begin
5
+ require 'brotli'
6
+ rescue LoadError
7
+ end
5
8
 
6
9
  module RailsBrotliCache
7
10
  class Store < ::ActiveSupport::Cache::Store
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsBrotliCache
4
- VERSION = "0.5.0"
4
+ VERSION = "0.6.0"
5
5
  end
@@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
16
16
  gem.require_paths = ["lib"]
17
17
  gem.license = "MIT"
18
18
  gem.add_dependency "activesupport"
19
- gem.add_dependency "brotli"
19
+ gem.add_development_dependency "brotli"
20
20
  gem.add_development_dependency "rspec"
21
21
  gem.add_development_dependency "railties"
22
22
  gem.add_development_dependency "activemodel"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-brotli-cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - pawurb
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-19 00:00:00.000000000 Z
11
+ date: 2023-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -31,7 +31,7 @@ dependencies:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
- type: :runtime
34
+ type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements: