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.
- checksums.yaml +4 -4
- data/README.md +1046 -11
- data/lib/batch_processor/batch/controller.rb +1 -1
- data/lib/batch_processor/batch/core.rb +1 -1
- data/lib/batch_processor/batch/job.rb +1 -1
- data/lib/batch_processor/batch/job_controller.rb +1 -1
- data/lib/batch_processor/batch/predicates.rb +3 -1
- data/lib/batch_processor/batch/processor.rb +16 -3
- data/lib/batch_processor/batch_base.rb +1 -0
- data/lib/batch_processor/batch_details.rb +1 -1
- data/lib/batch_processor/batch_job.rb +3 -1
- data/lib/batch_processor/collection.rb +1 -0
- data/lib/batch_processor/processor/execute.rb +1 -1
- data/lib/batch_processor/processor/process.rb +1 -1
- data/lib/batch_processor/processor_base.rb +1 -0
- data/lib/batch_processor/processors/parallel.rb +1 -0
- data/lib/batch_processor/processors/sequential.rb +1 -0
- data/lib/batch_processor/rspec/custom_matchers/set_processor_option.rb +1 -1
- data/lib/batch_processor/rspec/custom_matchers/use_default_job_class.rb +1 -1
- data/lib/batch_processor/rspec/custom_matchers/use_default_processor.rb +1 -1
- data/lib/batch_processor/rspec/custom_matchers/use_job_class.rb +1 -1
- data/lib/batch_processor/rspec/custom_matchers/use_parallel_processor.rb +1 -1
- data/lib/batch_processor/rspec/custom_matchers/use_sequential_processor.rb +1 -1
- data/lib/batch_processor/version.rb +1 -1
- data/lib/generators/batch_processor/USAGE +9 -0
- data/lib/generators/batch_processor/application_batch/USAGE +9 -0
- data/lib/generators/batch_processor/application_batch/application_batch_generator.rb +15 -0
- data/lib/generators/batch_processor/application_batch/templates/application_batch.rb +3 -0
- data/lib/generators/batch_processor/application_job/USAGE +0 -0
- data/lib/generators/batch_processor/application_job/application_job_generator.rb +15 -0
- data/lib/generators/batch_processor/application_job/templates/application_job.rb +4 -0
- data/lib/generators/batch_processor/batch_processor_generator.rb +15 -0
- data/lib/generators/batch_processor/install/USAGE +9 -0
- data/lib/generators/batch_processor/install/install_generator.rb +12 -0
- data/lib/generators/batch_processor/templates/batch.rb.erb +21 -0
- data/lib/generators/rspec/application_batch/USAGE +9 -0
- data/lib/generators/rspec/application_batch/application_batch_generator.rb +14 -0
- data/lib/generators/rspec/application_batch/templates/application_batch_spec.rb +8 -0
- data/lib/generators/rspec/application_job/USAGE +9 -0
- data/lib/generators/rspec/application_job/application_job_generator.rb +14 -0
- data/lib/generators/rspec/application_job/templates/application_job_spec.rb +8 -0
- data/lib/generators/rspec/batch_processor/USAGE +8 -0
- data/lib/generators/rspec/batch_processor/batch_processor_generator.rb +13 -0
- data/lib/generators/rspec/batch_processor/templates/batch_spec.rb.erb +29 -0
- metadata +22 -2
@@ -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.
|
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-
|
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
|