delayed_cron_job 0.7.1 → 0.7.2
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 +4 -4
- data/{LICENSE.txt → LICENSE} +1 -1
- data/README.md +9 -2
- data/lib/delayed_cron_job.rb +8 -0
- data/lib/delayed_cron_job/cronline.rb +1 -1
- data/lib/delayed_cron_job/version.rb +1 -1
- data/lib/generators/delayed_job/cron_generator.rb +13 -2
- data/lib/generators/delayed_job/templates/cron_migration.rb +2 -2
- metadata +4 -4
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 2b6628291d42c1bc4beef0cb884fb06474d5fea7
         | 
| 4 | 
            +
              data.tar.gz: 3676a138edd3bece7b144579d4c013e0311b40bb
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 3b4856da97ea1a3f57d085f4df9bace1322d6d02ebb7835a50ddf64c469bbcd30c15a93f80d906a78955b6e6e743f5ccf2b02f3f7628245e410e5b377f8c33d9
         | 
| 7 | 
            +
              data.tar.gz: a8fb3f19c7096e2d800bef4a7824e6f8d7e28ea420eae2764664ca28f2c6c7b9729d1bbaa7957740a7277373a43d546f244d42d871041e4103c57dbe6ecf06dd
         | 
    
        data/{LICENSE.txt → LICENSE}
    RENAMED
    
    
    
        data/README.md
    CHANGED
    
    | @@ -1,11 +1,13 @@ | |
| 1 1 | 
             
            # Delayed::Cron::Job
         | 
| 2 2 |  | 
| 3 | 
            +
            {<img src="https://secure.travis-ci.org/codez/delayed_cron_job.png" />}[http://travis-ci.org/codez/delayed_cron_job]
         | 
| 4 | 
            +
             | 
| 3 5 | 
             
            Delayed::Cron::Job is an extension to Delayed::Job that allows you to set
         | 
| 4 6 | 
             
            cron expressions for your jobs to run repeatedly.
         | 
| 5 7 |  | 
| 6 8 | 
             
            ## Installation
         | 
| 7 9 |  | 
| 8 | 
            -
            Add  | 
| 10 | 
            +
            Add the following line to your application's Gemfile. Add it after the lines for all other `delayed_job*` gems so the gem can properly integrate with the Delayed::Job code.
         | 
| 9 11 |  | 
| 10 12 | 
             
                gem 'delayed_cron_job'
         | 
| 11 13 |  | 
| @@ -36,7 +38,7 @@ Any crontab compatible cron expressions are supported (see `man 5 crontab`). | |
| 36 38 | 
             
            The credits for the `Cronline` class used go to
         | 
| 37 39 | 
             
            [rufus-scheduler](https://github.com/jmettraux/rufus-scheduler).
         | 
| 38 40 |  | 
| 39 | 
            -
            ## | 
| 41 | 
            +
            ## Details
         | 
| 40 42 |  | 
| 41 43 | 
             
            The initial `run_at` value is computed during the `#enqueue` method call.
         | 
| 42 44 | 
             
            If you create `Delayed::Job` database entries directly, make sure to set
         | 
| @@ -65,3 +67,8 @@ jobs. | |
| 65 67 | 
             
            3. Commit your changes (`git commit -am 'Add some feature'`)
         | 
| 66 68 | 
             
            4. Push to the branch (`git push origin my-new-feature`)
         | 
| 67 69 | 
             
            5. Create a new Pull Request
         | 
| 70 | 
            +
             | 
| 71 | 
            +
            ## License
         | 
| 72 | 
            +
             | 
| 73 | 
            +
            Delayed::Cron::Job is released under the terms of the MIT License.
         | 
| 74 | 
            +
            Copyright 2014-2017 Pascal Zumkehr. See LICENSE for further information.
         | 
    
        data/lib/delayed_cron_job.rb
    CHANGED
    
    | @@ -5,6 +5,14 @@ require 'delayed_cron_job/plugin' | |
| 5 5 | 
             
            require 'delayed_cron_job/version'
         | 
| 6 6 | 
             
            require 'delayed_cron_job/backend/updatable_cron'
         | 
| 7 7 |  | 
| 8 | 
            +
            begin
         | 
| 9 | 
            +
              require 'delayed_job_active_record'
         | 
| 10 | 
            +
            rescue LoadError; end
         | 
| 11 | 
            +
             | 
| 12 | 
            +
            begin
         | 
| 13 | 
            +
              require 'delayed_job_mongoid'
         | 
| 14 | 
            +
            rescue LoadError; end
         | 
| 15 | 
            +
             | 
| 8 16 | 
             
            module DelayedCronJob
         | 
| 9 17 |  | 
| 10 18 | 
             
            end
         | 
| @@ -12,11 +12,22 @@ module DelayedJob | |
| 12 12 | 
             
                self.source_paths << File.join(File.dirname(__FILE__), 'templates')
         | 
| 13 13 |  | 
| 14 14 | 
             
                def create_migration_file
         | 
| 15 | 
            -
                  migration_template('cron_migration.rb', | 
| 15 | 
            +
                  migration_template('cron_migration.rb',
         | 
| 16 | 
            +
                                     'db/migrate/add_cron_to_delayed_jobs.rb',
         | 
| 17 | 
            +
                                     migration_version: migration_version)
         | 
| 16 18 | 
             
                end
         | 
| 17 19 |  | 
| 18 20 | 
             
                def self.next_migration_number(dirname)
         | 
| 19 21 | 
             
                  ActiveRecord::Generators::Base.next_migration_number(dirname)
         | 
| 20 22 | 
             
                end
         | 
| 23 | 
            +
             | 
| 24 | 
            +
                private
         | 
| 25 | 
            +
             | 
| 26 | 
            +
                def migration_version
         | 
| 27 | 
            +
                  if ActiveRecord::VERSION::MAJOR >= 5
         | 
| 28 | 
            +
                    "[#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}]"
         | 
| 29 | 
            +
                  end
         | 
| 30 | 
            +
                end
         | 
| 31 | 
            +
             | 
| 21 32 | 
             
              end
         | 
| 22 | 
            -
            end
         | 
| 33 | 
            +
            end
         | 
| @@ -1,4 +1,4 @@ | |
| 1 | 
            -
            class AddCronToDelayedJobs < ActiveRecord::Migration
         | 
| 1 | 
            +
            class AddCronToDelayedJobs < ActiveRecord::Migration<%= migration_version %>
         | 
| 2 2 | 
             
              def self.up
         | 
| 3 3 | 
             
                add_column :delayed_jobs, :cron, :string
         | 
| 4 4 | 
             
              end
         | 
| @@ -6,4 +6,4 @@ class AddCronToDelayedJobs < ActiveRecord::Migration | |
| 6 6 | 
             
              def self.down
         | 
| 7 7 | 
             
                remove_column :delayed_jobs, :cron
         | 
| 8 8 | 
             
              end
         | 
| 9 | 
            -
            end
         | 
| 9 | 
            +
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: delayed_cron_job
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.7. | 
| 4 | 
            +
              version: 0.7.2
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Pascal Zumkehr
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 11 | 
            +
            date: 2017-06-30 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: delayed_job
         | 
| @@ -122,7 +122,7 @@ files: | |
| 122 122 | 
             
            - ".rspec"
         | 
| 123 123 | 
             
            - ".travis.yml"
         | 
| 124 124 | 
             
            - Gemfile
         | 
| 125 | 
            -
            - LICENSE | 
| 125 | 
            +
            - LICENSE
         | 
| 126 126 | 
             
            - README.md
         | 
| 127 127 | 
             
            - Rakefile
         | 
| 128 128 | 
             
            - delayed_cron_job.gemspec
         | 
| @@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 158 158 | 
             
                  version: '0'
         | 
| 159 159 | 
             
            requirements: []
         | 
| 160 160 | 
             
            rubyforge_project: 
         | 
| 161 | 
            -
            rubygems_version: 2.4. | 
| 161 | 
            +
            rubygems_version: 2.4.5.1
         | 
| 162 162 | 
             
            signing_key: 
         | 
| 163 163 | 
             
            specification_version: 4
         | 
| 164 164 | 
             
            summary: An extension to Delayed::Job that allows you to set cron expressions for
         |