solr_wrapper 0.0.4 → 0.0.5

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
  SHA1:
3
- metadata.gz: afbb108d004d57c73e68e21e9c4352d0249ec561
4
- data.tar.gz: 3d11fa951e19ff35da4e686b047eafb270f2288a
3
+ metadata.gz: 8f599156c301d05423f3d0bbb82f15bdcdc177c5
4
+ data.tar.gz: 91fbd6a8b261caa96a9d13d95529f8df4edd8264
5
5
  SHA512:
6
- metadata.gz: fd9cbb7c32124dd36dd4f49e33a8f6248b42851022cc7981125dedb92334c1930570d9efe58d4a2b8327defa0359e0cdd1106f5cd11e14d7be1b8a09b835bd5a
7
- data.tar.gz: dfff06a0df7ee5a7f550b6bbb0e956256d772624dcdae694865899394da99ae7c38038e7c2308d9e863fbc3081177725ce1c92857210dc121cd7f68e78ae7dcc
6
+ metadata.gz: 752c5a759af88d84475784ad50501e5b24f9873d3f7ab8230042a66134f5650b3bafafc6a1b417f99780613f3c5e01824e3fac25b7de717d186b8c04bcf13571
7
+ data.tar.gz: 2daa20c6613fc167f64de77d6e245d1373924f9b0b1646543fe6e76d41f29846784c0c47849da0cc2c7c36a2005e8b3e3e0d6645bb80f24fa4800acef329caab
@@ -1,5 +1,6 @@
1
1
  require 'digest'
2
2
  require 'fileutils'
3
+ require 'json'
3
4
  require 'open-uri'
4
5
  require 'ruby-progressbar'
5
6
  require 'securerandom'
@@ -222,7 +223,12 @@ module SolrWrapper
222
223
  end
223
224
 
224
225
  def default_url
225
- "http://mirrors.ibiblio.org/apache/lucene/solr/#{version}/solr-#{version}.zip"
226
+ @default_url ||= begin
227
+ mirror_url = "http://www.apache.org/dyn/closer.cgi/lucene/solr/#{version}/solr-#{version}.zip?asjson=true"
228
+ json = open(mirror_url).read
229
+ doc = JSON.parse(json)
230
+ doc['preferred'] + doc['path_info']
231
+ end
226
232
  end
227
233
 
228
234
  def version
@@ -1,3 +1,3 @@
1
1
  module SolrWrapper
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solr_wrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer