jobler 0.0.11 → 0.0.12

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
- SHA1:
3
- metadata.gz: 259705262bb7620bd25605db416eecb256b45336
4
- data.tar.gz: 20af18e5bff9f0a14bbb5bfd152af66991253d05
2
+ SHA256:
3
+ metadata.gz: b799fadf62229d053e33b4f073fecc0962e944d9e2dee1dc8ae9f213c4a425ba
4
+ data.tar.gz: d7a89ad05effc901eb99b11b944450091f63b4ed7aca467f58f1203118e19e56
5
5
  SHA512:
6
- metadata.gz: 11c31d726c124c2270da6339d29caf7ae676831964c38d94ec3c3f6b4989275132bc6507cc61db631550cd963fb08b9c947fcaf128e7f8f830080cdd261a7c66
7
- data.tar.gz: 7899b9ff8c60964ff69a7b80c6f5f23460d7b44ea47e91790a049231c5b10a8172080b82162da40409abf460f68946196ad49ff46b2281fa6e0489feda3dc900
6
+ metadata.gz: 0ae5ea9a10281c55fcb793679dcd0b46a879938a333b9839b285013521021077ee6eeb510f2c5cd6a475151083e3a703230c71dd8bb91843e0f49e422b66cb35
7
+ data.tar.gz: dea066d7849a36caf18f2a6755481efb06159ca805326fef94e20d09c9fa047bab121c692f652cfb4c15b16ab43eded86e827b6e318f516d1909e3dd373501ef
data/Rakefile CHANGED
@@ -14,7 +14,7 @@ RDoc::Task.new(:rdoc) do |rdoc|
14
14
  rdoc.rdoc_files.include("lib/**/*.rb")
15
15
  end
16
16
 
17
- APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
17
+ APP_RAKEFILE = File.expand_path("spec/dummy/Rakefile", __dir__)
18
18
  load "rails/tasks/engine.rake"
19
19
 
20
20
  load "rails/tasks/statistics.rake"
@@ -45,11 +45,11 @@ private
45
45
  end
46
46
 
47
47
  def model
48
- @_model ||= model_class.find(args.fetch(:model_id))
48
+ @model ||= model_class.find(args.fetch(:model_id))
49
49
  end
50
50
 
51
51
  def relationships
52
- @_relationships ||= proc do
52
+ @relationships ||= begin
53
53
  result = []
54
54
 
55
55
  model_class.reflections.each_value do |reflection|
@@ -60,6 +60,6 @@ private
60
60
  end
61
61
 
62
62
  result
63
- end.call
63
+ end
64
64
  end
65
65
  end
@@ -6,7 +6,7 @@ class Jobler::Job < ActiveRecord::Base # rubocop:disable Rails/ApplicationRecord
6
6
  before_validation :set_slug
7
7
 
8
8
  def jobler
9
- @_jobler ||= jobler_type.constantize.new(args: YAML.load(parameters), job: self) # rubocop:disable Security/YAMLLoad
9
+ @jobler ||= jobler_type.constantize.new(args: YAML.load(parameters), job: self) # rubocop:disable Security/YAMLLoad
10
10
  end
11
11
 
12
12
  def completed?
@@ -19,6 +19,7 @@ class Jobler::Job < ActiveRecord::Base # rubocop:disable Rails/ApplicationRecord
19
19
 
20
20
  def to_param
21
21
  raise "No slug" unless slug?
22
+
22
23
  slug
23
24
  end
24
25
 
@@ -52,7 +52,7 @@ class Jobler::BaseJobler
52
52
  end
53
53
 
54
54
  if update
55
- job.update_attributes!(progress: new_progress)
55
+ job.update!(progress: new_progress)
56
56
  @_current_progress = new_progress
57
57
  end
58
58
  end
@@ -74,7 +74,7 @@ class Jobler::BaseJobler
74
74
  controller.request = request
75
75
  controller.response = ActionDispatch::Response.new
76
76
 
77
- render_result = controller.render(template_path, formats: Mime::EXTENSION_LOOKUP.keys, layout: false, locals: {jobler: self}.merge(locals))
77
+ render_result = controller.render(template_path, layout: false, locals: {jobler: self}.merge(locals))
78
78
 
79
79
  if render_result.is_a?(String)
80
80
  # Rails 5 behaviour
@@ -3,16 +3,16 @@ class Jobler::JobRunner < ActiveJob::Base # rubocop:disable Rails/ApplicationJob
3
3
 
4
4
  def perform(job_id)
5
5
  @job = Jobler::Job.find(job_id)
6
- @job.update_attributes!(started_at: Time.zone.now, state: "started")
6
+ @job.update!(started_at: Time.zone.now, state: "started")
7
7
 
8
8
  begin
9
9
  with_locale do
10
10
  @job.jobler.execute!
11
11
  end
12
12
 
13
- @job.update_attributes!(ended_at: Time.zone.now, progress: 1.0, state: "completed")
13
+ @job.update!(ended_at: Time.zone.now, progress: 1.0, state: "completed")
14
14
  rescue Exception => e # rubocop:disable Lint/RescueException
15
- @job.update_attributes!(
15
+ @job.update!(
16
16
  ended_at: Time.zone.now,
17
17
  error_message: e.message,
18
18
  error_type: e.class.name,
@@ -1,3 +1,3 @@
1
1
  module Jobler
2
- VERSION = "0.0.11".freeze
2
+ VERSION = "0.0.12".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jobler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - kaspernj
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-24 00:00:00.000000000 Z
11
+ date: 2019-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '4'
19
+ version: 6.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '4'
26
+ version: 6.0.0
27
27
  description: Generate pages or files in the background
28
28
  email:
29
29
  - kaspernj@gmail.com
@@ -85,8 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
85
  - !ruby/object:Gem::Version
86
86
  version: '0'
87
87
  requirements: []
88
- rubyforge_project:
89
- rubygems_version: 2.6.13
88
+ rubygems_version: 3.0.6
90
89
  signing_key:
91
90
  specification_version: 4
92
91
  summary: Generate pages or files in the background