que 0.14.1 → 0.14.2

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: dad50627f82edb14529d66b00f009f61f8cce6ad
4
- data.tar.gz: 5644e3ae8518c25e14ddc3381973dc81374e32f4
2
+ SHA256:
3
+ metadata.gz: 91851179dace9028e7617410ea3214b2f465aa20399db4714c91aa533682a326
4
+ data.tar.gz: 42935a8c9b1d8c709b7e39c590d2d1b062474dc509c66c0e5e87650bf40b39ac
5
5
  SHA512:
6
- metadata.gz: b4f23840e1d4c2143d9fe66a672659421af2a01f321a5a29abf9019f1b79c57a91832f6211c2d0dfd6a793c9e9ba7cc6d8ae44f5d4d925844106f6af7b1193d1
7
- data.tar.gz: 203489a4d1e2fbcd3b6c6e3f4e54f5e9c5cb0df11b32f392fc65a5a5feae969694001e4fdfbf778afb4a50dddc666054e23bc7704b22f273c2a006aca6c3f5e0
6
+ metadata.gz: 2635539c039b7e30736d8032bf8c27210624b98695f98c30053dff29345cc6368eb864315b32a41ea79a8af7a91f0c76c89924e73b652fe4edc08f15b1b65e41
7
+ data.tar.gz: 28d797216ae91e9cc15aee815c51308432f45d87dbc9cfc966d500496eec4efecb018c99dcf19fc0edb46bdd925ca35967eb10da325dfde642dafceb5f38297b
@@ -1,3 +1,11 @@
1
+ ### 0.14.2 (2018-01-05)
2
+
3
+ * Deprecate the Que.disable_prepared_statements= accessors.
4
+
5
+ * Add Que.use_prepared_statements= configuration accessors.
6
+
7
+ * Update the generated Rails migration to declare a version. (NARKOZ)
8
+
1
9
  ### 0.14.1 (2017-12-14)
2
10
 
3
11
  * Fix a bug with typecasting boolean values on Rails 5+.
data/README.md CHANGED
@@ -111,6 +111,7 @@ To determine what happens when a job is queued, you can set Que's mode. There ar
111
111
 
112
112
  * [que-web](https://github.com/statianzo/que-web) is a Sinatra-based UI for inspecting your job queue.
113
113
  * [que-testing](https://github.com/statianzo/que-testing) allows making assertions on enqueued jobs.
114
+ * [que-scheduler](https://github.com/hlascelles/que-scheduler) is a cron scheduler for Que jobs that runs on Que itself.
114
115
  * [que-go](https://github.com/bgentry/que-go) is a port of Que for the Go programming language. It uses the same table structure, so that you can use the same job queue from Ruby and Go applications.
115
116
  * [wisper-que](https://github.com/joevandyk/wisper-que) adds support for Que to [wisper](https://github.com/krisleech/wisper).
116
117
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class AddQue < ActiveRecord::Migration
3
+ class AddQue < ActiveRecord::Migration[4.2]
4
4
  def self.up
5
5
  # The current version as of this migration's creation.
6
6
  Que.migrate! :version => 3
data/lib/que.rb CHANGED
@@ -42,7 +42,7 @@ module Que
42
42
 
43
43
  class << self
44
44
  attr_accessor :error_notifier
45
- attr_writer :logger, :adapter, :log_formatter, :disable_prepared_statements, :json_converter
45
+ attr_writer :logger, :adapter, :log_formatter, :use_prepared_statements, :json_converter
46
46
 
47
47
  def connection=(connection)
48
48
  self.adapter =
@@ -126,8 +126,19 @@ module Que
126
126
  @log_formatter ||= JSON.method(:dump)
127
127
  end
128
128
 
129
+ def use_prepared_statements
130
+ setting = @use_prepared_statements
131
+ setting.nil? ? true : setting
132
+ end
133
+
129
134
  def disable_prepared_statements
130
- @disable_prepared_statements || false
135
+ warn "Que.disable_prepared_statements has been deprecated, please update your code to invert the result of Que.disable_prepared_statements instead. This shim will be removed in Que version 1.0.0."
136
+ !use_prepared_statements
137
+ end
138
+
139
+ def disable_prepared_statements=(setting)
140
+ warn "Que.disable_prepared_statements= has been deprecated, please update your code to pass the inverted value to Que.use_prepared_statements= instead. This shim will be removed in Que version 1.0.0."
141
+ self.use_prepared_statements = !setting
131
142
  end
132
143
 
133
144
  def error_handler
@@ -67,7 +67,7 @@ module Que
67
67
  checkout do |conn|
68
68
  # Prepared statement errors have the potential to foul up the entire
69
69
  # transaction, so if we're in one, err on the side of safety.
70
- return execute_sql(SQL[name], params) if Que.disable_prepared_statements || in_transaction?
70
+ return execute_sql(SQL[name], params) if !Que.use_prepared_statements || in_transaction?
71
71
 
72
72
  statements = @prepared_statements[conn] ||= {}
73
73
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Que
4
- Version = '0.14.1'
4
+ Version = '0.14.2'
5
5
  end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Que do
6
+ it ".use_prepared_statements should be the opposite of disable_prepared_statements" do
7
+ original_verbose = $VERBOSE
8
+ $VERBOSE = nil
9
+
10
+ Que.use_prepared_statements.should == true
11
+ Que.disable_prepared_statements.should == false
12
+
13
+ Que.disable_prepared_statements = true
14
+ Que.use_prepared_statements.should == false
15
+ Que.disable_prepared_statements.should == true
16
+
17
+ Que.disable_prepared_statements = nil
18
+ Que.use_prepared_statements.should == true
19
+ Que.disable_prepared_statements.should == false
20
+
21
+ Que.use_prepared_statements = false
22
+ Que.use_prepared_statements.should == false
23
+ Que.disable_prepared_statements.should == true
24
+
25
+ Que.use_prepared_statements = true
26
+ Que.use_prepared_statements.should == true
27
+ Que.disable_prepared_statements.should == false
28
+
29
+ $VERBOSE = original_verbose
30
+ end
31
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: que
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.1
4
+ version: 0.14.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Hanks
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-15 00:00:00.000000000 Z
11
+ date: 2018-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -91,6 +91,7 @@ files:
91
91
  - spec/support/jobs.rb
92
92
  - spec/support/shared_examples/adapter.rb
93
93
  - spec/support/shared_examples/multi_threaded_adapter.rb
94
+ - spec/unit/configuration_spec.rb
94
95
  - spec/unit/connection_spec.rb
95
96
  - spec/unit/customization_spec.rb
96
97
  - spec/unit/enqueue_spec.rb
@@ -127,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
128
  version: '0'
128
129
  requirements: []
129
130
  rubyforge_project:
130
- rubygems_version: 2.6.8
131
+ rubygems_version: 2.7.3
131
132
  signing_key:
132
133
  specification_version: 4
133
134
  summary: A PostgreSQL-based Job Queue
@@ -146,6 +147,7 @@ test_files:
146
147
  - spec/support/jobs.rb
147
148
  - spec/support/shared_examples/adapter.rb
148
149
  - spec/support/shared_examples/multi_threaded_adapter.rb
150
+ - spec/unit/configuration_spec.rb
149
151
  - spec/unit/connection_spec.rb
150
152
  - spec/unit/customization_spec.rb
151
153
  - spec/unit/enqueue_spec.rb