epuber 0.9.1 → 0.9.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3174cb09810b6ddea59dce43ac29da5f7297149f660a00dfba002594042283b
|
4
|
+
data.tar.gz: 2575207bf19ae9f6541e71e202588ccd22305e4398c37ef012970c504f0f2636
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16bc52d4b427d57d48b00062a5287c9ac67c1ecc02ecb95a62e641233ff65901aa5c40000829bfc2904692cc2e59d2b68cd3a2b0d20d9505c87ff79ad8a0501f
|
7
|
+
data.tar.gz: 1073df008d945fe0877b2de2b007358048f18e519dfc33d8be302418c0f82e3554952c7a3d51d11a6efc05a6d292d0d1f843614f627e0481c5a1c759b9325a38
|
@@ -49,8 +49,10 @@ module Epuber
|
|
49
49
|
# resolve links to files, add other linked resources and compute correct path
|
50
50
|
UI.print_step_processing_time('resolving url()') do
|
51
51
|
parser.each_rule_set do |rule_set, _media_types|
|
52
|
+
# @type [CssParser::RuleSet::Declarations]
|
52
53
|
declarations = rule_set.instance_eval { @declarations }
|
53
54
|
declarations.each do |property, decl_value|
|
55
|
+
# @type [String]
|
54
56
|
value = decl_value.to_s
|
55
57
|
next unless value =~ URL_REGEXP
|
56
58
|
|
@@ -70,8 +72,10 @@ module Epuber
|
|
70
72
|
new_url = SourceFile.resolve_relative_file(destination_path,
|
71
73
|
path,
|
72
74
|
compilation_context.file_resolver,
|
73
|
-
group: resource_group
|
74
|
-
|
75
|
+
group: resource_group,
|
76
|
+
location: self)
|
77
|
+
|
78
|
+
content = content.gsub(value, "url(#{quote}#{new_url}#{quote})") if new_url
|
75
79
|
end
|
76
80
|
end
|
77
81
|
end
|
@@ -113,7 +113,7 @@ module Epuber
|
|
113
113
|
end
|
114
114
|
end
|
115
115
|
|
116
|
-
def self.resolve_relative_file(destination_path, pattern, file_resolver, group: nil)
|
116
|
+
def self.resolve_relative_file(destination_path, pattern, file_resolver, group: nil, location: nil)
|
117
117
|
dirname = File.dirname(destination_path)
|
118
118
|
|
119
119
|
begin
|
@@ -127,7 +127,8 @@ module Epuber
|
|
127
127
|
rescue XHTMLProcessor::UnparseableLinkError,
|
128
128
|
FileFinders::FileNotFoundError,
|
129
129
|
FileFinders::MultipleFilesFoundError => e
|
130
|
-
UI.warning(e.to_s, location:
|
130
|
+
UI.warning(e.to_s, location: location)
|
131
|
+
return nil
|
131
132
|
end
|
132
133
|
end
|
133
134
|
|
@@ -218,6 +218,8 @@ module Epuber
|
|
218
218
|
end
|
219
219
|
end
|
220
220
|
|
221
|
+
return uri if path == '#'
|
222
|
+
|
221
223
|
# skip uri with scheme (links to web pages)
|
222
224
|
return uri unless uri.scheme.nil?
|
223
225
|
|
@@ -349,7 +351,8 @@ module Epuber
|
|
349
351
|
new_path = Compiler::FileTypes::SourceFile.resolve_relative_file(file_path,
|
350
352
|
path,
|
351
353
|
file_resolver,
|
352
|
-
group: resource_group
|
354
|
+
group: resource_group,
|
355
|
+
location: img)
|
353
356
|
img[attribute_name] = new_path if new_path
|
354
357
|
end
|
355
358
|
end
|
data/lib/epuber/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: epuber
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roman Kříž
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -594,7 +594,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
594
594
|
- !ruby/object:Gem::Version
|
595
595
|
version: '0'
|
596
596
|
requirements: []
|
597
|
-
rubygems_version: 3.
|
597
|
+
rubygems_version: 3.5.9
|
598
598
|
signing_key:
|
599
599
|
specification_version: 4
|
600
600
|
summary: Epuber is simple tool to compile and pack source files into EPUB format.
|