mkwebook 0.1.6 → 0.1.7

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
  SHA256:
3
- metadata.gz: d5abf4ba0b1406e5216aeaa32e027a2496ae55f18a678991b62e03860d975a55
4
- data.tar.gz: be9d3aee8045240625fa3ee6100eb6b88f2166fc4f681ee45ef1afcdf4b8748a
3
+ metadata.gz: 0f8fc12f211be95d5f471f231318136663987e920e2dfd1345118d68eb0bc420
4
+ data.tar.gz: ec4a088bd415a554c232a85692eba1e1983d4bf75941be8f5a8a76b6578f99b3
5
5
  SHA512:
6
- metadata.gz: b128ea745ab88c7f81daf00f168e42eab68bbc602c36ce39ad599b80ee8ea00bcf4ff717bb568bb2cf1091eda87286243fc4e62bbd18d56966fd823731ddce5e
7
- data.tar.gz: 570cf838b1cefc5f7f1bf4c402d6e69afcd0a71a2e3ef753f44a7c339feaf05a7317744deecea2d7b9c84616188fb265e94fdf2d4533a5c061c4959d85d078fa
6
+ metadata.gz: 1ed276076ec77a9ed76386232f77282c350ae206fa2b7d477274dc3cfe460817fcf33c9f5e05c7ed4493333df001cfaa9f81dcfcc8bab524caeecadeb04c1037
7
+ data.tar.gz: 55830b7666568be18a1cdcce720d701c9e33a2121c4e568b1656fca303c71b82911dc3ecf4bd8d4233af64f85bb27b6e7b6c540f2963eec8ef627c300ea38d6e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mkwebook (0.1.6)
4
+ mkwebook (0.1.7)
5
5
  activesupport (>= 6.1.5)
6
6
  concurrent-ruby
7
7
  ferrum (>= 0.13)
data/lib/mkwebook/app.rb CHANGED
@@ -170,6 +170,7 @@ module Mkwebook
170
170
  element.css('a').each do |a|
171
171
  u = a.evaluate('this.href') rescue nil
172
172
  next unless u.present?
173
+ next unless u =~ /^https?:\/\//
173
174
  href = u.normalize_uri('.html').relative_path_from(url.normalize_uri('.html'))
174
175
  file = u.normalize_file_path('.html')
175
176
  a.evaluate <<~JS
@@ -16,6 +16,8 @@ class String
16
16
  def normalize_file_path(force_extname = nil)
17
17
  return self unless present?
18
18
  uri = URI.parse(self)
19
+ return unless uri.scheme.in? %w(http https)
20
+ return unless uri.path.present?
19
21
  file_path = uri.path[1..]
20
22
  extname = force_extname || File.extname(file_path)
21
23
  basename = File.basename(file_path, extname)
@@ -27,6 +29,8 @@ class String
27
29
  def normalize_uri(force_extname = nil)
28
30
  return self unless present?
29
31
  uri = URI.parse(self)
32
+ return unless uri.scheme.in? %w(http https)
33
+ return unless uri.path.present?
30
34
  file_path = uri.path[1..]
31
35
  extname = force_extname || File.extname(file_path)
32
36
  basename = File.basename(file_path, extname)
@@ -1,3 +1,3 @@
1
1
  module Mkwebook
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mkwebook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Liu Xiang
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-12-14 00:00:00.000000000 Z
11
+ date: 2022-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport