activestorage-delayed 0.1.0 → 0.1.3
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/.github/workflows/release.yml +43 -0
- data/.github/workflows/ruby.yml +31 -0
- data/.gitignore +10 -0
- data/.idea/.gitignore +8 -0
- data/.idea/activestorage-delayed.iml +79 -0
- data/.idea/misc.xml +4 -0
- data/.idea/modules.xml +8 -0
- data/.idea/vcs.xml +6 -0
- data/.rspec +1 -0
- data/.rubocop.yml +19 -0
- data/Dockerfile +7 -0
- data/Gemfile +19 -0
- data/Gemfile.lock +234 -0
- data/README.md +10 -3
- data/activestorage-delayed.gemspec +31 -0
- data/bin/test +7 -0
- data/db/test.sqlite3 +0 -0
- data/docker-compose.yaml +14 -0
- data/initializers/upload_default_variation.rb +31 -0
- data/lib/activestorage-delayed/delayed_uploader.rb +3 -2
- data/lib/activestorage-delayed/version.rb +1 -1
- data/lib/{activestorage_delayed.rb → activestorage-delayed.rb} +0 -0
- metadata +21 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 21cd7652c2fbe15057bf6f36a36c7ec510ed1e622f5adb0e0f566f5a2e30c111
|
|
4
|
+
data.tar.gz: e16a8f72a0cc7049dfccb958499ba112659abcf0afbf03e9961fdcaea6cd76cd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1c69f49fc4c77684d71a9ccc9b6fdf09bdea824a0f6588974024dce997ebfe7bac49bfa0c257a8c4610437a133837d00a3040e812b8d1014f9efb5c078104079
|
|
7
|
+
data.tar.gz: '0802bc892fa31b38e35042860919944b7eeee09811057eb082d0a4eaf426d880a624aa306835e75acbf54cc9cf0e631c3ab5a07e18307a0f9c70ef9b99492160'
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
on:
|
|
2
|
+
push:
|
|
3
|
+
tags: # triggered once a git tag is published
|
|
4
|
+
- '*'
|
|
5
|
+
|
|
6
|
+
name: Create Release
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build:
|
|
10
|
+
name: Create Release
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- name: Checkout code
|
|
14
|
+
uses: actions/checkout@v2
|
|
15
|
+
with:
|
|
16
|
+
fetch-depth: 0
|
|
17
|
+
|
|
18
|
+
# Changelog action adaptations
|
|
19
|
+
- name: Create required package.json
|
|
20
|
+
run: test -f package.json || echo '{}' >package.json
|
|
21
|
+
- name: Detect Previous Tag (action not detecting very well)
|
|
22
|
+
run: echo "::set-output name=previous_tag::$(git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1`)"
|
|
23
|
+
id: tag_checker
|
|
24
|
+
|
|
25
|
+
- name: Generate Changelog
|
|
26
|
+
uses: scottbrenner/generate-changelog-action@master
|
|
27
|
+
id: Changelog
|
|
28
|
+
with:
|
|
29
|
+
from-tag: ${{steps.tag_checker.outputs.previous_tag}}
|
|
30
|
+
to-tag: HEAD
|
|
31
|
+
|
|
32
|
+
- name: Create Release
|
|
33
|
+
id: create_release
|
|
34
|
+
uses: actions/create-release@latest
|
|
35
|
+
env:
|
|
36
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
|
|
37
|
+
with:
|
|
38
|
+
tag_name: ${{ github.ref }}
|
|
39
|
+
release_name: Release ${{ github.ref }}
|
|
40
|
+
body: |
|
|
41
|
+
${{ steps.Changelog.outputs.changelog }}
|
|
42
|
+
draft: false
|
|
43
|
+
prerelease: false
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: App tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
- staging
|
|
8
|
+
pull_request:
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
|
|
14
|
+
steps:
|
|
15
|
+
- name: Checkout repository
|
|
16
|
+
uses: actions/checkout@v2
|
|
17
|
+
- name: Cancel previous Workflow Actions
|
|
18
|
+
uses: styfle/cancel-workflow-action@0.6.0
|
|
19
|
+
with:
|
|
20
|
+
access_token: ${{ github.token }}
|
|
21
|
+
- name: download docker-compose cache
|
|
22
|
+
run: docker-compose pull
|
|
23
|
+
- uses: satackey/action-docker-layer-caching@v0.0.11 # Cache or restore docker cache
|
|
24
|
+
continue-on-error: true # Ignore the failure of a step and avoid terminating the job.
|
|
25
|
+
with:
|
|
26
|
+
key: app-cache-${{ hashFiles('Dockerfile') }}
|
|
27
|
+
|
|
28
|
+
- name: Run rspec test
|
|
29
|
+
run: docker-compose run test /bin/sh -c "bundle install && rspec"
|
|
30
|
+
- name: Check codestyle
|
|
31
|
+
run: docker-compose run test /bin/sh -c "rubocop"
|
data/.gitignore
ADDED
data/.idea/.gitignore
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="RUBY_MODULE" version="4">
|
|
3
|
+
<component name="ModuleRunConfigurationManager">
|
|
4
|
+
<shared />
|
|
5
|
+
</component>
|
|
6
|
+
<component name="NewModuleRootManager">
|
|
7
|
+
<content url="file://$MODULE_DIR$">
|
|
8
|
+
<sourceFolder url="file://$MODULE_DIR$/features" isTestSource="true" />
|
|
9
|
+
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
|
|
10
|
+
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
|
|
11
|
+
<excludeFolder url="file://$MODULE_DIR$/spec/dummy/tmp/cache" />
|
|
12
|
+
</content>
|
|
13
|
+
<orderEntry type="jdk" jdkName="Remote: ruby-2.5.9-p229" jdkType="RUBY_SDK" />
|
|
14
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
15
|
+
<orderEntry type="library" scope="PROVIDED" name="ast (v2.4.2, Remote: ruby-2.5.9-p229) [gem]" level="application" />
|
|
16
|
+
<orderEntry type="library" scope="PROVIDED" name="builder (v3.2.4, Remote: ruby-2.5.9-p229) [gem]" level="application" />
|
|
17
|
+
<orderEntry type="library" scope="PROVIDED" name="bundler (v2.3.10, Remote: ruby-2.5.9-p229) [gem]" level="application" />
|
|
18
|
+
<orderEntry type="library" scope="PROVIDED" name="concurrent-ruby (v1.1.10, Remote: ruby-2.5.9-p229) [gem]" level="application" />
|
|
19
|
+
<orderEntry type="library" scope="PROVIDED" name="crass (v1.0.6, Remote: ruby-2.5.9-p229) [gem]" level="application" />
|
|
20
|
+
<orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.5.0, Remote: ruby-2.5.9-p229) [gem]" level="application" />
|
|
21
|
+
<orderEntry type="library" scope="PROVIDED" name="erubi (v1.10.0, Remote: ruby-2.5.9-p229) [gem]" level="application" />
|
|
22
|
+
<orderEntry type="library" scope="PROVIDED" name="factory_bot (v6.2.1, Remote: ruby-2.5.9-p229) [gem]" level="application" />
|
|
23
|
+
<orderEntry type="library" scope="PROVIDED" name="factory_bot_rails (v6.2.0, Remote: ruby-2.5.9-p229) [gem]" level="application" />
|
|
24
|
+
<orderEntry type="library" scope="PROVIDED" name="globalid (v1.0.0, Remote: ruby-2.5.9-p229) [gem]" level="application" />
|
|
25
|
+
<orderEntry type="library" scope="PROVIDED" name="i18n (v1.10.0, Remote: ruby-2.5.9-p229) [gem]" level="application" />
|
|
26
|
+
<orderEntry type="library" scope="PROVIDED" name="mail (v2.7.1, Remote: ruby-2.5.9-p229) [gem]" level="application" />
|
|
27
|
+
<orderEntry type="library" scope="PROVIDED" name="marcel (v1.0.2, Remote: ruby-2.5.9-p229) [gem]" level="application" />
|
|
28
|
+
<orderEntry type="library" scope="PROVIDED" name="method_source (v1.0.0, Remote: ruby-2.5.9-p229) [gem]" level="application" />
|
|
29
|
+
<orderEntry type="library" scope="PROVIDED" name="mini_mime (v1.1.2, Remote: ruby-2.5.9-p229) [gem]" level="application" />
|
|
30
|
+
<orderEntry type="library" scope="PROVIDED" name="minitest (v5.15.0, Remote: ruby-2.5.9-p229) [gem]" level="application" />
|
|
31
|
+
<orderEntry type="library" scope="PROVIDED" name="nio4r (v2.5.8, Remote: ruby-2.5.9-p229) [gem]" level="application" />
|
|
32
|
+
<orderEntry type="library" scope="PROVIDED" name="racc (v1.6.0, Remote: ruby-2.5.9-p229) [gem]" level="application" />
|
|
33
|
+
<orderEntry type="library" scope="PROVIDED" name="rack (v2.2.3, Remote: ruby-2.5.9-p229) [gem]" level="application" />
|
|
34
|
+
<orderEntry type="library" scope="PROVIDED" name="rack-test (v1.1.0, Remote: ruby-2.5.9-p229) [gem]" level="application" />
|
|
35
|
+
<orderEntry type="library" scope="PROVIDED" name="rails-dom-testing (v2.0.3, Remote: ruby-2.5.9-p229) [gem]" level="application" />
|
|
36
|
+
<orderEntry type="library" scope="PROVIDED" name="rails-html-sanitizer (v1.4.2, Remote: ruby-2.5.9-p229) [gem]" level="application" />
|
|
37
|
+
<orderEntry type="library" scope="PROVIDED" name="rainbow (v3.1.1, Remote: ruby-2.5.9-p229) [gem]" level="application" />
|
|
38
|
+
<orderEntry type="library" scope="PROVIDED" name="rake (v13.0.6, Remote: ruby-2.5.9-p229) [gem]" level="application" />
|
|
39
|
+
<orderEntry type="library" scope="PROVIDED" name="rexml (v3.2.5, Remote: ruby-2.5.9-p229) [gem]" level="application" />
|
|
40
|
+
<orderEntry type="library" scope="PROVIDED" name="ruby-progressbar (v1.11.0, Remote: ruby-2.5.9-p229) [gem]" level="application" />
|
|
41
|
+
<orderEntry type="library" scope="PROVIDED" name="thor (v1.2.1, Remote: ruby-2.5.9-p229) [gem]" level="application" />
|
|
42
|
+
<orderEntry type="library" scope="PROVIDED" name="tzinfo (v2.0.4, Remote: ruby-2.5.9-p229) [gem]" level="application" />
|
|
43
|
+
<orderEntry type="library" scope="PROVIDED" name="unicode-display_width (v2.1.0, Remote: ruby-2.5.9-p229) [gem]" level="application" />
|
|
44
|
+
<orderEntry type="library" scope="PROVIDED" name="websocket-driver (v0.7.5, Remote: ruby-2.5.9-p229) [gem]" level="application" />
|
|
45
|
+
<orderEntry type="library" scope="PROVIDED" name="websocket-extensions (v0.1.5, Remote: ruby-2.5.9-p229) [gem]" level="application" />
|
|
46
|
+
<orderEntry type="library" scope="PROVIDED" name="zeitwerk (v2.5.4, Remote: ruby-2.5.9-p229) [gem]" level="application" />
|
|
47
|
+
</component>
|
|
48
|
+
<component name="RakeTasksCache">
|
|
49
|
+
<option name="myRootTask">
|
|
50
|
+
<RakeTaskImpl id="rake">
|
|
51
|
+
<subtasks>
|
|
52
|
+
<RakeTaskImpl description="Build activestorage-delayed-0.1.0.gem into the pkg directory" fullCommand="build" id="build" />
|
|
53
|
+
<RakeTaskImpl id="build">
|
|
54
|
+
<subtasks>
|
|
55
|
+
<RakeTaskImpl description="Generate SHA512 checksum if activestorage-delayed-0.1.0.gem into the checksums directory" fullCommand="build:checksum" id="checksum" />
|
|
56
|
+
</subtasks>
|
|
57
|
+
</RakeTaskImpl>
|
|
58
|
+
<RakeTaskImpl description="Remove any temporary products" fullCommand="clean" id="clean" />
|
|
59
|
+
<RakeTaskImpl description="Remove any generated files" fullCommand="clobber" id="clobber" />
|
|
60
|
+
<RakeTaskImpl description="Build and install activestorage-delayed-0.1.0.gem into system gems" fullCommand="install" id="install" />
|
|
61
|
+
<RakeTaskImpl id="install">
|
|
62
|
+
<subtasks>
|
|
63
|
+
<RakeTaskImpl description="Build and install activestorage-delayed-0.1.0.gem into system gems without network access" fullCommand="install:local" id="local" />
|
|
64
|
+
</subtasks>
|
|
65
|
+
</RakeTaskImpl>
|
|
66
|
+
<RakeTaskImpl description="Create tag v0.1.0 and build and push activestorage-delayed-0.1.0.gem to rubygems.org" fullCommand="release[remote]" id="release[remote]" />
|
|
67
|
+
<RakeTaskImpl description="" fullCommand="release" id="release" />
|
|
68
|
+
<RakeTaskImpl id="release">
|
|
69
|
+
<subtasks>
|
|
70
|
+
<RakeTaskImpl description="" fullCommand="release:guard_clean" id="guard_clean" />
|
|
71
|
+
<RakeTaskImpl description="" fullCommand="release:rubygem_push" id="rubygem_push" />
|
|
72
|
+
<RakeTaskImpl description="" fullCommand="release:source_control_push" id="source_control_push" />
|
|
73
|
+
</subtasks>
|
|
74
|
+
</RakeTaskImpl>
|
|
75
|
+
</subtasks>
|
|
76
|
+
</RakeTaskImpl>
|
|
77
|
+
</option>
|
|
78
|
+
</component>
|
|
79
|
+
</module>
|
data/.idea/misc.xml
ADDED
data/.idea/modules.xml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ProjectModuleManager">
|
|
4
|
+
<modules>
|
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/activestorage-delayed.iml" filepath="$PROJECT_DIR$/.idea/activestorage-delayed.iml" />
|
|
6
|
+
</modules>
|
|
7
|
+
</component>
|
|
8
|
+
</project>
|
data/.idea/vcs.xml
ADDED
data/.rspec
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
--require spec_helper
|
data/.rubocop.yml
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Style/Documentation:
|
|
2
|
+
Enabled: false
|
|
3
|
+
|
|
4
|
+
Gemspec/RequiredRubyVersion:
|
|
5
|
+
Enabled: false
|
|
6
|
+
|
|
7
|
+
AllCops:
|
|
8
|
+
Exclude:
|
|
9
|
+
- spec/dummy/**/*
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
Naming/FileName:
|
|
13
|
+
Exclude:
|
|
14
|
+
- lib/activestorage-delayed.rb
|
|
15
|
+
|
|
16
|
+
Metrics/BlockLength:
|
|
17
|
+
Exclude:
|
|
18
|
+
- spec/**/*
|
|
19
|
+
- db/migrate/*
|
data/Dockerfile
ADDED
data/Gemfile
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
source 'https://rubygems.org'
|
|
4
|
+
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
|
5
|
+
|
|
6
|
+
# Specify your gem's dependencies in activestorage-delayed.gemspec.
|
|
7
|
+
gemspec
|
|
8
|
+
|
|
9
|
+
group :development, :test do
|
|
10
|
+
gem 'byebug'
|
|
11
|
+
gem 'capybara'
|
|
12
|
+
gem 'database_cleaner-active_record'
|
|
13
|
+
gem 'factory_bot_rails'
|
|
14
|
+
gem 'puma'
|
|
15
|
+
gem 'rails', '~> 7'
|
|
16
|
+
gem 'rspec-rails'
|
|
17
|
+
gem 'rubocop'
|
|
18
|
+
gem 'sqlite3'
|
|
19
|
+
end
|
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
activestorage-delayed (0.1.3)
|
|
5
|
+
activestorage
|
|
6
|
+
rails
|
|
7
|
+
|
|
8
|
+
GEM
|
|
9
|
+
remote: https://rubygems.org/
|
|
10
|
+
specs:
|
|
11
|
+
actioncable (7.0.2.3)
|
|
12
|
+
actionpack (= 7.0.2.3)
|
|
13
|
+
activesupport (= 7.0.2.3)
|
|
14
|
+
nio4r (~> 2.0)
|
|
15
|
+
websocket-driver (>= 0.6.1)
|
|
16
|
+
actionmailbox (7.0.2.3)
|
|
17
|
+
actionpack (= 7.0.2.3)
|
|
18
|
+
activejob (= 7.0.2.3)
|
|
19
|
+
activerecord (= 7.0.2.3)
|
|
20
|
+
activestorage (= 7.0.2.3)
|
|
21
|
+
activesupport (= 7.0.2.3)
|
|
22
|
+
mail (>= 2.7.1)
|
|
23
|
+
net-imap
|
|
24
|
+
net-pop
|
|
25
|
+
net-smtp
|
|
26
|
+
actionmailer (7.0.2.3)
|
|
27
|
+
actionpack (= 7.0.2.3)
|
|
28
|
+
actionview (= 7.0.2.3)
|
|
29
|
+
activejob (= 7.0.2.3)
|
|
30
|
+
activesupport (= 7.0.2.3)
|
|
31
|
+
mail (~> 2.5, >= 2.5.4)
|
|
32
|
+
net-imap
|
|
33
|
+
net-pop
|
|
34
|
+
net-smtp
|
|
35
|
+
rails-dom-testing (~> 2.0)
|
|
36
|
+
actionpack (7.0.2.3)
|
|
37
|
+
actionview (= 7.0.2.3)
|
|
38
|
+
activesupport (= 7.0.2.3)
|
|
39
|
+
rack (~> 2.0, >= 2.2.0)
|
|
40
|
+
rack-test (>= 0.6.3)
|
|
41
|
+
rails-dom-testing (~> 2.0)
|
|
42
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
|
43
|
+
actiontext (7.0.2.3)
|
|
44
|
+
actionpack (= 7.0.2.3)
|
|
45
|
+
activerecord (= 7.0.2.3)
|
|
46
|
+
activestorage (= 7.0.2.3)
|
|
47
|
+
activesupport (= 7.0.2.3)
|
|
48
|
+
globalid (>= 0.6.0)
|
|
49
|
+
nokogiri (>= 1.8.5)
|
|
50
|
+
actionview (7.0.2.3)
|
|
51
|
+
activesupport (= 7.0.2.3)
|
|
52
|
+
builder (~> 3.1)
|
|
53
|
+
erubi (~> 1.4)
|
|
54
|
+
rails-dom-testing (~> 2.0)
|
|
55
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
|
56
|
+
activejob (7.0.2.3)
|
|
57
|
+
activesupport (= 7.0.2.3)
|
|
58
|
+
globalid (>= 0.3.6)
|
|
59
|
+
activemodel (7.0.2.3)
|
|
60
|
+
activesupport (= 7.0.2.3)
|
|
61
|
+
activerecord (7.0.2.3)
|
|
62
|
+
activemodel (= 7.0.2.3)
|
|
63
|
+
activesupport (= 7.0.2.3)
|
|
64
|
+
activestorage (7.0.2.3)
|
|
65
|
+
actionpack (= 7.0.2.3)
|
|
66
|
+
activejob (= 7.0.2.3)
|
|
67
|
+
activerecord (= 7.0.2.3)
|
|
68
|
+
activesupport (= 7.0.2.3)
|
|
69
|
+
marcel (~> 1.0)
|
|
70
|
+
mini_mime (>= 1.1.0)
|
|
71
|
+
activesupport (7.0.2.3)
|
|
72
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
73
|
+
i18n (>= 1.6, < 2)
|
|
74
|
+
minitest (>= 5.1)
|
|
75
|
+
tzinfo (~> 2.0)
|
|
76
|
+
addressable (2.8.0)
|
|
77
|
+
public_suffix (>= 2.0.2, < 5.0)
|
|
78
|
+
ast (2.4.2)
|
|
79
|
+
builder (3.2.4)
|
|
80
|
+
byebug (11.1.3)
|
|
81
|
+
capybara (3.36.0)
|
|
82
|
+
addressable
|
|
83
|
+
matrix
|
|
84
|
+
mini_mime (>= 0.1.3)
|
|
85
|
+
nokogiri (~> 1.8)
|
|
86
|
+
rack (>= 1.6.0)
|
|
87
|
+
rack-test (>= 0.6.3)
|
|
88
|
+
regexp_parser (>= 1.5, < 3.0)
|
|
89
|
+
xpath (~> 3.2)
|
|
90
|
+
concurrent-ruby (1.1.10)
|
|
91
|
+
crass (1.0.6)
|
|
92
|
+
database_cleaner-active_record (2.0.1)
|
|
93
|
+
activerecord (>= 5.a)
|
|
94
|
+
database_cleaner-core (~> 2.0.0)
|
|
95
|
+
database_cleaner-core (2.0.1)
|
|
96
|
+
diff-lcs (1.5.0)
|
|
97
|
+
digest (3.1.0)
|
|
98
|
+
erubi (1.10.0)
|
|
99
|
+
factory_bot (6.2.1)
|
|
100
|
+
activesupport (>= 5.0.0)
|
|
101
|
+
factory_bot_rails (6.2.0)
|
|
102
|
+
factory_bot (~> 6.2.0)
|
|
103
|
+
railties (>= 5.0.0)
|
|
104
|
+
globalid (1.0.0)
|
|
105
|
+
activesupport (>= 5.0)
|
|
106
|
+
i18n (1.10.0)
|
|
107
|
+
concurrent-ruby (~> 1.0)
|
|
108
|
+
loofah (2.16.0)
|
|
109
|
+
crass (~> 1.0.2)
|
|
110
|
+
nokogiri (>= 1.5.9)
|
|
111
|
+
mail (2.7.1)
|
|
112
|
+
mini_mime (>= 0.1.1)
|
|
113
|
+
marcel (1.0.2)
|
|
114
|
+
matrix (0.4.2)
|
|
115
|
+
method_source (1.0.0)
|
|
116
|
+
mini_mime (1.1.2)
|
|
117
|
+
minitest (5.15.0)
|
|
118
|
+
net-imap (0.2.3)
|
|
119
|
+
digest
|
|
120
|
+
net-protocol
|
|
121
|
+
strscan
|
|
122
|
+
net-pop (0.1.1)
|
|
123
|
+
digest
|
|
124
|
+
net-protocol
|
|
125
|
+
timeout
|
|
126
|
+
net-protocol (0.1.3)
|
|
127
|
+
timeout
|
|
128
|
+
net-smtp (0.3.1)
|
|
129
|
+
digest
|
|
130
|
+
net-protocol
|
|
131
|
+
timeout
|
|
132
|
+
nio4r (2.5.8)
|
|
133
|
+
nokogiri (1.13.4-x86_64-linux)
|
|
134
|
+
racc (~> 1.4)
|
|
135
|
+
parallel (1.22.1)
|
|
136
|
+
parser (3.1.2.0)
|
|
137
|
+
ast (~> 2.4.1)
|
|
138
|
+
public_suffix (4.0.7)
|
|
139
|
+
puma (5.6.4)
|
|
140
|
+
nio4r (~> 2.0)
|
|
141
|
+
racc (1.6.0)
|
|
142
|
+
rack (2.2.3)
|
|
143
|
+
rack-test (1.1.0)
|
|
144
|
+
rack (>= 1.0, < 3)
|
|
145
|
+
rails (7.0.2.3)
|
|
146
|
+
actioncable (= 7.0.2.3)
|
|
147
|
+
actionmailbox (= 7.0.2.3)
|
|
148
|
+
actionmailer (= 7.0.2.3)
|
|
149
|
+
actionpack (= 7.0.2.3)
|
|
150
|
+
actiontext (= 7.0.2.3)
|
|
151
|
+
actionview (= 7.0.2.3)
|
|
152
|
+
activejob (= 7.0.2.3)
|
|
153
|
+
activemodel (= 7.0.2.3)
|
|
154
|
+
activerecord (= 7.0.2.3)
|
|
155
|
+
activestorage (= 7.0.2.3)
|
|
156
|
+
activesupport (= 7.0.2.3)
|
|
157
|
+
bundler (>= 1.15.0)
|
|
158
|
+
railties (= 7.0.2.3)
|
|
159
|
+
rails-dom-testing (2.0.3)
|
|
160
|
+
activesupport (>= 4.2.0)
|
|
161
|
+
nokogiri (>= 1.6)
|
|
162
|
+
rails-html-sanitizer (1.4.2)
|
|
163
|
+
loofah (~> 2.3)
|
|
164
|
+
railties (7.0.2.3)
|
|
165
|
+
actionpack (= 7.0.2.3)
|
|
166
|
+
activesupport (= 7.0.2.3)
|
|
167
|
+
method_source
|
|
168
|
+
rake (>= 12.2)
|
|
169
|
+
thor (~> 1.0)
|
|
170
|
+
zeitwerk (~> 2.5)
|
|
171
|
+
rainbow (3.1.1)
|
|
172
|
+
rake (13.0.6)
|
|
173
|
+
regexp_parser (2.3.0)
|
|
174
|
+
rexml (3.2.5)
|
|
175
|
+
rspec-core (3.11.0)
|
|
176
|
+
rspec-support (~> 3.11.0)
|
|
177
|
+
rspec-expectations (3.11.0)
|
|
178
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
179
|
+
rspec-support (~> 3.11.0)
|
|
180
|
+
rspec-mocks (3.11.1)
|
|
181
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
182
|
+
rspec-support (~> 3.11.0)
|
|
183
|
+
rspec-rails (5.1.1)
|
|
184
|
+
actionpack (>= 5.2)
|
|
185
|
+
activesupport (>= 5.2)
|
|
186
|
+
railties (>= 5.2)
|
|
187
|
+
rspec-core (~> 3.10)
|
|
188
|
+
rspec-expectations (~> 3.10)
|
|
189
|
+
rspec-mocks (~> 3.10)
|
|
190
|
+
rspec-support (~> 3.10)
|
|
191
|
+
rspec-support (3.11.0)
|
|
192
|
+
rubocop (1.28.1)
|
|
193
|
+
parallel (~> 1.10)
|
|
194
|
+
parser (>= 3.1.0.0)
|
|
195
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
196
|
+
regexp_parser (>= 1.8, < 3.0)
|
|
197
|
+
rexml
|
|
198
|
+
rubocop-ast (>= 1.17.0, < 2.0)
|
|
199
|
+
ruby-progressbar (~> 1.7)
|
|
200
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
|
201
|
+
rubocop-ast (1.17.0)
|
|
202
|
+
parser (>= 3.1.1.0)
|
|
203
|
+
ruby-progressbar (1.11.0)
|
|
204
|
+
sqlite3 (1.4.2)
|
|
205
|
+
strscan (3.0.1)
|
|
206
|
+
thor (1.2.1)
|
|
207
|
+
timeout (0.2.0)
|
|
208
|
+
tzinfo (2.0.4)
|
|
209
|
+
concurrent-ruby (~> 1.0)
|
|
210
|
+
unicode-display_width (2.1.0)
|
|
211
|
+
websocket-driver (0.7.5)
|
|
212
|
+
websocket-extensions (>= 0.1.0)
|
|
213
|
+
websocket-extensions (0.1.5)
|
|
214
|
+
xpath (3.2.0)
|
|
215
|
+
nokogiri (~> 1.8)
|
|
216
|
+
zeitwerk (2.5.4)
|
|
217
|
+
|
|
218
|
+
PLATFORMS
|
|
219
|
+
x86_64-linux
|
|
220
|
+
|
|
221
|
+
DEPENDENCIES
|
|
222
|
+
activestorage-delayed!
|
|
223
|
+
byebug
|
|
224
|
+
capybara
|
|
225
|
+
database_cleaner-active_record
|
|
226
|
+
factory_bot_rails
|
|
227
|
+
puma
|
|
228
|
+
rails (~> 7)
|
|
229
|
+
rspec-rails
|
|
230
|
+
rubocop
|
|
231
|
+
sqlite3
|
|
232
|
+
|
|
233
|
+
BUNDLED WITH
|
|
234
|
+
2.3.10
|
data/README.md
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
# Activestorage Delayed
|
|
2
2
|
|
|
3
|
-
ActiveStorage
|
|
4
|
-
This is a Ruby on Rails gem to upload activestorage files in background by saving them as base64 encoded in the database and be processed later.
|
|
3
|
+
ActiveStorage in Rails 6 and 7 does not support to upload files in background which in most cases delays the submit process and then makes the visitor get bored or receive a timeout error.
|
|
4
|
+
This is a Ruby on Rails gem to upload activestorage files in background by saving them as base64 encoded in the database (important for apps hosted in kubernetes) and be processed later.
|
|
5
|
+
|
|
6
|
+
## Features
|
|
7
|
+
- Upload files in background
|
|
8
|
+
- Ability to add new files instead of replacing the old ones when using using `has_many_attached`
|
|
9
|
+
- Ability to upload files with the original filename or a custom one
|
|
10
|
+
- Ability to preprocess the files before uploading them (Rails 7+)
|
|
11
|
+
Note: This gem assumes that the app has already configured activestorage.
|
|
5
12
|
|
|
6
13
|
## Installation
|
|
7
14
|
- Add this line to your application's Gemfile:
|
|
8
15
|
```ruby
|
|
9
|
-
gem 'activestorage-delayed'
|
|
16
|
+
gem 'activestorage-delayed', '>= 0.1.3'
|
|
10
17
|
```
|
|
11
18
|
- And then execute: `bundle install`
|
|
12
19
|
- Generate the migration: `rails g migration add_activestorage_delayed`
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
|
+
require_relative 'lib/activestorage-delayed/version'
|
|
6
|
+
|
|
7
|
+
Gem::Specification.new do |spec|
|
|
8
|
+
spec.name = 'activestorage-delayed'
|
|
9
|
+
spec.version = ActivestorageDelayed::VERSION
|
|
10
|
+
spec.authors = ['Owen Peredo Diaz']
|
|
11
|
+
spec.email = ['owenperedo@gmail.com']
|
|
12
|
+
spec.homepage = 'https://github.com/owen2345/activestorage-delayed'
|
|
13
|
+
spec.summary = 'Ruby on Rails gem to upload activestorage files in background'
|
|
14
|
+
spec.description = 'Ruby on Rails gem to upload activestorage files in background'
|
|
15
|
+
|
|
16
|
+
# spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
|
|
17
|
+
|
|
18
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
|
19
|
+
spec.metadata['source_code_uri'] = spec.homepage
|
|
20
|
+
spec.metadata['changelog_uri'] = spec.homepage
|
|
21
|
+
|
|
22
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do # rubocop:disable Style/ExpandPathArguments
|
|
23
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
|
24
|
+
f.match(%r{^(test|spec|features)/})
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
spec.require_paths = %w[lib]
|
|
28
|
+
|
|
29
|
+
spec.add_dependency 'activestorage'
|
|
30
|
+
spec.add_dependency 'rails'
|
|
31
|
+
end
|
data/bin/test
ADDED
data/db/test.sqlite3
ADDED
|
Binary file
|
data/docker-compose.yaml
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Ability to auto apply :default variant before uploading original image
|
|
4
|
+
module ActivetoragePreprocessDefaultVariation
|
|
5
|
+
def self.prepended(base)
|
|
6
|
+
base.extend(ClassMethods)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def upload_without_unfurling(io) # rubocop:disable Metrics/MethodLength
|
|
10
|
+
variant = attachments.first.try(:send, :variants)
|
|
11
|
+
default_variant = variant ? variant[:default] : nil
|
|
12
|
+
if default_variant && self.class.enabled_default_variant?
|
|
13
|
+
ActiveStorage::Variation.wrap(default_variant).transform(io) do |output|
|
|
14
|
+
unfurl output, identify: identify
|
|
15
|
+
save! if id.present? # update new unfurl information
|
|
16
|
+
super(output)
|
|
17
|
+
end
|
|
18
|
+
else
|
|
19
|
+
super(io)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
module ClassMethods
|
|
24
|
+
# To improve testing performance, we don't want to preprocess images in test environment
|
|
25
|
+
def enabled_default_variant?
|
|
26
|
+
!Rails.env.test?
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
ActiveStorage::Blob.prepend ActivetoragePreprocessDefaultVariation
|
|
@@ -13,8 +13,7 @@ module ActivestorageDelayed
|
|
|
13
13
|
return unless delayed_upload
|
|
14
14
|
|
|
15
15
|
remove_files
|
|
16
|
-
upload_photos
|
|
17
|
-
save_changes
|
|
16
|
+
save_changes if upload_photos
|
|
18
17
|
end
|
|
19
18
|
|
|
20
19
|
private
|
|
@@ -25,9 +24,11 @@ module ActivestorageDelayed
|
|
|
25
24
|
tmp_files_data.each do |file_data|
|
|
26
25
|
model.send(attr_name).attach(file_data.transform_keys(&:to_sym))
|
|
27
26
|
end
|
|
27
|
+
true
|
|
28
28
|
rescue => e # rubocop:disable Style/RescueStandardError
|
|
29
29
|
Rails.logger.error("********* #{self.class.name} -> Failed uploading files: #{e.message}. #{e.backtrace[0..20]}")
|
|
30
30
|
model.ast_delayed_on_error(attr_name, e)
|
|
31
|
+
false
|
|
31
32
|
end
|
|
32
33
|
|
|
33
34
|
def save_changes
|
|
File without changes
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activestorage-delayed
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Owen Peredo Diaz
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-04-
|
|
11
|
+
date: 2022-04-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activestorage
|
|
@@ -45,15 +45,33 @@ executables: []
|
|
|
45
45
|
extensions: []
|
|
46
46
|
extra_rdoc_files: []
|
|
47
47
|
files:
|
|
48
|
+
- ".github/workflows/release.yml"
|
|
49
|
+
- ".github/workflows/ruby.yml"
|
|
50
|
+
- ".gitignore"
|
|
51
|
+
- ".idea/.gitignore"
|
|
52
|
+
- ".idea/activestorage-delayed.iml"
|
|
53
|
+
- ".idea/misc.xml"
|
|
54
|
+
- ".idea/modules.xml"
|
|
55
|
+
- ".idea/vcs.xml"
|
|
56
|
+
- ".rspec"
|
|
57
|
+
- ".rubocop.yml"
|
|
58
|
+
- Dockerfile
|
|
59
|
+
- Gemfile
|
|
60
|
+
- Gemfile.lock
|
|
48
61
|
- README.md
|
|
49
62
|
- Rakefile
|
|
63
|
+
- activestorage-delayed.gemspec
|
|
64
|
+
- bin/test
|
|
65
|
+
- db/test.sqlite3
|
|
66
|
+
- docker-compose.yaml
|
|
67
|
+
- initializers/upload_default_variation.rb
|
|
68
|
+
- lib/activestorage-delayed.rb
|
|
50
69
|
- lib/activestorage-delayed/delayed_concern.rb
|
|
51
70
|
- lib/activestorage-delayed/delayed_uploader.rb
|
|
52
71
|
- lib/activestorage-delayed/delayed_uploader_job.rb
|
|
53
72
|
- lib/activestorage-delayed/models/delayed_upload.rb
|
|
54
73
|
- lib/activestorage-delayed/railtie.rb
|
|
55
74
|
- lib/activestorage-delayed/version.rb
|
|
56
|
-
- lib/activestorage_delayed.rb
|
|
57
75
|
homepage: https://github.com/owen2345/activestorage-delayed
|
|
58
76
|
licenses: []
|
|
59
77
|
metadata:
|