sunspot_rails 2.2.8 → 2.3.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: 846b1e615a854510c5027c97856eba487a2179d38ca0d3be15f89b911cc6fb60
4
- data.tar.gz: 46a293fb375ac70062cce75885ad936724df1f5c1888cbda66d60a469841418c
3
+ metadata.gz: c03385c874a558e6fdbf6390e452bfc5c87a09f8a6c3d5efae34854e7fdab3d5
4
+ data.tar.gz: 472395a2311af2ef0323a5332c444275876958c4d2f8c6dacd50cee7fef0da56
5
5
  SHA512:
6
- metadata.gz: 9f122dc6d0481e2740a504f3415bc4c00f892cb999c950535f55cf11ed5dc443a8335c09b42543b29bb885805c630896052560e7a83900d9ff0831cd18889dbe
7
- data.tar.gz: ee63fcc4578de9c64350f759341aa7296ca521644cdb5cf6bbd82eaaedd2bf47fb2138ebfeac5588f739b453758dddf24fd454d63366eb628ff33854dc5a0795
6
+ metadata.gz: ccdf1424ba07fa9b7f9e2e6e0f4efc421f4da5aea49c3be1359616bb8727256fd72e7895ef0e294878d2e9f2c440661fbe97507b0219409eedb949c45cd2bf9d
7
+ data.tar.gz: 84c1b362c773e4c4a47a4e662ab0c9ac1bc8afdd018da8c8c88d9f88092846a44e86755c93692e9fbbed550947c54c23545466092cc9cb50f858f650d784fe14
@@ -53,6 +53,7 @@ module Sunspot #:nodoc:
53
53
  config.solr.read_timeout = sunspot_rails_configuration.read_timeout
54
54
  config.solr.open_timeout = sunspot_rails_configuration.open_timeout
55
55
  config.solr.proxy = sunspot_rails_configuration.proxy
56
+ config.solr.update_format = sunspot_rails_configuration.update_format
56
57
  config
57
58
  end
58
59
 
@@ -68,6 +69,7 @@ module Sunspot #:nodoc:
68
69
  config.solr.read_timeout = sunspot_rails_configuration.read_timeout
69
70
  config.solr.open_timeout = sunspot_rails_configuration.open_timeout
70
71
  config.solr.proxy = sunspot_rails_configuration.proxy
72
+ config.solr.update_format = sunspot_rails_configuration.update_format
71
73
  config
72
74
  end
73
75
  end
@@ -301,6 +301,10 @@ module Sunspot #:nodoc:
301
301
  @open_timeout ||= user_configuration_from_key('solr', 'open_timeout')
302
302
  end
303
303
 
304
+ def update_format
305
+ @update_format ||= user_configuration_from_key('solr', 'update_format')
306
+ end
307
+
304
308
  def proxy
305
309
  @proxy ||= user_configuration_from_key('solr', 'proxy')
306
310
  end
@@ -50,11 +50,15 @@ describe Sunspot::Rails::Configuration, "default values without a sunspot.yml" d
50
50
  end
51
51
 
52
52
  it "should set the read timeout to nil when not set" do
53
- @config.read_timeout == nil
53
+ expect(@config.read_timeout).to be_nil
54
54
  end
55
55
 
56
56
  it "should set the open timeout to nil when not set" do
57
- @config.open_timeout == nil
57
+ expect(@config.open_timeout).to be_nil
58
+ end
59
+
60
+ it "should set the update_format to nil when not set" do
61
+ expect(@config.update_format).to be_nil
58
62
  end
59
63
 
60
64
  it "should set 'log_level' property using Rails log level when not set" do
@@ -163,6 +167,10 @@ describe Sunspot::Rails::Configuration, "user provided sunspot.yml" do
163
167
  expect(@config.open_timeout).to eq(0.5)
164
168
  end
165
169
 
170
+ it "should handle the 'update_format' property when set" do
171
+ expect(@config.update_format).to eq('json')
172
+ end
173
+
166
174
  it "should handle the 'proxy' property when set" do
167
175
  expect(@config.proxy).to eq('http://proxy.com:12345')
168
176
  end
@@ -22,6 +22,7 @@ config_test:
22
22
  bind_address: 127.0.0.1
23
23
  read_timeout: 2
24
24
  open_timeout: 0.5
25
+ update_format: json
25
26
  proxy: http://proxy.com:12345
26
27
  auto_commit_after_request: false
27
28
  auto_commit_after_delete_request: true
@@ -20,7 +20,7 @@ describe PostsController, :type => :controller do
20
20
  expect(Sunspot).to receive(:commit_if_dirty)
21
21
  post :create, :params => { :post => { :title => 'Test 1' } }
22
22
  end
23
-
23
+
24
24
  it 'should not commit, if configuration is set to false' do
25
25
  @configuration.user_configuration = { 'auto_commit_after_request' => false }
26
26
  expect(Sunspot).not_to receive(:commit_if_dirty)
@@ -32,16 +32,16 @@ describe PostsController, :type => :controller do
32
32
  expect(Sunspot).to receive(:commit_if_dirty)
33
33
  post :create, :params => { :post => { :title => 'Test 1' } }
34
34
  end
35
-
35
+
36
36
  ### auto_commit_if_delete_dirty
37
-
37
+
38
38
  it 'should automatically commit after each delete if specified' do
39
39
  @configuration.user_configuration = { 'auto_commit_after_request' => false,
40
40
  'auto_commit_after_delete_request' => true }
41
41
  expect(Sunspot).to receive(:commit_if_delete_dirty)
42
42
  post :create, :params => { :post => { :title => 'Test 1' } }
43
43
  end
44
-
44
+
45
45
  it 'should not automatically commit on delete if configuration is set to false' do
46
46
  @configuration.user_configuration = { 'auto_commit_after_request' => false,
47
47
  'auto_commit_after_delete_request' => false }
@@ -54,4 +54,4 @@ describe PostsController, :type => :controller do
54
54
  expect(Sunspot).not_to receive(:commit_if_delete_dirty)
55
55
  post :create, :params => { :post => { :title => 'Test 1' } }
56
56
  end
57
- end
57
+ end
@@ -38,9 +38,9 @@ Gem::Specification.new do |s|
38
38
  s.add_development_dependency 'appraisal', '2.2.0'
39
39
  s.add_development_dependency 'nokogiri', '< 1.7' if RUBY_VERSION <= '2.0.0'
40
40
  s.add_development_dependency 'rake', '< 12.3'
41
- s.add_development_dependency 'rspec'
42
- s.add_development_dependency 'rspec-rails'
43
- s.add_development_dependency 'sqlite3'
41
+ s.add_development_dependency 'rspec', '~> 3.7'
42
+ s.add_development_dependency 'rspec-rails', '~> 3.7'
43
+ s.add_development_dependency 'sqlite3', '~> 1.3'
44
44
 
45
45
  s.rdoc_options << '--webcvs=http://github.com/outoftime/sunspot/tree/master/%s' <<
46
46
  '--title' << 'Sunspot-Rails - Rails integration for the Sunspot Solr search library - API Documentation' <<
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sunspot_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.8
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mat Brown
@@ -26,7 +26,7 @@ authors:
26
26
  autorequire:
27
27
  bindir: bin
28
28
  cert_chain: []
29
- date: 2018-03-26 00:00:00.000000000 Z
29
+ date: 2018-04-08 00:00:00.000000000 Z
30
30
  dependencies:
31
31
  - !ruby/object:Gem::Dependency
32
32
  name: rails
@@ -48,14 +48,14 @@ dependencies:
48
48
  requirements:
49
49
  - - '='
50
50
  - !ruby/object:Gem::Version
51
- version: 2.2.8
51
+ version: 2.3.0
52
52
  type: :runtime
53
53
  prerelease: false
54
54
  version_requirements: !ruby/object:Gem::Requirement
55
55
  requirements:
56
56
  - - '='
57
57
  - !ruby/object:Gem::Version
58
- version: 2.2.8
58
+ version: 2.3.0
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: appraisal
61
61
  requirement: !ruby/object:Gem::Requirement
@@ -88,44 +88,44 @@ dependencies:
88
88
  name: rspec
89
89
  requirement: !ruby/object:Gem::Requirement
90
90
  requirements:
91
- - - ">="
91
+ - - "~>"
92
92
  - !ruby/object:Gem::Version
93
- version: '0'
93
+ version: '3.7'
94
94
  type: :development
95
95
  prerelease: false
96
96
  version_requirements: !ruby/object:Gem::Requirement
97
97
  requirements:
98
- - - ">="
98
+ - - "~>"
99
99
  - !ruby/object:Gem::Version
100
- version: '0'
100
+ version: '3.7'
101
101
  - !ruby/object:Gem::Dependency
102
102
  name: rspec-rails
103
103
  requirement: !ruby/object:Gem::Requirement
104
104
  requirements:
105
- - - ">="
105
+ - - "~>"
106
106
  - !ruby/object:Gem::Version
107
- version: '0'
107
+ version: '3.7'
108
108
  type: :development
109
109
  prerelease: false
110
110
  version_requirements: !ruby/object:Gem::Requirement
111
111
  requirements:
112
- - - ">="
112
+ - - "~>"
113
113
  - !ruby/object:Gem::Version
114
- version: '0'
114
+ version: '3.7'
115
115
  - !ruby/object:Gem::Dependency
116
116
  name: sqlite3
117
117
  requirement: !ruby/object:Gem::Requirement
118
118
  requirements:
119
- - - ">="
119
+ - - "~>"
120
120
  - !ruby/object:Gem::Version
121
- version: '0'
121
+ version: '1.3'
122
122
  type: :development
123
123
  prerelease: false
124
124
  version_requirements: !ruby/object:Gem::Requirement
125
125
  requirements:
126
- - - ">="
126
+ - - "~>"
127
127
  - !ruby/object:Gem::Version
128
- version: '0'
128
+ version: '1.3'
129
129
  description: |2
130
130
  Sunspot::Rails is an extension to the Sunspot library for Solr search.
131
131
  Sunspot::Rails adds integration between Sunspot and ActiveRecord, including