progress_job_mongoid 0.1.5 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4b2764293a5ae97cbdf2ef371354865a371a83009a96b2f0dfc041cfb637c021
4
- data.tar.gz: ccf194fae8132ca6251da0248bc1915cf68e827ff5a5c41a230a27a89c621980
3
+ metadata.gz: 8654f41d67f0ce605f092d39f59e7b51310035962a643bdda25145a5b4ac9cff
4
+ data.tar.gz: ad21678c57997320cf7350f398c37eb38bb8d0f0d759443ba110cc6706345f33
5
5
  SHA512:
6
- metadata.gz: cd883936afa4204dbc509fefa2e9dc93639598da8b56f8165d816f62e9dea91dc8d62eaea3ae9ef4e46d3c3ff3bf04de1aa06f6a8ab20bd15eb3b22b0f856122
7
- data.tar.gz: d3f2c86d7751cc4fc3342f87a8ae626a010a420427686dbbc248f45dd0d858a65832cc23f6fc49358cc992bbd7b29463ef858ac1d4f0893507bd57eee24ea580
6
+ metadata.gz: 974af13784eb9e1626dd7c269b92c61ecaf8e7c23776aab36a7d971fe720cdc4b0ef32c2a9a7d7e066893749858373582c0a666fd1f1d8190bfc4162a3488db3
7
+ data.tar.gz: b93ec7f7126e0288639c08c213ca84e71b5eb9cfe1ab92217f7716697d3b74f8b9a508fd53449c0036ea272db60231ae1532d636c6d3d9e036e0a3855492479f
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.7"
3
3
  end
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.7
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-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: delayed_job_mongoid
@@ -46,7 +46,7 @@ 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