rock_rms 9.5.0 → 9.6.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: 290a1e9489236ab8bf4d3b938d118abec555927314236ca96022f335d35f5a46
4
- data.tar.gz: 35d09f4b4b6bf271600e751d6d65d5953d8dfdcfcabd2000fbfe656cfd69cdf6
3
+ metadata.gz: adc5ecace53e1ff1edbc454de1f30260228803924cfdc8016f022bc7fae915dd
4
+ data.tar.gz: f166b2bbff5250b3855d11db886a566723757a3b306a8b48373dbeb83a2f9710
5
5
  SHA512:
6
- metadata.gz: c3d8a12350735b09eb5054a5316de7d178d01f15105efae76c5230ba98507c3534ea711df2e70693a79adafb6a04a034ac49ec01b968344359975b1c3c4ead98
7
- data.tar.gz: c3bd70d6d4fd2e36e87a507da5d0010b15ab9dff36dc3831f9fa0841183e3a448f020f3913fb7f92b3bb1190c087f63400ec6f269111ce95471d8f0fcaac1178
6
+ metadata.gz: f3f0f9fec4849a2034de7196b22e598ab13430f04bf2259a98d7cc332363559432ecab5cc0441edf363f750609357671097affe4062e71b6fe2df8f19e170539
7
+ data.tar.gz: e8a04bff612b38eb2b85c9e5f6584ff619270e4bac4b496e9402cf28db1d39e1ded0ff644c29f9dd39702ed208a2f36bfe12e39bf10bb9b7791ad6a184933d13
@@ -46,7 +46,7 @@ module FaradayMiddleware
46
46
  private
47
47
 
48
48
  def html_body?(body)
49
- /(<!DOCTYPE html>)|(<html>)/ =~ body
49
+ /(<!DOCTYPE html>)|(<html>)|(<head>)/ =~ body
50
50
  end
51
51
 
52
52
  def check_html_error(env)
@@ -63,6 +63,12 @@ module FaradayMiddleware
63
63
  status: 404, url: env[:url], body: 'Page not found.'
64
64
  )
65
65
  end
66
+
67
+ if /Document Moved/ =~ env[:body]
68
+ raise RockRMS::NotFound, error_message(
69
+ status: 404, url: env[:url], body: 'Object Moved'
70
+ )
71
+ end
66
72
  end
67
73
 
68
74
  def error_message(env)
@@ -1,3 +1,3 @@
1
1
  module RockRMS
2
- VERSION = '9.5.0'.freeze
2
+ VERSION = '9.6.0'.freeze
3
3
  end
@@ -86,5 +86,11 @@ RSpec.describe RockRMS::Error do
86
86
  stub(200, body)
87
87
  expect_failure(404, 'Page not found.')
88
88
  end
89
+
90
+ it 'raises exception for not found error' do
91
+ body = File.read('spec/rock_rms/fixtures/document_moved.html')
92
+ stub(200, body)
93
+ expect_failure(404, 'Object Moved')
94
+ end
89
95
  end
90
96
  end
@@ -0,0 +1,2 @@
1
+ <head><title>Document Moved</title></head>
2
+ <body><h1>Object Moved</h1>This document may be found <a HREF="https://offline.thecrossing.church">here</a></body>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rock_rms
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.5.0
4
+ version: 9.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taylor Brooks
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-26 00:00:00.000000000 Z
11
+ date: 2024-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -265,6 +265,7 @@ files:
265
265
  - rock_rms.gemspec
266
266
  - spec/rock_rms/client_spec.rb
267
267
  - spec/rock_rms/error_spec.rb
268
+ - spec/rock_rms/fixtures/document_moved.html
268
269
  - spec/rock_rms/fixtures/internal_error.html
269
270
  - spec/rock_rms/fixtures/not_found_error.html
270
271
  - spec/rock_rms/resources/attribute_spec.rb