resque-state 1.0.0 → 1.0.1
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/Gemfile +1 -1
- data/Gemfile.lock +1 -1
- data/README.rdoc +1 -0
- data/lib/resque/plugins/state.rb +6 -6
- data/lib/resque/plugins/state/hash.rb +4 -0
- data/resque-state.gemspec +3 -3
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 779bdd69ac2f019f2e09beccda331b6e34aebd0d
         | 
| 4 | 
            +
              data.tar.gz: ccb597afc15e66682b6768fae3f9509466333c0e
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: ca0be8ace1868df6b87a1a166977c6ffca7e7744c381dd145cdc8773562dac4be6fc61333a295eabe93cc5674078afe814237ce6a0d2a271719e2c5ea8530dd2
         | 
| 7 | 
            +
              data.tar.gz: f8c81b6d261331669bb2146f6427b53e3ee259cfe55cab9ea4b7c460a22910531d6aa14f525e5615d0c6148bffc9bbf6a3107d2dbb788a171acadf95f5f94c9f
         | 
    
        data/Gemfile
    CHANGED
    
    
    
        data/Gemfile.lock
    CHANGED
    
    
    
        data/README.rdoc
    CHANGED
    
    | @@ -1,6 +1,7 @@ | |
| 1 1 | 
             
            = resque-state
         | 
| 2 2 |  | 
| 3 3 | 
             
            {<img src="https://img.shields.io/badge/license-MIT-blue.svg" />}[https://github.com/nathan-v/resque-state/blob/master/LICENSE]
         | 
| 4 | 
            +
            {<img src="https://img.shields.io/gem/v/resque-state.svg" /}[https://rubygems.org/gems/resque-state]
         | 
| 4 5 |  | 
| 5 6 | 
             
            {<img src="https://codeclimate.com/github/nathan-v/resque-state/badges/gpa.svg" />}[https://codeclimate.com/github/nathan-v/resque-state]
         | 
| 6 7 | 
             
            {<img src="https://codeclimate.com/github/nathan-v/resque-state/badges/issue_count.svg" />}[https://codeclimate.com/github/nathan-v/resque-state]
         | 
    
        data/lib/resque/plugins/state.rb
    CHANGED
    
    | @@ -28,7 +28,7 @@ module Resque | |
| 28 28 | 
             
                # end we update the status telling anyone listening to this job that its
         | 
| 29 29 | 
             
                # complete.
         | 
| 30 30 | 
             
                module State
         | 
| 31 | 
            -
                  VERSION = '1.0. | 
| 31 | 
            +
                  VERSION = '1.0.1'.freeze
         | 
| 32 32 |  | 
| 33 33 | 
             
                  STATUS_QUEUED = 'queued'.freeze
         | 
| 34 34 | 
             
                  STATUS_WORKING = 'working'.freeze
         | 
| @@ -235,14 +235,14 @@ module Resque | |
| 235 235 | 
             
                      pause!
         | 
| 236 236 | 
             
                    else
         | 
| 237 237 | 
             
                      job_status({ 'status' => STATUS_WORKING }, *messages)
         | 
| 238 | 
            -
                      @logger.info("#{@uuid}: #{messages.join(' ')}")
         | 
| 238 | 
            +
                      @logger.info("Job #{@uuid}: #{messages.join(' ')}")
         | 
| 239 239 | 
             
                    end
         | 
| 240 240 | 
             
                  end
         | 
| 241 241 |  | 
| 242 242 | 
             
                  # set the status to 'failed' passing along any additional messages
         | 
| 243 243 | 
             
                  def failed(*messages)
         | 
| 244 244 | 
             
                    job_status({ 'status' => STATUS_FAILED }, *messages)
         | 
| 245 | 
            -
                    @logger.error("#{@uuid}: #{messages.join(' ')}")
         | 
| 245 | 
            +
                    @logger.error("Job #{@uuid}: #{messages.join(' ')}")
         | 
| 246 246 | 
             
                  end
         | 
| 247 247 |  | 
| 248 248 | 
             
                  # set the status to 'completed' passing along any addional messages
         | 
| @@ -251,7 +251,7 @@ module Resque | |
| 251 251 | 
             
                                 'status' => STATUS_COMPLETED,
         | 
| 252 252 | 
             
                                 'message' => "Completed at #{Time.now}"
         | 
| 253 253 | 
             
                               }, *messages)
         | 
| 254 | 
            -
                    @logger.info("#{@uuid}: #{messages.join(' ')}")
         | 
| 254 | 
            +
                    @logger.info("Job #{@uuid}: #{messages.join(' ')}")
         | 
| 255 255 | 
             
                  end
         | 
| 256 256 |  | 
| 257 257 | 
             
                  # kill the current job, setting the status to 'killed' and raising
         | 
| @@ -260,7 +260,7 @@ module Resque | |
| 260 260 | 
             
                    messages = ["Killed at #{Time.now}"]
         | 
| 261 261 | 
             
                    job_status('status' => STATUS_KILLED,
         | 
| 262 262 | 
             
                               'message' => messages[0])
         | 
| 263 | 
            -
                    @logger.error("#{@uuid}: #{messages.join(' ')}")
         | 
| 263 | 
            +
                    @logger.error("Job #{@uuid}: #{messages.join(' ')}")
         | 
| 264 264 | 
             
                    raise Killed
         | 
| 265 265 | 
             
                  end
         | 
| 266 266 |  | 
| @@ -272,7 +272,7 @@ module Resque | |
| 272 272 | 
             
                    job_status('status' => STATUS_PAUSED,
         | 
| 273 273 | 
             
                               'message' => messages[0])
         | 
| 274 274 | 
             
                    raise Killed if @testing # Don't loop or complete during testing
         | 
| 275 | 
            -
                    @logger.info("#{@uuid}: #{messages.join(' ')}")
         | 
| 275 | 
            +
                    @logger.info("Job #{@uuid}: #{messages.join(' ')}")
         | 
| 276 276 | 
             
                    while should_pause?
         | 
| 277 277 | 
             
                      kill! if should_kill?
         | 
| 278 278 | 
             
                      sleep 10
         | 
    
        data/resque-state.gemspec
    CHANGED
    
    | @@ -2,16 +2,16 @@ | |
| 2 2 | 
             
            # DO NOT EDIT THIS FILE DIRECTLY
         | 
| 3 3 | 
             
            # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
         | 
| 4 4 | 
             
            # -*- encoding: utf-8 -*-
         | 
| 5 | 
            -
            # stub: resque-state 1.0. | 
| 5 | 
            +
            # stub: resque-state 1.0.1 ruby lib
         | 
| 6 6 |  | 
| 7 7 | 
             
            Gem::Specification.new do |s|
         | 
| 8 8 | 
             
              s.name = "resque-state"
         | 
| 9 | 
            -
              s.version = "1.0. | 
| 9 | 
            +
              s.version = "1.0.1"
         | 
| 10 10 |  | 
| 11 11 | 
             
              s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
         | 
| 12 12 | 
             
              s.require_paths = ["lib"]
         | 
| 13 13 | 
             
              s.authors = ["Aaron Quint", "Nathan V"]
         | 
| 14 | 
            -
              s.date = "2016- | 
| 14 | 
            +
              s.date = "2016-09-26"
         | 
| 15 15 | 
             
              s.description = "resque-state is an extension to the resque queue system that provides simple trackable jobs. It provides a Resque::Plugins::State::Hash class which can set/get the statuses of jobs and a Resque::Plugins::State class that, when included, provides easily trackable/killable/pausable jobs."
         | 
| 16 16 | 
             
              s.email = "nathan.v@gmail.com"
         | 
| 17 17 | 
             
              s.extra_rdoc_files = [
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: resque-state
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1.0. | 
| 4 | 
            +
              version: 1.0.1
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Aaron Quint
         | 
| @@ -9,7 +9,7 @@ authors: | |
| 9 9 | 
             
            autorequire: 
         | 
| 10 10 | 
             
            bindir: bin
         | 
| 11 11 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date: 2016- | 
| 12 | 
            +
            date: 2016-09-26 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: resque
         |