ae_active_job_state 0.3.0 → 1.1.0

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: 706322d5333d170413b8ea10f6828e23b97f7276fb1c3f4be925b4e1d3998612
4
- data.tar.gz: 81fe635701a0c541832a7daf7a52d5a262e88ff4332eacbdf85ed3ee03a302b5
3
+ metadata.gz: 27577d3a5f8d80f06587a891c73c706bdb3ca0739247d94ddbed044f305dc652
4
+ data.tar.gz: 1e33ab5fb93a7967ef972778ae44b84bf6caa1481bb66a0b15f896dc8aab6955
5
5
  SHA512:
6
- metadata.gz: 6ec715060434b6d894f83892b7d2e168fbd1de45b4375e9e9d697ef9037f7f661c52f4dda008b87c7450cc92ba34078d73978d436f4d0ca28d81eca8b3bdc417
7
- data.tar.gz: 50d2d323c6c6dfb6d6e42b9cbd79a135208a04fb93e0fa99389947cf1e73f61c1234755d5b69b1bbdcb8a37c9f0e319f01bdcb1e29755f45e0f1e2525e973aba
6
+ metadata.gz: 825d24c8a500b3af1d6a98cd2e035b7f7a071cfa3041ed5e6df3992fa8bac1dda3179fbf0f2245b972bdc0f912e615beac615648eead79b7176460dbfdef915b
7
+ data.tar.gz: 6e3ce3de3483b00da0acce5aba7c1c17fc980cdb05b6ef288d57351734facce5618260db20e6645f27f5593a5cd390bb020675b4de6aefe05d28999b0d42c950
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2020-2020 AppFolio inc
1
+ Copyright (c) 2020-2022 AppFolio, Inc
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -3,20 +3,23 @@
3
3
  require_relative 'lib/ae_active_job_state/version'
4
4
 
5
5
  Gem::Specification.new do |spec|
6
- spec.name = 'ae_active_job_state'
7
- spec.version = AeActiveJobState::VERSION
8
- spec.platform = Gem::Platform::RUBY
9
- spec.author = 'AppFolio'
10
- spec.email = 'opensource@appfolio.com'
11
- spec.description = 'Store ActiveJob status in ActiveRecord'
12
- spec.summary = spec.description
13
- spec.homepage = 'https://github.com/appfolio/ae_active_job_state'
14
- spec.license = 'MIT'
15
- spec.files = Dir['**/*'].select { |f| f[%r{^(lib/|LICENSE.txt|.*gemspec)}] }
16
- spec.require_paths = ['lib']
6
+ spec.name = 'ae_active_job_state'
7
+ spec.version = AeActiveJobState::VERSION
8
+ spec.platform = Gem::Platform::RUBY
9
+ spec.author = 'AppFolio'
10
+ spec.email = 'opensource@appfolio.com'
11
+ spec.description = 'Store ActiveJob status in ActiveRecord'
12
+ spec.summary = spec.description
13
+ spec.homepage = 'https://github.com/appfolio/ae_active_job_state'
14
+ spec.license = 'MIT'
15
+ spec.files = Dir['**/*'].select { |f| f[%r{^(lib/|LICENSE.txt|.*gemspec)}] }
16
+ spec.require_paths = ['lib']
17
+ spec.required_ruby_version = Gem::Requirement.new('>= 2.6.3')
17
18
 
18
- spec.add_dependency 'aasm', '~> 5.1'
19
- spec.add_dependency 'activejob', '>= 6', '< 7'
20
- spec.add_dependency 'activerecord', '>= 6', '< 7'
21
- spec.add_dependency 'activesupport', '>= 6', '< 7'
19
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
20
+
21
+ spec.add_dependency('aasm', ['>= 5.1', '< 6'])
22
+ spec.add_dependency('activejob', ['>= 6', '< 7.1'])
23
+ spec.add_dependency('activerecord', ['>= 6', '< 7.1'])
24
+ spec.add_dependency('activesupport', ['>= 6', '< 7.1'])
22
25
  end
@@ -36,12 +36,12 @@ module AeActiveJobState
36
36
  @job_state = AeActiveJobState::JobState.find_by!(active_job_id: job.job_id)
37
37
  end
38
38
 
39
- job_state.run!
39
+ job_state.running!
40
40
  job_state.reload
41
41
  block.call
42
- job_state.finish!
42
+ job_state.finished!
43
43
  rescue StandardError => e
44
- @job_state.fail!
44
+ @job_state.failed!
45
45
  raise e
46
46
  end
47
47
  end
@@ -14,19 +14,16 @@ module AeActiveJobState
14
14
  state :finished
15
15
  state :failed
16
16
 
17
- event :run do
18
- transitions from: %w[pending failed], to: :running
19
- after { update!(started_at: Time.now) }
17
+ event :running do
18
+ transitions to: :running, after: -> { self.started_at = Time.now }
20
19
  end
21
20
 
22
- event :fail do
23
- transitions from: :running, to: :failed
24
- after { update!(failed_at: Time.now) }
21
+ event :failed do
22
+ transitions to: :failed, after: -> { self.failed_at = Time.now }
25
23
  end
26
24
 
27
- event :finish do
28
- transitions from: :running, to: :finished
29
- after { update!(finished_at: Time.now) }
25
+ event :finished do
26
+ transitions to: :finished, after: -> { self.finished_at = Time.now }
30
27
  end
31
28
  end
32
29
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AeActiveJobState
4
- VERSION = '0.3.0'
4
+ VERSION = '1.1.0'
5
5
  end
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ae_active_job_state
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - AppFolio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-24 00:00:00.000000000 Z
11
+ date: 2022-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aasm
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '5.1'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '6'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: '5.1'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '6'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: activejob
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -33,7 +39,7 @@ dependencies:
33
39
  version: '6'
34
40
  - - "<"
35
41
  - !ruby/object:Gem::Version
36
- version: '7'
42
+ version: '7.1'
37
43
  type: :runtime
38
44
  prerelease: false
39
45
  version_requirements: !ruby/object:Gem::Requirement
@@ -43,7 +49,7 @@ dependencies:
43
49
  version: '6'
44
50
  - - "<"
45
51
  - !ruby/object:Gem::Version
46
- version: '7'
52
+ version: '7.1'
47
53
  - !ruby/object:Gem::Dependency
48
54
  name: activerecord
49
55
  requirement: !ruby/object:Gem::Requirement
@@ -53,7 +59,7 @@ dependencies:
53
59
  version: '6'
54
60
  - - "<"
55
61
  - !ruby/object:Gem::Version
56
- version: '7'
62
+ version: '7.1'
57
63
  type: :runtime
58
64
  prerelease: false
59
65
  version_requirements: !ruby/object:Gem::Requirement
@@ -63,7 +69,7 @@ dependencies:
63
69
  version: '6'
64
70
  - - "<"
65
71
  - !ruby/object:Gem::Version
66
- version: '7'
72
+ version: '7.1'
67
73
  - !ruby/object:Gem::Dependency
68
74
  name: activesupport
69
75
  requirement: !ruby/object:Gem::Requirement
@@ -73,7 +79,7 @@ dependencies:
73
79
  version: '6'
74
80
  - - "<"
75
81
  - !ruby/object:Gem::Version
76
- version: '7'
82
+ version: '7.1'
77
83
  type: :runtime
78
84
  prerelease: false
79
85
  version_requirements: !ruby/object:Gem::Requirement
@@ -83,7 +89,7 @@ dependencies:
83
89
  version: '6'
84
90
  - - "<"
85
91
  - !ruby/object:Gem::Version
86
- version: '7'
92
+ version: '7.1'
87
93
  description: Store ActiveJob status in ActiveRecord
88
94
  email: opensource@appfolio.com
89
95
  executables: []
@@ -103,7 +109,8 @@ files:
103
109
  homepage: https://github.com/appfolio/ae_active_job_state
104
110
  licenses:
105
111
  - MIT
106
- metadata: {}
112
+ metadata:
113
+ allowed_push_host: https://rubygems.org
107
114
  post_install_message:
108
115
  rdoc_options: []
109
116
  require_paths:
@@ -112,14 +119,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
112
119
  requirements:
113
120
  - - ">="
114
121
  - !ruby/object:Gem::Version
115
- version: '0'
122
+ version: 2.6.3
116
123
  required_rubygems_version: !ruby/object:Gem::Requirement
117
124
  requirements:
118
125
  - - ">="
119
126
  - !ruby/object:Gem::Version
120
127
  version: '0'
121
128
  requirements: []
122
- rubygems_version: 3.1.2
129
+ rubygems_version: 3.3.3
123
130
  signing_key:
124
131
  specification_version: 4
125
132
  summary: Store ActiveJob status in ActiveRecord