epuber 0.4.0 → 0.5.0.beta
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/epuber.gemspec +1 -1
- data/lib/epuber/book/target.rb +24 -0
- data/lib/epuber/book.rb +11 -0
- data/lib/epuber/command/build.rb +1 -1
- data/lib/epuber/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1090e1e950ac74304760e03e150f009c0b5dc2708140e09d7d0a59fa04e5047a
|
4
|
+
data.tar.gz: e297a29c815dcaea61a093d8697f94373b594a4140ad376b286fb0056239589a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d368f9fe3d25cd4042b7eb1e889a5dfef03c3c930c12e3365fc73b41ec77ed6d366f2e9c8c5a4698d616a6e2d0ab044b85288185061eb2887b810bbb35edc0f
|
7
|
+
data.tar.gz: d97488e6a9d0a2745fc92fd1906fc8bdae559eca59ae8ae9e6544bb1bc049e838a6886b75cabec9b86459019d466b676fa08e4c0ea9af8c1ea19d8e8d19a805a
|
data/epuber.gemspec
CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.require_paths = ['lib']
|
23
23
|
|
24
24
|
spec.add_runtime_dependency 'activesupport', '~> 5.0'
|
25
|
-
spec.add_runtime_dependency 'nokogiri', '~> 1.
|
25
|
+
spec.add_runtime_dependency 'nokogiri', '~> 1.8.2'
|
26
26
|
spec.add_runtime_dependency 'mime-types', '~> 3.0'
|
27
27
|
spec.add_runtime_dependency 'claide', '~> 1.0'
|
28
28
|
spec.add_runtime_dependency 'listen', '~> 3.0'
|
data/lib/epuber/book/target.rb
CHANGED
@@ -62,6 +62,7 @@ module Epuber
|
|
62
62
|
#
|
63
63
|
attr_accessor :book
|
64
64
|
|
65
|
+
|
65
66
|
# @return [Epuber::Book] reference to book
|
66
67
|
#
|
67
68
|
def book
|
@@ -77,6 +78,23 @@ module Epuber
|
|
77
78
|
#
|
78
79
|
def sub_target(name)
|
79
80
|
child = create_child_item(name)
|
81
|
+
child.book = self.book
|
82
|
+
|
83
|
+
yield child if block_given?
|
84
|
+
|
85
|
+
child
|
86
|
+
end
|
87
|
+
|
88
|
+
# Create new sub_target with name
|
89
|
+
#
|
90
|
+
# @param [String] name
|
91
|
+
#
|
92
|
+
# @return [Target] new created sub target
|
93
|
+
#
|
94
|
+
def sub_abstract_target(name)
|
95
|
+
child = create_child_item(name)
|
96
|
+
child.book = self.book
|
97
|
+
child.is_abstract = true
|
80
98
|
|
81
99
|
yield child if block_given?
|
82
100
|
|
@@ -194,6 +212,12 @@ module Epuber
|
|
194
212
|
types: [TrueClass, FalseClass],
|
195
213
|
inherited: true
|
196
214
|
|
215
|
+
# @return [Bool] allows to create abstract targets that are only used as template for other targets
|
216
|
+
#
|
217
|
+
attribute :is_abstract,
|
218
|
+
types: [TrueClass, FalseClass],
|
219
|
+
inherited: false
|
220
|
+
|
197
221
|
|
198
222
|
# @param file_path [String | Epuber::Book::File]
|
199
223
|
# @param group [Symbol]
|
data/lib/epuber/book.rb
CHANGED
@@ -94,6 +94,10 @@ module Epuber
|
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|
97
|
+
def buildable_targets
|
98
|
+
flat_all_targets.select { |t| !t.is_abstract }
|
99
|
+
end
|
100
|
+
|
97
101
|
# Defines new target
|
98
102
|
#
|
99
103
|
# @param [String, Symbol] name
|
@@ -107,6 +111,13 @@ module Epuber
|
|
107
111
|
end
|
108
112
|
end
|
109
113
|
|
114
|
+
def abstract_target(name)
|
115
|
+
@default_target.sub_abstract_target(name) do |target|
|
116
|
+
target.book = self
|
117
|
+
yield target if block_given?
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
110
121
|
# Defines several new targets with same configuration
|
111
122
|
#
|
112
123
|
# @param [Array<String, Symbol>] names
|
data/lib/epuber/command/build.rb
CHANGED
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.
|
4
|
+
version: 0.5.0.beta
|
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: 2018-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 1.8.2
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 1.8.2
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: mime-types
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -536,12 +536,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
536
536
|
version: '2.2'
|
537
537
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
538
538
|
requirements:
|
539
|
-
- - "
|
539
|
+
- - ">"
|
540
540
|
- !ruby/object:Gem::Version
|
541
|
-
version:
|
541
|
+
version: 1.3.1
|
542
542
|
requirements: []
|
543
543
|
rubyforge_project:
|
544
|
-
rubygems_version: 2.
|
544
|
+
rubygems_version: 2.7.4
|
545
545
|
signing_key:
|
546
546
|
specification_version: 4
|
547
547
|
summary: Epuber is simple tool to compile and pack source files into EPUB format.
|