batch_processor 0.2.6 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1046 -11
  3. data/lib/batch_processor/batch/controller.rb +1 -1
  4. data/lib/batch_processor/batch/core.rb +1 -1
  5. data/lib/batch_processor/batch/job.rb +1 -1
  6. data/lib/batch_processor/batch/job_controller.rb +1 -1
  7. data/lib/batch_processor/batch/predicates.rb +3 -1
  8. data/lib/batch_processor/batch/processor.rb +16 -3
  9. data/lib/batch_processor/batch_base.rb +1 -0
  10. data/lib/batch_processor/batch_details.rb +1 -1
  11. data/lib/batch_processor/batch_job.rb +3 -1
  12. data/lib/batch_processor/collection.rb +1 -0
  13. data/lib/batch_processor/processor/execute.rb +1 -1
  14. data/lib/batch_processor/processor/process.rb +1 -1
  15. data/lib/batch_processor/processor_base.rb +1 -0
  16. data/lib/batch_processor/processors/parallel.rb +1 -0
  17. data/lib/batch_processor/processors/sequential.rb +1 -0
  18. data/lib/batch_processor/rspec/custom_matchers/set_processor_option.rb +1 -1
  19. data/lib/batch_processor/rspec/custom_matchers/use_default_job_class.rb +1 -1
  20. data/lib/batch_processor/rspec/custom_matchers/use_default_processor.rb +1 -1
  21. data/lib/batch_processor/rspec/custom_matchers/use_job_class.rb +1 -1
  22. data/lib/batch_processor/rspec/custom_matchers/use_parallel_processor.rb +1 -1
  23. data/lib/batch_processor/rspec/custom_matchers/use_sequential_processor.rb +1 -1
  24. data/lib/batch_processor/version.rb +1 -1
  25. data/lib/generators/batch_processor/USAGE +9 -0
  26. data/lib/generators/batch_processor/application_batch/USAGE +9 -0
  27. data/lib/generators/batch_processor/application_batch/application_batch_generator.rb +15 -0
  28. data/lib/generators/batch_processor/application_batch/templates/application_batch.rb +3 -0
  29. data/lib/generators/batch_processor/application_job/USAGE +0 -0
  30. data/lib/generators/batch_processor/application_job/application_job_generator.rb +15 -0
  31. data/lib/generators/batch_processor/application_job/templates/application_job.rb +4 -0
  32. data/lib/generators/batch_processor/batch_processor_generator.rb +15 -0
  33. data/lib/generators/batch_processor/install/USAGE +9 -0
  34. data/lib/generators/batch_processor/install/install_generator.rb +12 -0
  35. data/lib/generators/batch_processor/templates/batch.rb.erb +21 -0
  36. data/lib/generators/rspec/application_batch/USAGE +9 -0
  37. data/lib/generators/rspec/application_batch/application_batch_generator.rb +14 -0
  38. data/lib/generators/rspec/application_batch/templates/application_batch_spec.rb +8 -0
  39. data/lib/generators/rspec/application_job/USAGE +9 -0
  40. data/lib/generators/rspec/application_job/application_job_generator.rb +14 -0
  41. data/lib/generators/rspec/application_job/templates/application_job_spec.rb +8 -0
  42. data/lib/generators/rspec/batch_processor/USAGE +8 -0
  43. data/lib/generators/rspec/batch_processor/batch_processor_generator.rb +13 -0
  44. data/lib/generators/rspec/batch_processor/templates/batch_spec.rb.erb +29 -0
  45. metadata +22 -2
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rails_helper"
4
+
5
+ RSpec.describe ApplicationJob, type: :job do
6
+ it { is_expected.to inherit_from BatchProcessor::BatchJob }
7
+ end
8
+
@@ -0,0 +1,8 @@
1
+ Description:
2
+ Stub a Batch test.
3
+
4
+ Example:
5
+ `rails generate rspec:batch_processor foo`
6
+
7
+ Generates:
8
+ Test: spec/batches/foo_batch_spec.rb
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Rspec
4
+ module Generators
5
+ class BatchProcessorGenerator < Rails::Generators::NamedBase
6
+ source_root File.expand_path("templates", __dir__)
7
+
8
+ def create_spec_file
9
+ template "batch_spec.rb.erb", File.join("spec/batches/", class_path, "#{file_name}_batch_spec.rb")
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rails_helper"
4
+
5
+ RSpec.describe <%= class_name %>Batch, type: :batch do
6
+ subject { described_class }
7
+
8
+ it { is_expected.to inherit_from BatchProcessor::BatchBase }
9
+
10
+ # it { is_expected.to use_sequential_processor }
11
+ # it { is_expected.to use_parallel_processor }
12
+
13
+ # it { is_expected.to be_allow_empty }
14
+
15
+ # it { is_expected.to use_default_job_class }
16
+ # it { is_expected.to use_job_class OtherJob }
17
+
18
+ # it { is_expected.to set_processor_option :continue_after_exception, true }
19
+ # it { is_expected.to set_processor_option :sorted, true }
20
+ # it { is_expected.not_to be_allow_empty }
21
+
22
+ describe <%= class_name %>Batch::Collection, type: :batch_collection do
23
+ subject { described_class.new }
24
+
25
+ it { is_expected.to inherit_from BatchProcessor::BatchBase::BatchCollection }
26
+ # it { is_expected.to define_argument :arg, allow_nil: false }
27
+ # it { is_expected.to define_option :opt, default: 3 }
28
+ end
29
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: batch_processor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Garside
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-27 00:00:00.000000000 Z
11
+ date: 2019-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activejob
@@ -262,6 +262,26 @@ files:
262
262
  - lib/batch_processor/rspec/shoulda_matcher_helper.rb
263
263
  - lib/batch_processor/spec_helper.rb
264
264
  - lib/batch_processor/version.rb
265
+ - lib/generators/batch_processor/USAGE
266
+ - lib/generators/batch_processor/application_batch/USAGE
267
+ - lib/generators/batch_processor/application_batch/application_batch_generator.rb
268
+ - lib/generators/batch_processor/application_batch/templates/application_batch.rb
269
+ - lib/generators/batch_processor/application_job/USAGE
270
+ - lib/generators/batch_processor/application_job/application_job_generator.rb
271
+ - lib/generators/batch_processor/application_job/templates/application_job.rb
272
+ - lib/generators/batch_processor/batch_processor_generator.rb
273
+ - lib/generators/batch_processor/install/USAGE
274
+ - lib/generators/batch_processor/install/install_generator.rb
275
+ - lib/generators/batch_processor/templates/batch.rb.erb
276
+ - lib/generators/rspec/application_batch/USAGE
277
+ - lib/generators/rspec/application_batch/application_batch_generator.rb
278
+ - lib/generators/rspec/application_batch/templates/application_batch_spec.rb
279
+ - lib/generators/rspec/application_job/USAGE
280
+ - lib/generators/rspec/application_job/application_job_generator.rb
281
+ - lib/generators/rspec/application_job/templates/application_job_spec.rb
282
+ - lib/generators/rspec/batch_processor/USAGE
283
+ - lib/generators/rspec/batch_processor/batch_processor_generator.rb
284
+ - lib/generators/rspec/batch_processor/templates/batch_spec.rb.erb
265
285
  homepage: https://github.com/Freshly/batch_processor
266
286
  licenses:
267
287
  - MIT