resque-stages 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +15 -0
  3. data/.rspec +3 -0
  4. data/.rubocop.yml +103 -0
  5. data/.rubocop_todo.yml +34 -0
  6. data/.ruby-version +1 -0
  7. data/.travis.yml +6 -0
  8. data/CODE_OF_CONDUCT.md +74 -0
  9. data/Gemfile +9 -0
  10. data/Gemfile.lock +172 -0
  11. data/LICENSE.txt +21 -0
  12. data/README.md +250 -0
  13. data/Rakefile +8 -0
  14. data/bin/console +16 -0
  15. data/bin/setup +8 -0
  16. data/lib/resque-stages.rb +11 -0
  17. data/lib/resque/plugins/stages.rb +110 -0
  18. data/lib/resque/plugins/stages/cleaner.rb +36 -0
  19. data/lib/resque/plugins/stages/redis_access.rb +16 -0
  20. data/lib/resque/plugins/stages/staged_group.rb +181 -0
  21. data/lib/resque/plugins/stages/staged_group_list.rb +79 -0
  22. data/lib/resque/plugins/stages/staged_group_stage.rb +275 -0
  23. data/lib/resque/plugins/stages/staged_job.rb +271 -0
  24. data/lib/resque/plugins/stages/version.rb +9 -0
  25. data/lib/resque/server/public/stages.css +56 -0
  26. data/lib/resque/server/views/_group_stages_list_pagination.erb +67 -0
  27. data/lib/resque/server/views/_group_stages_list_table.erb +25 -0
  28. data/lib/resque/server/views/_stage_job_list_pagination.erb +72 -0
  29. data/lib/resque/server/views/_stage_job_list_table.erb +46 -0
  30. data/lib/resque/server/views/_staged_group_list_pagination.erb +67 -0
  31. data/lib/resque/server/views/_staged_group_list_table.erb +44 -0
  32. data/lib/resque/server/views/group_stages_list.erb +58 -0
  33. data/lib/resque/server/views/groups.erb +40 -0
  34. data/lib/resque/server/views/job_details.erb +91 -0
  35. data/lib/resque/server/views/stage.erb +64 -0
  36. data/lib/resque/stages_server.rb +240 -0
  37. data/read_me/groups_list.png +0 -0
  38. data/read_me/job.png +0 -0
  39. data/read_me/stage.png +0 -0
  40. data/read_me/stages.png +0 -0
  41. data/resque-stages.gemspec +49 -0
  42. data/spec/rails_helper.rb +40 -0
  43. data/spec/resque/plugins/stages/cleaner_spec.rb +82 -0
  44. data/spec/resque/plugins/stages/staged_group_list_spec.rb +96 -0
  45. data/spec/resque/plugins/stages/staged_group_spec.rb +226 -0
  46. data/spec/resque/plugins/stages/staged_group_stage_spec.rb +293 -0
  47. data/spec/resque/plugins/stages/staged_job_spec.rb +324 -0
  48. data/spec/resque/plugins/stages_spec.rb +369 -0
  49. data/spec/resque/server/public/stages.css_spec.rb +18 -0
  50. data/spec/resque/server/views/group_stages_list.erb_spec.rb +67 -0
  51. data/spec/resque/server/views/groups.erb_spec.rb +81 -0
  52. data/spec/resque/server/views/job_details.erb_spec.rb +100 -0
  53. data/spec/resque/server/views/stage.erb_spec.rb +68 -0
  54. data/spec/spec_helper.rb +104 -0
  55. data/spec/support/01_utils/fake_logger.rb +7 -0
  56. data/spec/support/config/redis-auth.yml +12 -0
  57. data/spec/support/fake_logger.rb +7 -0
  58. data/spec/support/jobs/basic_job.rb +17 -0
  59. data/spec/support/jobs/compressed_job.rb +18 -0
  60. data/spec/support/jobs/retry_job.rb +21 -0
  61. data/spec/support/purge_all.rb +15 -0
  62. metadata +297 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 3270c6b1879c50fc9eb7ad598942fdccc4db2f4a2af73155b851e6bb1a51961d
4
+ data.tar.gz: ad0316995927023d21b80636f1748271c5fc7715cf0ac107b3147587dee80783
5
+ SHA512:
6
+ metadata.gz: 28a7354bbe2445749049307ff267efdb6e7203585a0944574f0c9c85a6a140cd5721960bd0f53361e966c139498b9a251c484dc25d8bc4b3275d533f531caf32
7
+ data.tar.gz: 618d4ee0a61f7fd4161d63dd9b8635b4d788e30bd26b63e7e86a45e11e53bb725e7c5dca7f91a16bd3da7783eaf5dc8236cfeb8bf9fcce9a1cb2696c37ad3616
@@ -0,0 +1,15 @@
1
+ /.idea/
2
+ /.bundle/
3
+ /.yardoc
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /log/
8
+ /pkg/
9
+ /spec/reports/
10
+ /tmp/
11
+ /cornucopia_report/
12
+
13
+ # rspec failure tracking
14
+ log/.rspec_status
15
+ spec/examples.txt
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,103 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ AllCops:
4
+ TargetRubyVersion: 2.7
5
+
6
+ # https://github.com/bbatsov/rubocop/blob/master/config/default.yml
7
+
8
+ # This configuration was generated by
9
+ # `rubocop --auto-gen-config`
10
+ # on 2016-09-05 16:35:28 -0700 using RuboCop version 0.39.0.
11
+ # The point is for the user to remove these configuration records
12
+ # one by one as the offenses are removed from the code base.
13
+ # Note that changes in the inspected code, or installation of new
14
+ # versions of RuboCop, may require this file to be generated again.
15
+
16
+ # Offense count: 23
17
+ # Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
18
+ # URISchemes: http, https
19
+ Layout/LineLength:
20
+ Max: 150
21
+
22
+ Layout/DotPosition:
23
+ EnforcedStyle: trailing
24
+
25
+ Layout/MultilineMethodCallIndentation:
26
+ Enabled: false
27
+
28
+ Layout/MultilineOperationIndentation:
29
+ Enabled: false
30
+
31
+ Style/StringLiterals:
32
+ # Enabled: false
33
+ EnforcedStyle: double_quotes
34
+ SupportedStyles:
35
+ - single_quotes
36
+ - double_quotes
37
+ # If true, strings which span multiple lines using \ for continuation must
38
+ # use the same type of quotes on each line.
39
+ ConsistentQuotesInMultiline: false
40
+
41
+ Style/StringLiteralsInInterpolation:
42
+ EnforcedStyle: double_quotes
43
+ SupportedStyles:
44
+ - single_quotes
45
+ - double_quotes
46
+
47
+ Layout/HashAlignment:
48
+ Description: "Align the elements of a hash literal if they span more than one line."
49
+ Enabled: true
50
+ EnforcedColonStyle: table
51
+ EnforcedHashRocketStyle: table
52
+ EnforcedLastArgumentHashStyle: always_inspect
53
+ SupportedColonStyles:
54
+ - key
55
+ - separator
56
+ - table
57
+ SupportedHashRocketStyles:
58
+ - key
59
+ - separator
60
+ - table
61
+ SupportedLastArgumentHashStyles:
62
+ - always_inspect
63
+ - always_ignore
64
+ - ignore_implicit
65
+ - ignore_explicit
66
+ VersionAdded: "0.49"
67
+
68
+ # Indentation of `when`.
69
+ Layout/CaseIndentation:
70
+ EnforcedStyle: case
71
+ SupportedStyles:
72
+ - case
73
+ - end
74
+ IndentOneStep: true
75
+ # By default, the indentation width from Style/IndentationWidth is used
76
+ # But it can be overridden by setting this parameter
77
+ # This only matters if IndentOneStep is true
78
+ IndentationWidth: ~
79
+
80
+ Metrics/MethodLength:
81
+ CountComments: false # count full line comments?
82
+ Max: 15
83
+
84
+ Metrics/BlockLength:
85
+ Exclude:
86
+ - "spec/**/*.rb"
87
+ - "*.gemspec"
88
+
89
+ Lint/RaiseException:
90
+ Enabled: true
91
+ Lint/StructNewOverride:
92
+ Enabled: true
93
+ Style/HashEachMethods:
94
+ Enabled: true
95
+ Style/HashTransformKeys:
96
+ Enabled: true
97
+ Style/HashTransformValues:
98
+ Enabled: true
99
+ Metrics/ClassLength:
100
+ CountComments: false
101
+ Description: "Avoid classes longer than 100 lines of code."
102
+ Enabled: true
103
+ Max: 150
@@ -0,0 +1,34 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2016-09-05 17:31:01 -0700 using RuboCop version 0.39.0.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 1
10
+ Style/Documentation:
11
+ Exclude:
12
+ - "spec/**/*"
13
+ - "test/**/*"
14
+
15
+ # Offense count: 1
16
+ # Cop supports --auto-correct.
17
+ Style/MutableConstant:
18
+ Exclude:
19
+ - "lib/resque/stages/version.rb"
20
+
21
+ Naming/FileName:
22
+ Exclude:
23
+ - "lib/resque-stages.rb"
24
+
25
+ #Metrics/ModuleLength:
26
+ # Exclude:
27
+ # - "lib/resque/job_history_server.rb"
28
+ #
29
+ #Metrics/ClassLength:
30
+ # Exclude:
31
+ # - "spec/support/job_summary_builder.rb"
32
+ # - "lib/resque/plugins/job_history/job.rb"
33
+ # - "lib/resque/plugins/job_history/cleaner.rb"
34
+ # - "lib/resque/plugins/job_history/history_details.rb"
@@ -0,0 +1 @@
1
+ 2.7.1
@@ -0,0 +1,6 @@
1
+ ---
2
+ language: ruby
3
+ cache: bundler
4
+ rvm:
5
+ - 2.6.3
6
+ before_install: gem install bundler -v 2.1.4
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at RealNobody1@cox.net. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [https://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: https://contributor-covenant.org
74
+ [version]: https://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in resque-stages.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 12.0"
9
+ gem "rspec", "~> 3.0"
@@ -0,0 +1,172 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ resque-stages (0.0.1)
5
+ redis
6
+ redis-namespace
7
+ resque
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ actionpack (5.2.4.2)
13
+ actionview (= 5.2.4.2)
14
+ activesupport (= 5.2.4.2)
15
+ rack (~> 2.0, >= 2.0.8)
16
+ rack-test (>= 0.6.3)
17
+ rails-dom-testing (~> 2.0)
18
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
19
+ actionview (5.2.4.2)
20
+ activesupport (= 5.2.4.2)
21
+ builder (~> 3.1)
22
+ erubi (~> 1.4)
23
+ rails-dom-testing (~> 2.0)
24
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
25
+ activesupport (5.2.4.2)
26
+ concurrent-ruby (~> 1.0, >= 1.0.2)
27
+ i18n (>= 0.7, < 2)
28
+ minitest (~> 5.1)
29
+ tzinfo (~> 1.1)
30
+ ast (2.4.0)
31
+ builder (3.2.4)
32
+ concurrent-ruby (1.1.6)
33
+ cornucopia (0.1.56)
34
+ activesupport (> 4.0, < 6.0)
35
+ crass (1.0.6)
36
+ diff-lcs (1.3)
37
+ docile (1.3.2)
38
+ erubi (1.9.0)
39
+ et-orbi (1.2.4)
40
+ tzinfo
41
+ faker (2.11.0)
42
+ i18n (>= 1.6, < 2)
43
+ fugit (1.3.4)
44
+ et-orbi (~> 1.1, >= 1.1.8)
45
+ raabro (~> 1.1)
46
+ gem-release (2.1.1)
47
+ i18n (1.8.2)
48
+ concurrent-ruby (~> 1.0)
49
+ jaro_winkler (1.5.4)
50
+ loofah (2.7.0)
51
+ crass (~> 1.0.2)
52
+ nokogiri (>= 1.5.9)
53
+ method_source (1.0.0)
54
+ mini_portile2 (2.4.0)
55
+ minitest (5.14.0)
56
+ mono_logger (1.1.0)
57
+ multi_json (1.14.1)
58
+ mustermann (1.1.1)
59
+ ruby2_keywords (~> 0.0.1)
60
+ nokogiri (1.10.10)
61
+ mini_portile2 (~> 2.4.0)
62
+ parallel (1.19.1)
63
+ parser (2.7.1.1)
64
+ ast (~> 2.4.0)
65
+ raabro (1.1.6)
66
+ rack (2.2.2)
67
+ rack-protection (2.0.8.1)
68
+ rack
69
+ rack-test (1.1.0)
70
+ rack (>= 1.0, < 3)
71
+ rails-dom-testing (2.0.3)
72
+ activesupport (>= 4.2.0)
73
+ nokogiri (>= 1.6)
74
+ rails-html-sanitizer (1.3.0)
75
+ loofah (~> 2.3)
76
+ railties (5.2.4.2)
77
+ actionpack (= 5.2.4.2)
78
+ activesupport (= 5.2.4.2)
79
+ method_source
80
+ rake (>= 0.8.7)
81
+ thor (>= 0.19.0, < 2.0)
82
+ rainbow (3.0.0)
83
+ rake (12.3.2)
84
+ redis (4.1.3)
85
+ redis-namespace (1.7.0)
86
+ redis (>= 3.0.4)
87
+ resque (2.0.0)
88
+ mono_logger (~> 1.0)
89
+ multi_json (~> 1.0)
90
+ redis-namespace (~> 1.6)
91
+ sinatra (>= 0.9.2)
92
+ vegas (~> 0.1.2)
93
+ resque-compressible (0.0.1)
94
+ resque-retry (1.7.3)
95
+ resque (>= 1.25, < 3.0)
96
+ resque-scheduler (~> 4.0)
97
+ resque-scheduler (4.4.0)
98
+ mono_logger (~> 1.0)
99
+ redis (>= 3.3)
100
+ resque (>= 1.26)
101
+ rufus-scheduler (~> 3.2)
102
+ rexml (3.2.4)
103
+ rspec (3.9.0)
104
+ rspec-core (~> 3.9.0)
105
+ rspec-expectations (~> 3.9.0)
106
+ rspec-mocks (~> 3.9.0)
107
+ rspec-core (3.9.1)
108
+ rspec-support (~> 3.9.1)
109
+ rspec-expectations (3.9.1)
110
+ diff-lcs (>= 1.2.0, < 2.0)
111
+ rspec-support (~> 3.9.0)
112
+ rspec-mocks (3.9.1)
113
+ diff-lcs (>= 1.2.0, < 2.0)
114
+ rspec-support (~> 3.9.0)
115
+ rspec-rails (4.0.1)
116
+ actionpack (>= 4.2)
117
+ activesupport (>= 4.2)
118
+ railties (>= 4.2)
119
+ rspec-core (~> 3.9)
120
+ rspec-expectations (~> 3.9)
121
+ rspec-mocks (~> 3.9)
122
+ rspec-support (~> 3.9)
123
+ rspec-support (3.9.2)
124
+ rubocop (0.82.0)
125
+ jaro_winkler (~> 1.5.1)
126
+ parallel (~> 1.10)
127
+ parser (>= 2.7.0.1)
128
+ rainbow (>= 2.2.2, < 4.0)
129
+ rexml
130
+ ruby-progressbar (~> 1.7)
131
+ unicode-display_width (>= 1.4.0, < 2.0)
132
+ ruby-progressbar (1.10.1)
133
+ ruby2_keywords (0.0.2)
134
+ rufus-scheduler (3.6.0)
135
+ fugit (~> 1.1, >= 1.1.6)
136
+ simplecov (0.18.5)
137
+ docile (~> 1.1)
138
+ simplecov-html (~> 0.11)
139
+ simplecov-html (0.12.2)
140
+ sinatra (2.0.8.1)
141
+ mustermann (~> 1.0)
142
+ rack (~> 2.0)
143
+ rack-protection (= 2.0.8.1)
144
+ tilt (~> 2.0)
145
+ thor (1.0.1)
146
+ thread_safe (0.3.6)
147
+ tilt (2.0.10)
148
+ tzinfo (1.2.7)
149
+ thread_safe (~> 0.1)
150
+ unicode-display_width (1.7.0)
151
+ vegas (0.1.11)
152
+ rack (>= 1.0.0)
153
+
154
+ PLATFORMS
155
+ ruby
156
+
157
+ DEPENDENCIES
158
+ activesupport
159
+ cornucopia
160
+ faker
161
+ gem-release
162
+ rake (~> 12.0)
163
+ resque-compressible
164
+ resque-retry
165
+ resque-stages!
166
+ rspec (~> 3.0)
167
+ rspec-rails (> 3.9.1)
168
+ rubocop
169
+ simplecov
170
+
171
+ BUNDLED WITH
172
+ 2.1.4
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020 RealNobody
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.