dragonfly-cache 0.1.7 → 0.2.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: f3df881ab7d62b87cd00ab7361c614250cc1a8706b9d2cc416a2ddb1f5d34256
4
- data.tar.gz: 6cef3e6bdcb69d1e0418060e8db484f6b40dc2ede64ea03ca99f4aefc025e452
3
+ metadata.gz: c8ff08670c9d9c9d4c8e0a98d947fb0c60c0296b1637de15372360641ca76baa
4
+ data.tar.gz: 75dee33b161617d4f2111b1d775f81675fda51229a223b5794fd327e777b0269
5
5
  SHA512:
6
- metadata.gz: 96a06ce4971e5ba10fc15be6789582e5e3202993a69bcc4c92504949033c2ec420f648b4cd61f1de88d41182cdae624fb4c097723b47dd81be637032d7e2dbf2
7
- data.tar.gz: e6c1aedbd009728f83dcdbb894116d5f6ad19e938088c17f229ce75679315961d1189123c4614b2c7c92b2db3ca99be8fbf553ee021fce6b60e018502f6507a8
6
+ metadata.gz: 71fc18dd9cbf1a3b92f63643a9a487f8cc6a3509b117235affb7cb4371713720ecbc50110d7ba19a0740f17f90824756476652be2da31bdda821875c34012ae5
7
+ data.tar.gz: 9e6df8971b08644ff5a5595c5f1e0b8caf2e40fef07e3db92fad87274afca0cb24e96aa05fb0193904a339b1bb56ee548637cba9633c0a2bec3dbea54aa61a98
data/CHANGELOG.md ADDED
@@ -0,0 +1,89 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## Version 0.2.0 (2025-10-23)
10
+
11
+ ### Changed
12
+
13
+ * Configure Dependabot to automatically update Github Actions (#27)
14
+ * Bump minimum required Ruby version to 3.2 (#25)
15
+ * Remove Ruby 3.0 and Ruby 3.1 from the test matrix (#23)
16
+ * Add Ruby 3.4 to the test matrix (#20)
17
+ * Update test matrix (#14)
18
+ Add Ruby 3.3. Drop Ruby 2.6 and Ruby 2.7
19
+ * Migrate from Travis CI to Github Actions
20
+ * Add Ruby 3.2 to the test matrix
21
+ * Introduce `rubocop-performance` and simplify configuration
22
+
23
+ ### Fixed
24
+
25
+ * Fix tests to be compatible Dragonfly 1.4
26
+
27
+ ## Version 0.1.8 (2021-04-03)
28
+
29
+ ### Breaking changes
30
+
31
+ * Drop support for Ruby 2.5
32
+
33
+ ### Changed
34
+
35
+ * Compatibility with Ruby 3.0
36
+
37
+ ## Version 0.1.7 (2020-11-02)
38
+
39
+ ### Breaking changes
40
+
41
+ * Drop support for Ruby < 2.5
42
+
43
+ ### Added
44
+
45
+ * Introduce Travis CI to run unit tests on all supported Ruby versions
46
+
47
+ ## Version 0.1.6 (2019-04-29)
48
+
49
+ ### Changed
50
+
51
+ * Loosen version constraint to Dragonfly
52
+
53
+ ## Version 0.1.5 (2018-12-17)
54
+
55
+ ### Fixed
56
+
57
+ * Strengthen cache key validation to avoid collisions (#1)
58
+
59
+ ## Version 0.1.4 (2018-10-08)
60
+
61
+ ### Fixed
62
+
63
+ * Load existing map on startup
64
+
65
+ ## Version 0.1.3 (2018-09-13)
66
+
67
+ ### Fixed
68
+
69
+ * Ensure job are only processed once
70
+
71
+ ### Other changes
72
+
73
+ * Refactor cache logic
74
+
75
+ ## Version 0.1.2 (2018-09-07)
76
+
77
+ ### Fixed
78
+
79
+ * Ensure normalized filenames keep their extension
80
+
81
+ ## Version 0.1.1 (2018-09-07)
82
+
83
+ ### Added
84
+
85
+ * Add automatic filenames cleaning
86
+
87
+ ## Version 0.1.0 (2028-09-07)
88
+
89
+ Initial release.
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # dragonfly-cache
2
2
 
3
+ [![Unit tests](https://github.com/notus-sh/dragonfly-cache/actions/workflows/unit-tests.yml/badge.svg?branch=main)](https://github.com/notus-sh/dragonfly-cache/actions/workflows/unit-tests.yml)
4
+ [![Gem Version](https://badge.fury.io/rb/dragonfly-cache.svg)](https://badge.fury.io/rb/dragonfly-cache)
5
+
3
6
  `dragonfly-cache` is a cache adapter for [Dragonfly](http://markevans.github.io/dragonfly/). It allows you to store Dragonfly's jobs results without running them again and again on each call.
4
7
 
5
8
  **For now**, `dragonfly-cache` supports only local caching of local files. It will be extended in a near future to support remote cache and file storages.
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gemspec path: '../..'
6
+ gem 'base64'
7
+ gem 'logger'
@@ -17,22 +17,33 @@ Gem::Specification.new do |spec|
17
17
 
18
18
  raise 'RubyGems 2.0 or newer is required.' unless spec.respond_to?(:metadata)
19
19
 
20
- spec.metadata['allowed_push_host'] = 'https://rubygems.org'
20
+ spec.metadata = {
21
+ 'allowed_push_host' => 'https://rubygems.org',
22
+ 'rubygems_mfa_required' => 'true',
23
+
24
+ 'bug_tracker_uri' => 'https://github.com/notus-sh/dragonfly-cache/issues',
25
+ 'changelog_uri' => 'https://github.com/notus-sh/dragonfly-cache/blob/main/CHANGELOG.md',
26
+ 'homepage_uri' => 'https://github.com/notus-sh/dragonfly-cache',
27
+ 'source_code_uri' => 'https://github.com/notus-sh/dragonfly-cache',
28
+ 'funding_uri' => 'https://opencollective.com/notus-sh'
29
+ }
21
30
 
22
31
  spec.require_paths = ['lib']
23
- spec.files = Dir.chdir(File.expand_path(__dir__)) do
24
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
32
+
33
+ excluded_dirs = %r{^(.github|spec)/}
34
+ excluded_files = %w[.gitignore .rspec .rubocop.yml Gemfile Gemfile.lock Rakefile]
35
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
36
+ f.match(excluded_dirs) || excluded_files.include?(f)
25
37
  end
26
38
 
27
- spec.required_ruby_version = '>= 2.5'
39
+ spec.required_ruby_version = '>= 3.2'
28
40
 
29
41
  spec.add_dependency 'dragonfly'
30
42
  spec.add_dependency 'i18n'
31
43
 
32
44
  spec.add_development_dependency 'bundler', '~> 2.1'
33
45
  spec.add_development_dependency 'rake', '~> 13.0'
34
- spec.add_development_dependency 'rspec', '~> 3.10.0'
35
- spec.add_development_dependency 'rubocop'
46
+ spec.add_development_dependency 'rspec', '~> 3.13.0'
36
47
 
37
48
  spec.post_install_message = <<~POST_INSTALL_MESSAGE
38
49
  Don't forget to configure Dragonfly::Cache:
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Dragonfly
4
4
  module Cache
5
- class Config
5
+ class Config # :nodoc:
6
6
  attr_accessor :servers_options
7
7
 
8
8
  def initialize(servers_options = {})
@@ -29,7 +29,10 @@ module Dragonfly
29
29
  raise Dragonfly::Cache::Error, ':server_root option is missing or directory does not exist'
30
30
  end
31
31
 
32
- raise Dragonfly::Cache::Error, ':url_format option must include `:sha`' if (servers_options[:url_format] =~ %r{/:sha/}).nil?
32
+ return if servers_options[:url_format].include?('/:sha/')
33
+
34
+ raise Dragonfly::Cache::Error,
35
+ ':url_format option must include `:sha`'
33
36
  end
34
37
 
35
38
  def rewrite_url_format!
@@ -5,7 +5,7 @@ require 'dragonfly/cache/storage/local'
5
5
 
6
6
  module Dragonfly
7
7
  module Cache
8
- class Manager
8
+ class Manager # :nodoc:
9
9
  extend Forwardable
10
10
 
11
11
  MIN_SHA_SIZE = 2
@@ -5,7 +5,7 @@ require 'yaml'
5
5
  module Dragonfly
6
6
  module Cache
7
7
  module Mapper
8
- class Yaml
8
+ class Yaml # :nodoc:
9
9
  extend Forwardable
10
10
 
11
11
  attr_reader :root, :internal
@@ -10,10 +10,12 @@ require 'dragonfly/cache/manager'
10
10
 
11
11
  module Dragonfly
12
12
  module Cache
13
- class Plugin
13
+ class Plugin # :nodoc:
14
14
  extend Forwardable
15
15
 
16
+ # rubocop:disable Style/ClassVars
16
17
  @@servers = {}
18
+ # rubocop:enable Style/ClassVars
17
19
 
18
20
  attr_reader :config, :manager
19
21
 
@@ -49,7 +51,7 @@ module Dragonfly
49
51
  @@servers[app.name] ||= begin
50
52
  server = app.server.dup
51
53
  config.servers_options.each do |name, value|
52
- server.send("#{name}=", value) if server.respond_to?("#{name}=")
54
+ server.send(:"#{name}=", value) if server.respond_to?(:"#{name}=")
53
55
  end
54
56
  server
55
57
  end
@@ -3,7 +3,7 @@
3
3
  module Dragonfly
4
4
  module Cache
5
5
  module Storage
6
- class Local
6
+ class Local # :nodoc:
7
7
  attr_reader :root, :format
8
8
 
9
9
  def initialize(config)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Dragonfly
4
4
  module Cache
5
- VERSION = '0.1.7'
5
+ VERSION = '0.2.0'
6
6
  end
7
7
  end
@@ -4,7 +4,7 @@ require 'openssl'
4
4
  require 'dragonfly'
5
5
 
6
6
  module Dragonfly
7
- module Cache
7
+ module Cache # :nodoc:
8
8
  class Error < ::StandardError; end
9
9
  end
10
10
  end
data/tmp/.keep ADDED
File without changes
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dragonfly-cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gaël-Ian Havard
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2020-11-02 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: dragonfly
@@ -72,28 +71,14 @@ dependencies:
72
71
  requirements:
73
72
  - - "~>"
74
73
  - !ruby/object:Gem::Version
75
- version: 3.10.0
74
+ version: 3.13.0
76
75
  type: :development
77
76
  prerelease: false
78
77
  version_requirements: !ruby/object:Gem::Requirement
79
78
  requirements:
80
79
  - - "~>"
81
80
  - !ruby/object:Gem::Version
82
- version: 3.10.0
83
- - !ruby/object:Gem::Dependency
84
- name: rubocop
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
81
+ version: 3.13.0
97
82
  description: Allow Dragonfly to keep a cache of jobs results
98
83
  email:
99
84
  - gael-ian@notus.sh
@@ -101,15 +86,10 @@ executables: []
101
86
  extensions: []
102
87
  extra_rdoc_files: []
103
88
  files:
104
- - ".gitignore"
105
- - ".rspec"
106
- - ".travis.yml"
107
- - Gemfile
108
- - Gemfile.lock
89
+ - CHANGELOG.md
109
90
  - LICENSE
110
91
  - README.md
111
- - Rakefile
112
- - config/linters/ruby.yml
92
+ - dev/gemfiles/ci.gemfile
113
93
  - dragonfly-cache.gemspec
114
94
  - lib/dragonfly/cache.rb
115
95
  - lib/dragonfly/cache/config.rb
@@ -118,11 +98,18 @@ files:
118
98
  - lib/dragonfly/cache/plugin.rb
119
99
  - lib/dragonfly/cache/storage/local.rb
120
100
  - lib/dragonfly/cache/version.rb
101
+ - tmp/.keep
121
102
  homepage: https://github.com/notus-sh/dragonfly-cache
122
103
  licenses:
123
104
  - Apache-2.0
124
105
  metadata:
125
106
  allowed_push_host: https://rubygems.org
107
+ rubygems_mfa_required: 'true'
108
+ bug_tracker_uri: https://github.com/notus-sh/dragonfly-cache/issues
109
+ changelog_uri: https://github.com/notus-sh/dragonfly-cache/blob/main/CHANGELOG.md
110
+ homepage_uri: https://github.com/notus-sh/dragonfly-cache
111
+ source_code_uri: https://github.com/notus-sh/dragonfly-cache
112
+ funding_uri: https://opencollective.com/notus-sh
126
113
  post_install_message: |+
127
114
  Don't forget to configure Dragonfly::Cache:
128
115
 
@@ -139,15 +126,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
139
126
  requirements:
140
127
  - - ">="
141
128
  - !ruby/object:Gem::Version
142
- version: '2.5'
129
+ version: '3.2'
143
130
  required_rubygems_version: !ruby/object:Gem::Requirement
144
131
  requirements:
145
132
  - - ">="
146
133
  - !ruby/object:Gem::Version
147
134
  version: '0'
148
135
  requirements: []
149
- rubygems_version: 3.1.2
150
- signing_key:
136
+ rubygems_version: 3.6.9
151
137
  specification_version: 4
152
138
  summary: Cache adapter for Dragonfly
153
139
  test_files: []
data/.gitignore DELETED
@@ -1,8 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --color
2
- --require spec_helper
data/.travis.yml DELETED
@@ -1,11 +0,0 @@
1
- language: ruby
2
- sudo: false
3
- script: "bundle exec rake clean spec"
4
-
5
- rvm:
6
- - 2.5
7
- - 2.6
8
- - 2.7
9
-
10
- gemfile:
11
- - Gemfile
data/Gemfile DELETED
@@ -1,6 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- # Specify your gem's dependencies in dragonfly-cache.gemspec
6
- gemspec
data/Gemfile.lock DELETED
@@ -1,70 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- dragonfly-cache (0.1.7)
5
- dragonfly
6
- i18n
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- addressable (2.7.0)
12
- public_suffix (>= 2.0.2, < 5.0)
13
- ast (2.4.1)
14
- concurrent-ruby (1.1.7)
15
- diff-lcs (1.4.4)
16
- dragonfly (1.2.1)
17
- addressable (~> 2.3)
18
- multi_json (~> 1.0)
19
- rack (>= 1.3)
20
- i18n (1.8.5)
21
- concurrent-ruby (~> 1.0)
22
- multi_json (1.15.0)
23
- parallel (1.19.2)
24
- parser (2.7.2.0)
25
- ast (~> 2.4.1)
26
- public_suffix (4.0.6)
27
- rack (2.2.3)
28
- rainbow (3.0.0)
29
- rake (13.0.1)
30
- regexp_parser (1.8.2)
31
- rexml (3.2.4)
32
- rspec (3.10.0)
33
- rspec-core (~> 3.10.0)
34
- rspec-expectations (~> 3.10.0)
35
- rspec-mocks (~> 3.10.0)
36
- rspec-core (3.10.0)
37
- rspec-support (~> 3.10.0)
38
- rspec-expectations (3.10.0)
39
- diff-lcs (>= 1.2.0, < 2.0)
40
- rspec-support (~> 3.10.0)
41
- rspec-mocks (3.10.0)
42
- diff-lcs (>= 1.2.0, < 2.0)
43
- rspec-support (~> 3.10.0)
44
- rspec-support (3.10.0)
45
- rubocop (1.1.0)
46
- parallel (~> 1.10)
47
- parser (>= 2.7.1.5)
48
- rainbow (>= 2.2.2, < 4.0)
49
- regexp_parser (>= 1.8)
50
- rexml
51
- rubocop-ast (>= 1.0.1)
52
- ruby-progressbar (~> 1.7)
53
- unicode-display_width (>= 1.4.0, < 2.0)
54
- rubocop-ast (1.1.0)
55
- parser (>= 2.7.1.5)
56
- ruby-progressbar (1.10.1)
57
- unicode-display_width (1.7.0)
58
-
59
- PLATFORMS
60
- ruby
61
-
62
- DEPENDENCIES
63
- bundler (~> 2.1)
64
- dragonfly-cache!
65
- rake (~> 13.0)
66
- rspec (~> 3.10.0)
67
- rubocop
68
-
69
- BUNDLED WITH
70
- 2.1.4
data/Rakefile DELETED
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'bundler/gem_tasks'
4
-
5
- require 'rubocop/rake_task'
6
- RuboCop::RakeTask.new do |task|
7
- task.options = ['--config', 'config/linters/ruby.yml']
8
- end
9
-
10
- require 'rspec/core/rake_task'
11
- RSpec::Core::RakeTask.new
12
-
13
- task default: :spec
@@ -1,11 +0,0 @@
1
- inherit_mode:
2
- merge:
3
- - Exclude
4
-
5
- Metrics/LineLength:
6
- Max: 150
7
-
8
- # DSLs produce long blocks.
9
- Metrics/BlockLength:
10
- Exclude:
11
- - 'spec/**/*_spec.rb'