dragonfly-cache 0.1.8 → 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 +4 -4
- data/CHANGELOG.md +89 -0
- data/README.md +3 -0
- data/dev/gemfiles/ci.gemfile +7 -0
- data/dragonfly-cache.gemspec +17 -8
- data/lib/dragonfly/cache/config.rb +5 -2
- data/lib/dragonfly/cache/manager.rb +1 -1
- data/lib/dragonfly/cache/mapper/yaml.rb +1 -1
- data/lib/dragonfly/cache/plugin.rb +4 -2
- data/lib/dragonfly/cache/storage/local.rb +1 -1
- data/lib/dragonfly/cache/version.rb +1 -1
- data/lib/dragonfly/cache.rb +1 -1
- metadata +14 -58
- data/.gitignore +0 -10
- data/.rspec +0 -2
- data/.rubocop.yml +0 -6
- data/.travis.yml +0 -11
- data/Gemfile +0 -6
- data/Gemfile.lock +0 -77
- data/Rakefile +0 -13
- data/config/linters/ruby.yml +0 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c8ff08670c9d9c9d4c8e0a98d947fb0c60c0296b1637de15372360641ca76baa
|
|
4
|
+
data.tar.gz: 75dee33b161617d4f2111b1d775f81675fda51229a223b5794fd327e777b0269
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
+
[](https://github.com/notus-sh/dragonfly-cache/actions/workflows/unit-tests.yml)
|
|
4
|
+
[](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.
|
data/dragonfly-cache.gemspec
CHANGED
|
@@ -17,24 +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
|
|
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
|
-
|
|
24
|
-
|
|
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
|
|
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.
|
|
35
|
-
spec.add_development_dependency 'rubocop'
|
|
36
|
-
spec.add_development_dependency 'rubocop-rake'
|
|
37
|
-
spec.add_development_dependency 'rubocop-rspec'
|
|
46
|
+
spec.add_development_dependency 'rspec', '~> 3.13.0'
|
|
38
47
|
|
|
39
48
|
spec.post_install_message = <<~POST_INSTALL_MESSAGE
|
|
40
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
|
-
|
|
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!
|
|
@@ -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
|
data/lib/dragonfly/cache.rb
CHANGED
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.
|
|
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:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: dragonfly
|
|
@@ -72,56 +71,14 @@ dependencies:
|
|
|
72
71
|
requirements:
|
|
73
72
|
- - "~>"
|
|
74
73
|
- !ruby/object:Gem::Version
|
|
75
|
-
version: 3.
|
|
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.
|
|
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'
|
|
97
|
-
- !ruby/object:Gem::Dependency
|
|
98
|
-
name: rubocop-rake
|
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
|
100
|
-
requirements:
|
|
101
|
-
- - ">="
|
|
102
|
-
- !ruby/object:Gem::Version
|
|
103
|
-
version: '0'
|
|
104
|
-
type: :development
|
|
105
|
-
prerelease: false
|
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
-
requirements:
|
|
108
|
-
- - ">="
|
|
109
|
-
- !ruby/object:Gem::Version
|
|
110
|
-
version: '0'
|
|
111
|
-
- !ruby/object:Gem::Dependency
|
|
112
|
-
name: rubocop-rspec
|
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
|
114
|
-
requirements:
|
|
115
|
-
- - ">="
|
|
116
|
-
- !ruby/object:Gem::Version
|
|
117
|
-
version: '0'
|
|
118
|
-
type: :development
|
|
119
|
-
prerelease: false
|
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
121
|
-
requirements:
|
|
122
|
-
- - ">="
|
|
123
|
-
- !ruby/object:Gem::Version
|
|
124
|
-
version: '0'
|
|
81
|
+
version: 3.13.0
|
|
125
82
|
description: Allow Dragonfly to keep a cache of jobs results
|
|
126
83
|
email:
|
|
127
84
|
- gael-ian@notus.sh
|
|
@@ -129,16 +86,10 @@ executables: []
|
|
|
129
86
|
extensions: []
|
|
130
87
|
extra_rdoc_files: []
|
|
131
88
|
files:
|
|
132
|
-
-
|
|
133
|
-
- ".rspec"
|
|
134
|
-
- ".rubocop.yml"
|
|
135
|
-
- ".travis.yml"
|
|
136
|
-
- Gemfile
|
|
137
|
-
- Gemfile.lock
|
|
89
|
+
- CHANGELOG.md
|
|
138
90
|
- LICENSE
|
|
139
91
|
- README.md
|
|
140
|
-
-
|
|
141
|
-
- config/linters/ruby.yml
|
|
92
|
+
- dev/gemfiles/ci.gemfile
|
|
142
93
|
- dragonfly-cache.gemspec
|
|
143
94
|
- lib/dragonfly/cache.rb
|
|
144
95
|
- lib/dragonfly/cache/config.rb
|
|
@@ -153,6 +104,12 @@ licenses:
|
|
|
153
104
|
- Apache-2.0
|
|
154
105
|
metadata:
|
|
155
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
|
|
156
113
|
post_install_message: |+
|
|
157
114
|
Don't forget to configure Dragonfly::Cache:
|
|
158
115
|
|
|
@@ -169,15 +126,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
169
126
|
requirements:
|
|
170
127
|
- - ">="
|
|
171
128
|
- !ruby/object:Gem::Version
|
|
172
|
-
version: '2
|
|
129
|
+
version: '3.2'
|
|
173
130
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
174
131
|
requirements:
|
|
175
132
|
- - ">="
|
|
176
133
|
- !ruby/object:Gem::Version
|
|
177
134
|
version: '0'
|
|
178
135
|
requirements: []
|
|
179
|
-
rubygems_version: 3.
|
|
180
|
-
signing_key:
|
|
136
|
+
rubygems_version: 3.6.9
|
|
181
137
|
specification_version: 4
|
|
182
138
|
summary: Cache adapter for Dragonfly
|
|
183
139
|
test_files: []
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/.rubocop.yml
DELETED
data/.travis.yml
DELETED
data/Gemfile
DELETED
data/Gemfile.lock
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
PATH
|
|
2
|
-
remote: .
|
|
3
|
-
specs:
|
|
4
|
-
dragonfly-cache (0.1.8)
|
|
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.2)
|
|
14
|
-
concurrent-ruby (1.1.8)
|
|
15
|
-
diff-lcs (1.4.4)
|
|
16
|
-
dragonfly (1.3.0)
|
|
17
|
-
addressable (~> 2.3)
|
|
18
|
-
multi_json (~> 1.0)
|
|
19
|
-
rack (>= 1.3)
|
|
20
|
-
i18n (1.8.10)
|
|
21
|
-
concurrent-ruby (~> 1.0)
|
|
22
|
-
multi_json (1.15.0)
|
|
23
|
-
parallel (1.20.1)
|
|
24
|
-
parser (3.0.1.1)
|
|
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.3)
|
|
30
|
-
regexp_parser (2.1.1)
|
|
31
|
-
rexml (3.2.5)
|
|
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.1)
|
|
37
|
-
rspec-support (~> 3.10.0)
|
|
38
|
-
rspec-expectations (3.10.1)
|
|
39
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
40
|
-
rspec-support (~> 3.10.0)
|
|
41
|
-
rspec-mocks (3.10.2)
|
|
42
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
43
|
-
rspec-support (~> 3.10.0)
|
|
44
|
-
rspec-support (3.10.2)
|
|
45
|
-
rubocop (1.13.0)
|
|
46
|
-
parallel (~> 1.10)
|
|
47
|
-
parser (>= 3.0.0.0)
|
|
48
|
-
rainbow (>= 2.2.2, < 4.0)
|
|
49
|
-
regexp_parser (>= 1.8, < 3.0)
|
|
50
|
-
rexml
|
|
51
|
-
rubocop-ast (>= 1.2.0, < 2.0)
|
|
52
|
-
ruby-progressbar (~> 1.7)
|
|
53
|
-
unicode-display_width (>= 1.4.0, < 3.0)
|
|
54
|
-
rubocop-ast (1.5.0)
|
|
55
|
-
parser (>= 3.0.1.1)
|
|
56
|
-
rubocop-rake (0.5.1)
|
|
57
|
-
rubocop
|
|
58
|
-
rubocop-rspec (2.3.0)
|
|
59
|
-
rubocop (~> 1.0)
|
|
60
|
-
rubocop-ast (>= 1.1.0)
|
|
61
|
-
ruby-progressbar (1.11.0)
|
|
62
|
-
unicode-display_width (2.0.0)
|
|
63
|
-
|
|
64
|
-
PLATFORMS
|
|
65
|
-
ruby
|
|
66
|
-
|
|
67
|
-
DEPENDENCIES
|
|
68
|
-
bundler (~> 2.1)
|
|
69
|
-
dragonfly-cache!
|
|
70
|
-
rake (~> 13.0)
|
|
71
|
-
rspec (~> 3.10.0)
|
|
72
|
-
rubocop
|
|
73
|
-
rubocop-rake
|
|
74
|
-
rubocop-rspec
|
|
75
|
-
|
|
76
|
-
BUNDLED WITH
|
|
77
|
-
2.2.3
|
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
|