activestorage-memory 0.1.1 → 0.2.1

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.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -2
  3. data/app/controllers/activestorage/memory/memory_controller.rb +60 -0
  4. data/config/routes.rb +6 -0
  5. data/lib/active_storage/service/memory_service.rb +86 -5
  6. data/lib/activestorage/memory/engine.rb +7 -0
  7. data/lib/{active_storage → activestorage}/memory/version.rb +2 -2
  8. data/lib/{active_storage → activestorage}/memory.rb +2 -1
  9. data/spec/active_storage/service/memory_service_spec.rb +99 -0
  10. data/spec/activestorage/memory_spec.rb +7 -0
  11. data/spec/controllers/activestorage/memory/memory_controller_spec.rb +136 -0
  12. data/spec/dummy/Rakefile +6 -0
  13. data/spec/dummy/app/assets/config/manifest.js +3 -0
  14. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  15. data/spec/dummy/app/channels/application_cable/channel.rb +4 -0
  16. data/spec/dummy/app/channels/application_cable/connection.rb +4 -0
  17. data/spec/dummy/app/controllers/application_controller.rb +2 -0
  18. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  19. data/spec/dummy/app/jobs/application_job.rb +7 -0
  20. data/spec/dummy/app/mailers/application_mailer.rb +4 -0
  21. data/spec/dummy/app/models/application_record.rb +3 -0
  22. data/spec/dummy/app/views/layouts/application.html.erb +15 -0
  23. data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
  24. data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
  25. data/spec/dummy/bin/rails +4 -0
  26. data/spec/dummy/bin/rake +4 -0
  27. data/spec/dummy/bin/setup +33 -0
  28. data/spec/dummy/config/application.rb +44 -0
  29. data/spec/dummy/config/boot.rb +5 -0
  30. data/spec/dummy/config/cable.yml +10 -0
  31. data/spec/dummy/config/database.yml +25 -0
  32. data/spec/dummy/config/environment.rb +5 -0
  33. data/spec/dummy/config/environments/development.rb +76 -0
  34. data/spec/dummy/config/environments/production.rb +97 -0
  35. data/spec/dummy/config/environments/test.rb +66 -0
  36. data/spec/dummy/config/initializers/assets.rb +12 -0
  37. data/spec/dummy/config/initializers/content_security_policy.rb +25 -0
  38. data/spec/dummy/config/initializers/filter_parameter_logging.rb +8 -0
  39. data/spec/dummy/config/initializers/inflections.rb +16 -0
  40. data/spec/dummy/config/initializers/permissions_policy.rb +13 -0
  41. data/spec/dummy/config/locales/en.yml +31 -0
  42. data/spec/dummy/config/puma.rb +35 -0
  43. data/spec/dummy/config/routes.rb +3 -0
  44. data/spec/dummy/config/storage.yml +37 -0
  45. data/spec/dummy/config.ru +6 -0
  46. data/spec/dummy/db/migrate/20240413101449_create_active_storage_tables.active_storage.rb +57 -0
  47. data/spec/dummy/db/schema.rb +44 -0
  48. data/spec/dummy/log/development.log +53 -0
  49. data/spec/dummy/log/test.log +4820 -0
  50. data/spec/dummy/public/404.html +67 -0
  51. data/spec/dummy/public/422.html +67 -0
  52. data/spec/dummy/public/500.html +66 -0
  53. data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
  54. data/spec/dummy/public/apple-touch-icon.png +0 -0
  55. data/spec/dummy/public/favicon.ico +0 -0
  56. data/spec/dummy/storage/development.sqlite3 +0 -0
  57. data/spec/dummy/storage/test.sqlite3 +0 -0
  58. data/spec/dummy/tmp/local_secret.txt +1 -0
  59. data/spec/dummy/tmp/restart.txt +0 -0
  60. data/spec/rails_helper.rb +65 -0
  61. data/spec/spec_helper.rb +15 -0
  62. metadata +118 -18
  63. data/.github/workflows/main.yml +0 -18
  64. data/.gitignore +0 -11
  65. data/.rspec +0 -3
  66. data/Gemfile +0 -10
  67. data/Gemfile.lock +0 -204
  68. data/LICENSE.txt +0 -21
  69. data/activestorage-memory.gemspec +0 -36
  70. data/bin/console +0 -15
  71. data/bin/setup +0 -8
data/Gemfile.lock DELETED
@@ -1,204 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- activestorage-memory (0.1.1)
5
-
6
- GEM
7
- remote: https://rubygems.org/
8
- specs:
9
- actioncable (7.1.3.2)
10
- actionpack (= 7.1.3.2)
11
- activesupport (= 7.1.3.2)
12
- nio4r (~> 2.0)
13
- websocket-driver (>= 0.6.1)
14
- zeitwerk (~> 2.6)
15
- actionmailbox (7.1.3.2)
16
- actionpack (= 7.1.3.2)
17
- activejob (= 7.1.3.2)
18
- activerecord (= 7.1.3.2)
19
- activestorage (= 7.1.3.2)
20
- activesupport (= 7.1.3.2)
21
- mail (>= 2.7.1)
22
- net-imap
23
- net-pop
24
- net-smtp
25
- actionmailer (7.1.3.2)
26
- actionpack (= 7.1.3.2)
27
- actionview (= 7.1.3.2)
28
- activejob (= 7.1.3.2)
29
- activesupport (= 7.1.3.2)
30
- mail (~> 2.5, >= 2.5.4)
31
- net-imap
32
- net-pop
33
- net-smtp
34
- rails-dom-testing (~> 2.2)
35
- actionpack (7.1.3.2)
36
- actionview (= 7.1.3.2)
37
- activesupport (= 7.1.3.2)
38
- nokogiri (>= 1.8.5)
39
- racc
40
- rack (>= 2.2.4)
41
- rack-session (>= 1.0.1)
42
- rack-test (>= 0.6.3)
43
- rails-dom-testing (~> 2.2)
44
- rails-html-sanitizer (~> 1.6)
45
- actiontext (7.1.3.2)
46
- actionpack (= 7.1.3.2)
47
- activerecord (= 7.1.3.2)
48
- activestorage (= 7.1.3.2)
49
- activesupport (= 7.1.3.2)
50
- globalid (>= 0.6.0)
51
- nokogiri (>= 1.8.5)
52
- actionview (7.1.3.2)
53
- activesupport (= 7.1.3.2)
54
- builder (~> 3.1)
55
- erubi (~> 1.11)
56
- rails-dom-testing (~> 2.2)
57
- rails-html-sanitizer (~> 1.6)
58
- activejob (7.1.3.2)
59
- activesupport (= 7.1.3.2)
60
- globalid (>= 0.3.6)
61
- activemodel (7.1.3.2)
62
- activesupport (= 7.1.3.2)
63
- activerecord (7.1.3.2)
64
- activemodel (= 7.1.3.2)
65
- activesupport (= 7.1.3.2)
66
- timeout (>= 0.4.0)
67
- activestorage (7.1.3.2)
68
- actionpack (= 7.1.3.2)
69
- activejob (= 7.1.3.2)
70
- activerecord (= 7.1.3.2)
71
- activesupport (= 7.1.3.2)
72
- marcel (~> 1.0)
73
- activesupport (7.1.3.2)
74
- base64
75
- bigdecimal
76
- concurrent-ruby (~> 1.0, >= 1.0.2)
77
- connection_pool (>= 2.2.5)
78
- drb
79
- i18n (>= 1.6, < 2)
80
- minitest (>= 5.1)
81
- mutex_m
82
- tzinfo (~> 2.0)
83
- base64 (0.2.0)
84
- bigdecimal (3.1.6)
85
- builder (3.2.4)
86
- concurrent-ruby (1.2.3)
87
- connection_pool (2.4.1)
88
- crass (1.0.6)
89
- date (3.3.4)
90
- diff-lcs (1.5.1)
91
- drb (2.2.1)
92
- erubi (1.12.0)
93
- globalid (1.2.1)
94
- activesupport (>= 6.1)
95
- i18n (1.14.1)
96
- concurrent-ruby (~> 1.0)
97
- io-console (0.7.2)
98
- irb (1.11.2)
99
- rdoc
100
- reline (>= 0.4.2)
101
- loofah (2.22.0)
102
- crass (~> 1.0.2)
103
- nokogiri (>= 1.12.0)
104
- mail (2.8.1)
105
- mini_mime (>= 0.1.1)
106
- net-imap
107
- net-pop
108
- net-smtp
109
- marcel (1.0.4)
110
- mini_mime (1.1.5)
111
- minitest (5.22.2)
112
- mutex_m (0.2.0)
113
- net-imap (0.4.10)
114
- date
115
- net-protocol
116
- net-pop (0.1.2)
117
- net-protocol
118
- net-protocol (0.2.2)
119
- timeout
120
- net-smtp (0.4.0.1)
121
- net-protocol
122
- nio4r (2.7.0)
123
- nokogiri (1.16.2-x86_64-darwin)
124
- racc (~> 1.4)
125
- psych (5.1.2)
126
- stringio
127
- racc (1.7.3)
128
- rack (3.0.9.1)
129
- rack-session (2.0.0)
130
- rack (>= 3.0.0)
131
- rack-test (2.1.0)
132
- rack (>= 1.3)
133
- rackup (2.1.0)
134
- rack (>= 3)
135
- webrick (~> 1.8)
136
- rails (7.1.3.2)
137
- actioncable (= 7.1.3.2)
138
- actionmailbox (= 7.1.3.2)
139
- actionmailer (= 7.1.3.2)
140
- actionpack (= 7.1.3.2)
141
- actiontext (= 7.1.3.2)
142
- actionview (= 7.1.3.2)
143
- activejob (= 7.1.3.2)
144
- activemodel (= 7.1.3.2)
145
- activerecord (= 7.1.3.2)
146
- activestorage (= 7.1.3.2)
147
- activesupport (= 7.1.3.2)
148
- bundler (>= 1.15.0)
149
- railties (= 7.1.3.2)
150
- rails-dom-testing (2.2.0)
151
- activesupport (>= 5.0.0)
152
- minitest
153
- nokogiri (>= 1.6)
154
- rails-html-sanitizer (1.6.0)
155
- loofah (~> 2.21)
156
- nokogiri (~> 1.14)
157
- railties (7.1.3.2)
158
- actionpack (= 7.1.3.2)
159
- activesupport (= 7.1.3.2)
160
- irb
161
- rackup (>= 1.0.0)
162
- rake (>= 12.2)
163
- thor (~> 1.0, >= 1.2.2)
164
- zeitwerk (~> 2.6)
165
- rake (13.1.0)
166
- rdoc (6.6.2)
167
- psych (>= 4.0.0)
168
- reline (0.4.3)
169
- io-console (~> 0.5)
170
- rspec (3.13.0)
171
- rspec-core (~> 3.13.0)
172
- rspec-expectations (~> 3.13.0)
173
- rspec-mocks (~> 3.13.0)
174
- rspec-core (3.13.0)
175
- rspec-support (~> 3.13.0)
176
- rspec-expectations (3.13.0)
177
- diff-lcs (>= 1.2.0, < 2.0)
178
- rspec-support (~> 3.13.0)
179
- rspec-mocks (3.13.0)
180
- diff-lcs (>= 1.2.0, < 2.0)
181
- rspec-support (~> 3.13.0)
182
- rspec-support (3.13.1)
183
- stringio (3.1.0)
184
- thor (1.3.1)
185
- timeout (0.4.1)
186
- tzinfo (2.0.6)
187
- concurrent-ruby (~> 1.0)
188
- webrick (1.8.1)
189
- websocket-driver (0.7.6)
190
- websocket-extensions (>= 0.1.0)
191
- websocket-extensions (0.1.5)
192
- zeitwerk (2.6.13)
193
-
194
- PLATFORMS
195
- x86_64-darwin-22
196
-
197
- DEPENDENCIES
198
- activestorage-memory!
199
- rails (~> 7.0, >= 7.0.0)
200
- rake (~> 13.0)
201
- rspec (~> 3.0)
202
-
203
- BUNDLED WITH
204
- 2.4.10
data/LICENSE.txt DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2024 kykt35
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
@@ -1,36 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'lib/active_storage/memory/version'
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = 'activestorage-memory'
7
- spec.version = ActiveStorage::Memory::VERSION
8
- spec.authors = ['kykt35']
9
- spec.email = ['kykt35@gmail.com']
10
-
11
- spec.summary = 'Rails ActiveStorage in-memory service adopter.'
12
- spec.homepage = 'https://github.com/kykt35/activestorage-memory'
13
- spec.license = 'MIT'
14
- spec.required_ruby_version = Gem::Requirement.new('>= 2.7.0')
15
-
16
- spec.metadata['homepage_uri'] = spec.homepage
17
- spec.metadata['source_code_uri'] = 'https://github.com/kykt35/activestorage-memory'
18
- spec.metadata['changelog_uri'] = 'https://github.com/kykt35/activestorage-memory'
19
-
20
- # Specify which files should be added to the gem when it is released.
21
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
22
- spec.files = Dir.chdir(File.expand_path(__dir__)) do
23
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
24
- end
25
- spec.bindir = 'exe'
26
- spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
27
- spec.require_paths = ['lib']
28
-
29
- # Uncomment to register a new dependency of your gem
30
- spec.add_development_dependency 'rails', '~> 7.0', '>= 7.0.0'
31
- spec.add_development_dependency 'rspec', '~> 3.0'
32
- # spec.add_dependency "example-gem", "~> 1.0"
33
-
34
- # For more information and examples about making a new gem, checkout our
35
- # guide at: https://bundler.io/guides/creating_gem.html
36
- end
data/bin/console DELETED
@@ -1,15 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'bundler/setup'
5
- require 'active_storage/memory'
6
-
7
- # You can add fixtures and/or initialization code here to make experimenting
8
- # with your gem easier. You can also use a different console, if you like.
9
-
10
- # (If you use this, don't forget to add pry to your Gemfile!)
11
- # require "pry"
12
- # Pry.start
13
-
14
- require 'irb'
15
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here