epuber 0.9.3 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/epuber/compiler/file_resolver.rb +4 -4
- data/lib/epuber/compiler/file_types/css_file.rb +6 -3
- data/lib/epuber/compiler/file_types/source_file.rb +6 -0
- data/lib/epuber/compiler/file_types/stylus_file.rb +5 -1
- data/lib/epuber/compiler/opf_generator.rb +9 -3
- data/lib/epuber/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cdced1dd2ebd0dc9d67e06757560ed5acd26d93303db343b53985b3c7aeebe20
|
4
|
+
data.tar.gz: e979d0957ff1a554bc4f29cb4e2bbe6cd0a113a83a42ed46a6e80c8f049e8008
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2ea5b2448b893e8c1c6cb47d4868cdfcd8e16aefeb54733c880c686107439ba51ec50aa89f0f571b6322998d5fe1d4862d4b8a4e78df003fbe4d1d849ebcbc9
|
7
|
+
data.tar.gz: 6492a8277ff6d0179a5fd91e3758cc0edc5ff73faf584237336395a52d151654a7c451085ddde6e40532010b3e6d5f9046a3f058237c7879b6da184141b63877
|
@@ -36,19 +36,19 @@ module Epuber
|
|
36
36
|
attr_reader :destination_path
|
37
37
|
|
38
38
|
|
39
|
-
# @return [Array<FileTypes::
|
39
|
+
# @return [Array<Epuber::Compiler::FileTypes::AbstractFile>] all files that will be in spine
|
40
40
|
#
|
41
41
|
attr_reader :spine_files
|
42
42
|
|
43
|
-
# @return [Array<FileTypes::
|
43
|
+
# @return [Array<Epuber::Compiler::FileTypes::AbstractFile>] all files that has to be in manifest file (OPF)
|
44
44
|
#
|
45
45
|
attr_reader :manifest_files
|
46
46
|
|
47
|
-
# @return [Array<FileTypes::
|
47
|
+
# @return [Array<Epuber::Compiler::FileTypes::AbstractFile>] all files that will be copied to EPUB package
|
48
48
|
#
|
49
49
|
attr_reader :package_files
|
50
50
|
|
51
|
-
# @return [Array<FileTypes::
|
51
|
+
# @return [Array<Epuber::Compiler::FileTypes::AbstractFile>] totally all files
|
52
52
|
#
|
53
53
|
attr_reader :files
|
54
54
|
|
@@ -27,9 +27,12 @@ module Epuber
|
|
27
27
|
# @param [Compiler::CompilationContext] compilation_context
|
28
28
|
#
|
29
29
|
def process(compilation_context)
|
30
|
-
|
31
|
-
|
32
|
-
|
30
|
+
if destination_file_up_to_date?
|
31
|
+
# HACK: for now, we need to process the file again, because we need to find linked files
|
32
|
+
process_css(File.read(final_destination_path), compilation_context)
|
33
|
+
else
|
34
|
+
write_processed(process_css(File.read(abs_source_path), compilation_context))
|
35
|
+
end
|
33
36
|
end
|
34
37
|
|
35
38
|
# Processes CSS file, resolves all linked files and adds them to file resolver
|
@@ -36,6 +36,12 @@ module Epuber
|
|
36
36
|
# do nothing
|
37
37
|
end
|
38
38
|
|
39
|
+
# @return [Set<Symbol>] list of properties
|
40
|
+
#
|
41
|
+
def properties
|
42
|
+
file_request&.properties || super
|
43
|
+
end
|
44
|
+
|
39
45
|
# Source file does not change from last build
|
40
46
|
# @warning Using only this method can cause not updating files that are different for targets
|
41
47
|
#
|
@@ -11,7 +11,11 @@ module Epuber
|
|
11
11
|
# @param [Compiler::CompilationContext] compilation_context
|
12
12
|
#
|
13
13
|
def process(compilation_context)
|
14
|
-
|
14
|
+
if destination_file_up_to_date?
|
15
|
+
# HACK: for now, we need to process the file again, because we need to find linked files
|
16
|
+
process_css(File.read(final_destination_path), compilation_context)
|
17
|
+
return
|
18
|
+
end
|
15
19
|
|
16
20
|
Stylus.define('__is_debug', !compilation_context.release_build)
|
17
21
|
Stylus.define('__is_verbose_mode', compilation_context.verbose?)
|
@@ -126,7 +126,10 @@ module Epuber
|
|
126
126
|
cover_image = @target.cover_image
|
127
127
|
unless cover_image.nil?
|
128
128
|
cover_image_result = @file_resolver.file_from_request(cover_image)
|
129
|
-
|
129
|
+
if cover_image_result
|
130
|
+
@xml.meta(name: 'cover',
|
131
|
+
content: create_id_from_path(pretty_path(cover_image_result)))
|
132
|
+
end
|
130
133
|
end
|
131
134
|
|
132
135
|
if epub_version >= 3
|
@@ -164,8 +167,11 @@ module Epuber
|
|
164
167
|
|
165
168
|
properties = file.properties
|
166
169
|
if properties.length.positive? && @target.epub_version >= 3
|
167
|
-
|
168
|
-
|
170
|
+
formatted = properties.to_a
|
171
|
+
.map { |prop| PROPERTIES_MAP[prop] }
|
172
|
+
.compact
|
173
|
+
.join(' ')
|
174
|
+
attrs['properties'] = formatted unless formatted.empty?
|
169
175
|
end
|
170
176
|
|
171
177
|
@xml.item(attrs)
|
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.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roman Kříž
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-05-
|
11
|
+
date: 2024-05-13 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.5.
|
597
|
+
rubygems_version: 3.5.10
|
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.
|