mhtml 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 60fd056e7a5ded9db6a7e18e49c982100672e084
4
- data.tar.gz: 1236377e35f0c3176bcaa25aaa6db13757d64d63
3
+ metadata.gz: d46e644c02af32f1834074122606f376c40dad7d
4
+ data.tar.gz: '0188874fe3d843815efa889b5d2cb1c4c5ebcdbf'
5
5
  SHA512:
6
- metadata.gz: 9cb37bbcc90d6e0c7658cde28c89bc69e2d79315709f6d86c8ac941c3284471e7ef0d7d7c25d04f0a8cb8a33ffe79b56216d2b09a5b4bc8a75eb16b7e4caace7
7
- data.tar.gz: '095474af649049223490a686331be4368b6956c6f0281985436c4815f91fb9ddcbd92905c1c0c86af731801bfefd5de988efccbfa60427775a1bb2a9524a02f7'
6
+ metadata.gz: 3d3fe74d71b05c0b35699f94a11e9c393958a002e81421b16d0743d76d3776401ecc358e40f3c57ca657f65a36f9132a58ab4cc2a9472812abd00b1bfe4b7682
7
+ data.tar.gz: 2e102e1eb2f75bdeeea94fe3b4b81128c09ec552be44e19f88de14a28d21bf0a5a0905b7bcbffa5a719b24988c90792331fc0a1518d37c8fdb75820942162c6e
@@ -69,18 +69,24 @@ module Mhtml
69
69
 
70
70
  def relative_file_path
71
71
  return nil if @file_path.nil?
72
- return @file_path if @root_doc.nil? || @root_doc.file_path.nil?
73
72
  return '.' if @file_path == @root_doc.file_path
74
73
 
75
74
  str = nil
76
- if @file_path.start_with?(@root_doc.file_path)
75
+
76
+ if !@root_doc.file_path.nil? && @file_path.start_with?(@root_doc.file_path)
77
77
  start = @root_doc.file_path.length
78
- str = @file_path[start..@file_path.length - 1]
78
+ str = @file_path[start..(@file_path.length - 1)]
79
+
80
+ elsif @file_path.include?(':')
81
+ start = @file_path.rindex(':') + 1
82
+ str = @file_path[start..(@file_path.length - 1)]
83
+
79
84
  else
80
85
  str = @file_path
81
86
  end
82
87
 
83
88
  str = str[1..(str.length - 1)] if str[0] == '/'
89
+
84
90
  str
85
91
  end
86
92
 
data/lib/mhtml/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mhtml
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mhtml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Williams