progress_job_mongoid 0.1.5 → 0.1.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4b2764293a5ae97cbdf2ef371354865a371a83009a96b2f0dfc041cfb637c021
4
- data.tar.gz: ccf194fae8132ca6251da0248bc1915cf68e827ff5a5c41a230a27a89c621980
3
+ metadata.gz: d48e3252804b7d468dea6823610cc7ea4696a1c9b0e2c96d73a54badd31101ea
4
+ data.tar.gz: 1527041b68c8160ad1a00d0ed5ab5e1d130a901f636febf68fa867a3a089f47f
5
5
  SHA512:
6
- metadata.gz: cd883936afa4204dbc509fefa2e9dc93639598da8b56f8165d816f62e9dea91dc8d62eaea3ae9ef4e46d3c3ff3bf04de1aa06f6a8ab20bd15eb3b22b0f856122
7
- data.tar.gz: d3f2c86d7751cc4fc3342f87a8ae626a010a420427686dbbc248f45dd0d858a65832cc23f6fc49358cc992bbd7b29463ef858ac1d4f0893507bd57eee24ea580
6
+ metadata.gz: 8d528b2fcf7cd17594cff25ab22ac6dfbac25460f5a9f9600e7f4493cc44a3dde45cc44771d67b8a00f98215ac62923c64957989162e94be73a3c51a55795d9a
7
+ data.tar.gz: e62c10706892f578511bcd37628dbc564f5b9ba67f6330aa9969c37d05e2dfe5954cc34f4e5c793de2cc552861431b367518396fe5be31a76c05694a8efc5a59
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # ProgressJobMongoid
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/progress_job_mongoid`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ This gem adds a couple of columns to delayed job table, and gives you a basic class for working with progress with support for delayed_job_mongoid.
6
4
 
7
5
  ## Installation
8
6
 
@@ -16,28 +14,38 @@ And then execute:
16
14
 
17
15
  $ bundle install
18
16
 
19
- Or install it yourself as:
17
+ Run generator (run delayed job generators first):
20
18
 
21
- $ gem install progress_job_mongoid
19
+ $ rails generate progress_job_mongoid:install
22
20
 
23
21
  ## Usage
24
22
 
25
- TODO: Write usage instructions here
23
+ Create a new class that extends ProgressJobMongoid::Base
26
24
 
27
- ## Development
25
+ ```
26
+ class NewJob < ProgressJobMongoid::Base
28
27
 
29
- After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
28
+ def perform
29
+ # some actions
30
+ end
30
31
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+ end
33
+ ```
32
34
 
33
- ## Contributing
35
+ Inside perform method you can use:
34
36
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/progress_job_mongoid. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/progress_job_mongoid/blob/master/CODE_OF_CONDUCT.md).
37
+ ```
38
+ update_progress(step: 10) # default step is 1
39
+ update_stage('name of stage')
40
+ update_stage_progress('name of stage', step: 11)
41
+ update_progress_max(progress_max)
42
+ ```
43
+ methods to update the job progress.
36
44
 
37
- ## License
45
+ To create a new job use Delayed job enqueue method, and pass the progress_max value
38
46
 
39
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
47
+ $ job = Delayed::Job.enqueue NewJob.new(progress_max: 100) # default progress_max is 100
40
48
 
41
- ## Code of Conduct
49
+ There is also a controller which returns the delayed job with calculated percentage
42
50
 
43
- Everyone interacting in the ProgressJobMongoid project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/progress_job_mongoid/blob/master/CODE_OF_CONDUCT.md).
51
+ $ GET 'progress-jobs/:job_id/'
@@ -9,7 +9,7 @@ module Delayed
9
9
  include ::Mongoid::Timestamps
10
10
 
11
11
  field :progress_stage, type: String, default: ''
12
- field :progress_current, type: Integer
12
+ field :progress_current, type: Integer, default: 0
13
13
  field :progress_max, type: Integer, default: 100
14
14
  end
15
15
  end
@@ -1,3 +1,3 @@
1
1
  module ProgressJobMongoid
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.9"
3
3
  end
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
8
8
 
9
9
  spec.summary = %q{Delayed jobs with progress with support for mongoid.}
10
10
  spec.description = %q{Add progress feature to delayed jobs}
11
- spec.homepage = "https://github.com/wbgs/progress_job_mongoid"
11
+ spec.homepage = "https://github.com/priyank1810/progress_job_mongoid"
12
12
  spec.license = "MIT"
13
13
  spec.required_ruby_version = ">= 2.6.0"
14
14
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: progress_job_mongoid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Priyank Abhani
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-10 00:00:00.000000000 Z
11
+ date: 2022-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: delayed_job_mongoid
@@ -46,13 +46,13 @@ extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
48
  - README.md
49
- - lib/generators/progress_job_mongoid/install_generator.rb
49
+ - lib/generators/install_generator.rb
50
50
  - lib/progress_job_mongoid.rb
51
51
  - lib/progress_job_mongoid/base.rb
52
52
  - lib/progress_job_mongoid/mongoid.rb
53
53
  - lib/progress_job_mongoid/version.rb
54
54
  - progress_job_mongoid.gemspec
55
- homepage: https://github.com/wbgs/progress_job_mongoid
55
+ homepage: https://github.com/priyank1810/progress_job_mongoid
56
56
  licenses:
57
57
  - MIT
58
58
  metadata: {}